bibliothek.gui.dock.themes.basic.action.dropdown
Class SelectableDropDownHandler

java.lang.Object
  extended by bibliothek.gui.dock.themes.basic.action.menu.AbstractMenuHandler<JMenuItem,S>
      extended by bibliothek.gui.dock.themes.basic.action.dropdown.AbstractDropDownHandler<SelectableDockAction>
          extended by bibliothek.gui.dock.themes.basic.action.dropdown.SelectableDropDownHandler
All Implemented Interfaces:
ViewItem<JComponent>, DropDownViewItem, MenuViewItem<JComponent>

public class SelectableDropDownHandler
extends AbstractDropDownHandler<SelectableDockAction>

A connection between a SelectableDockAction and a drop-down-button.

Author:
Benjamin Sigg

Field Summary
 
Fields inherited from class bibliothek.gui.dock.themes.basic.action.menu.AbstractMenuHandler
action, dockable, item
 
Constructor Summary
SelectableDropDownHandler(SelectableDockAction action, Dockable dockable, JMenuItem item)
          Creates a new handler.
 
Method Summary
 void bind()
          Connects this handler to its action.
protected  void itemTriggered()
          Called if the menuitem was clicked.
 void setView(DropDownView view)
          Sends the current settings of this item to the view.
 void triggered()
          Invoked if the item is triggered from outside.
 void unbind()
          Disconnects this handler from its action
 
Methods inherited from class bibliothek.gui.dock.themes.basic.action.dropdown.AbstractDropDownHandler
addActionListener, getView, isSelectable, isTriggerable, removeActionListener
 
Methods inherited from class bibliothek.gui.dock.themes.basic.action.menu.AbstractMenuHandler
getAction, getDockable, getItem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bibliothek.gui.dock.action.view.ViewItem
getAction, getItem
 

Constructor Detail

SelectableDropDownHandler

public SelectableDropDownHandler(SelectableDockAction action,
                                 Dockable dockable,
                                 JMenuItem item)
Creates a new handler.

Parameters:
action - the action to observe
dockable - the Dockable for which the action is shown
item - the graphical representation of the action
Method Detail

bind

public void bind()
Description copied from class: AbstractMenuHandler
Connects this handler to its action.

Specified by:
bind in interface ViewItem<JComponent>
Overrides:
bind in class AbstractDropDownHandler<SelectableDockAction>

unbind

public void unbind()
Description copied from class: AbstractMenuHandler
Disconnects this handler from its action

Specified by:
unbind in interface ViewItem<JComponent>
Overrides:
unbind in class AbstractDropDownHandler<SelectableDockAction>

setView

public void setView(DropDownView view)
Description copied from interface: DropDownViewItem
Sends the current settings of this item to the view. The values can be changed as long as the view is registered.

Specified by:
setView in interface DropDownViewItem
Overrides:
setView in class AbstractDropDownHandler<SelectableDockAction>
Parameters:
view - the view, might be null

itemTriggered

protected void itemTriggered()
Called if the menuitem was clicked. The default implementation forwards the call to triggered(). This method is not called if the item if in a drop-down-menu and cannot be triggered in the unselected-state.


triggered

public void triggered()
Description copied from interface: DropDownViewItem
Invoked if the item is triggered from outside. The item should call the method of its action that causes the action to execute its natural code (for example: a checkbox may change its selected-state).