public class DropDownMenuHandler extends Object implements MenuViewItem<JComponent>
DropDownAction
in a menu. The action is
shown as if it were an ordinary menu.Constructor and Description |
---|
DropDownMenuHandler(DropDownAction action,
Dockable dockable)
Creates a new handler
|
Modifier and Type | Method and Description |
---|---|
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
|
public DropDownMenuHandler(DropDownAction action, Dockable dockable)
action
- the action to showdockable
- the Dockable for which the action is shownpublic void addActionListener(ActionListener listener)
MenuViewItem
addActionListener
in interface MenuViewItem<JComponent>
listener
- the new listenerpublic void removeActionListener(ActionListener listener)
MenuViewItem
removeActionListener
in interface MenuViewItem<JComponent>
listener
- the listener to removepublic void bind()
ViewItem
bind
in interface ViewItem<JComponent>
public void unbind()
ViewItem
unbind
in interface ViewItem<JComponent>
public DockAction getAction()
ViewItem
getAction
in interface ViewItem<JComponent>
null
public JComponent getItem()
ViewItem
getItem
in interface ViewItem<JComponent>
null