bibliothek.gui.dock.themes.basic.action.menu
Class DropDownMenuHandler

java.lang.Object
  extended by bibliothek.gui.dock.themes.basic.action.menu.DropDownMenuHandler
All Implemented Interfaces:
ViewItem<JComponent>, MenuViewItem<JComponent>

public class DropDownMenuHandler
extends Object
implements MenuViewItem<JComponent>

A handler that shows a DropDownAction in a menu. The action is shown as if it were an ordinary menu.

Author:
Benjamin Sigg

Constructor Summary
DropDownMenuHandler(DropDownAction action, Dockable dockable)
          Creates a new handler
 
Method Summary
 void addActionListener(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.
 JComponent getItem()
          Gets this item as component.
 void removeActionListener(ActionListener listener)
          Removes a listener from this view.
 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

DropDownMenuHandler

public DropDownMenuHandler(DropDownAction action,
                           Dockable dockable)
Creates a new handler

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

addActionListener

public void addActionListener(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<JComponent>
Parameters:
listener - the new listener

removeActionListener

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

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

bind

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

Specified by:
bind in interface ViewItem<JComponent>

unbind

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

Specified by:
unbind in interface ViewItem<JComponent>

getAction

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

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

getItem

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

Specified by:
getItem in interface ViewItem<JComponent>
Returns:
this item, depending on the subclass this may or may not be null