bibliothek.gui.dock.themes.basic.action
Class BasicSeparatorHandler

java.lang.Object
  extended by bibliothek.gui.dock.themes.basic.action.BasicSeparatorHandler
All Implemented Interfaces:
ViewItem<javax.swing.JComponent>, BasicTitleViewItem<javax.swing.JComponent>, MenuViewItem<javax.swing.JComponent>

public class BasicSeparatorHandler
extends java.lang.Object
implements BasicTitleViewItem<javax.swing.JComponent>, MenuViewItem<javax.swing.JComponent>

A handler that shows a JSeparator for a SeparatorAction.

Author:
Benjamin Sigg

Constructor Summary
BasicSeparatorHandler(javax.swing.JSeparator separator, SeparatorAction action)
          Creates a new handler
 
Method Summary
 void addActionListener(java.awt.event.ActionListener listener)
          Adds a listener which will be called if this view is triggered.
 void bind()
          Binds this item to its action
 DockAction getAction()
          Gets the action that is represented by this target.
 javax.swing.JComponent getItem()
          Gets this item as component.
 void removeActionListener(java.awt.event.ActionListener listener)
          Removes a listener from this view.
 void setBackground(java.awt.Color background)
          Called by the title that shows this item to tell this item what the background color of the title is.
 void setForeground(java.awt.Color foreground)
          Called by the title that shows this item to tell this item what the foreground color of the title is.
 void setOrientation(DockTitle.Orientation orientation)
          Informs the item about the orientation of the title that uses this item.
 void unbind()
          Unbinds this item from its action
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicSeparatorHandler

public BasicSeparatorHandler(javax.swing.JSeparator separator,
                             SeparatorAction action)
Creates a new handler

Parameters:
separator - the separator to show
action - the action for which the action is shown
Method Detail

bind

public void bind()
Description copied from interface: ViewItem
Binds this item to its action

Specified by:
bind in interface ViewItem<javax.swing.JComponent>

addActionListener

public void addActionListener(java.awt.event.ActionListener listener)
Description copied from interface: MenuViewItem
Adds a listener which will be called if this view is triggered. The listener should only be called, if the user clicked directly onto this view.

Specified by:
addActionListener in interface MenuViewItem<javax.swing.JComponent>
Parameters:
listener - the new listener

removeActionListener

public void removeActionListener(java.awt.event.ActionListener listener)
Description copied from interface: MenuViewItem
Removes a listener from this view.

Specified by:
removeActionListener in interface MenuViewItem<javax.swing.JComponent>
Parameters:
listener - the listener to remove

setOrientation

public void setOrientation(DockTitle.Orientation orientation)
Description copied from interface: BasicTitleViewItem
Informs the item about the orientation of the title that uses this item.

Specified by:
setOrientation in interface BasicTitleViewItem<javax.swing.JComponent>
Parameters:
orientation - the orientation

getAction

public DockAction getAction()
Description copied from interface: ViewItem
Gets the action that is represented by this target.

Specified by:
getAction in interface ViewItem<javax.swing.JComponent>
Returns:
the action, might be null

getItem

public javax.swing.JComponent getItem()
Description copied from interface: ViewItem
Gets this item as component.

Specified by:
getItem in interface ViewItem<javax.swing.JComponent>
Returns:
this item

setBackground

public void setBackground(java.awt.Color background)
Description copied from interface: BasicTitleViewItem
Called by the title that shows this item to tell this item what the background color of the title is.

Specified by:
setBackground in interface BasicTitleViewItem<javax.swing.JComponent>
Parameters:
background - the background color of the title

setForeground

public void setForeground(java.awt.Color foreground)
Description copied from interface: BasicTitleViewItem
Called by the title that shows this item to tell this item what the foreground color of the title is.

Specified by:
setForeground in interface BasicTitleViewItem<javax.swing.JComponent>
Parameters:
foreground - the foreground color of the title

unbind

public void unbind()
Description copied from interface: ViewItem
Unbinds this item from its action

Specified by:
unbind in interface ViewItem<javax.swing.JComponent>