public class SelectableMenuHandler extends AbstractMenuHandler<JMenuItem,SelectableDockAction>
JMenuItem
and
a SelectableDockAction
are always the same.action, dockable, item
Constructor and Description |
---|
SelectableMenuHandler(SelectableDockAction action,
Dockable dockable,
JMenuItem item)
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()
Connects this handler to its action.
|
void |
removeActionListener(ActionListener listener)
Removes a listener from this view.
|
void |
unbind()
Disconnects this handler from its action
|
getAction, getDockable, getItem
public SelectableMenuHandler(SelectableDockAction action, Dockable dockable, JMenuItem item)
action
- the action to observedockable
- the Dockable for which actions are dispatcheditem
- the item to managepublic void addActionListener(ActionListener listener)
MenuViewItem
listener
- the new listenerpublic void removeActionListener(ActionListener listener)
MenuViewItem
listener
- the listener to removepublic void bind()
AbstractMenuHandler
bind
in interface ViewItem<JComponent>
bind
in class AbstractMenuHandler<JMenuItem,SelectableDockAction>
public void unbind()
AbstractMenuHandler
unbind
in interface ViewItem<JComponent>
unbind
in class AbstractMenuHandler<JMenuItem,SelectableDockAction>