public class SubDropDownHandler extends java.lang.Object implements DropDownViewItem
Constructor and Description |
---|
SubDropDownHandler(MenuViewItem<javax.swing.JComponent> view)
Creates a new handler.
|
Modifier and Type | Method and Description |
---|---|
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.
|
boolean |
isSelectable()
Tells whether this item can be selected by the button.
|
boolean |
isTriggerable(boolean selected)
Tells whether the item can be triggered if it is on the button or
in the menu.
|
void |
removeActionListener(java.awt.event.ActionListener listener)
Removes a listener from this view.
|
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()
Unbinds this item from its action
|
public SubDropDownHandler(MenuViewItem<javax.swing.JComponent> view)
view
- the item as it will appear in the menupublic void triggered()
DropDownViewItem
triggered
in interface DropDownViewItem
public void setView(DropDownView view)
DropDownViewItem
setView
in interface DropDownViewItem
view
- the view, might be null
public boolean isSelectable()
DropDownViewItem
false
.isSelectable
in interface DropDownViewItem
public boolean isTriggerable(boolean selected)
DropDownViewItem
isTriggerable
in interface DropDownViewItem
selected
- if true
, then this item is currently shown
directly on the main button, otherwise it is in the drop-down menu.true
if the item can be triggeredpublic void addActionListener(java.awt.event.ActionListener listener)
MenuViewItem
addActionListener
in interface MenuViewItem<javax.swing.JComponent>
listener
- the new listenerpublic void removeActionListener(java.awt.event.ActionListener listener)
MenuViewItem
removeActionListener
in interface MenuViewItem<javax.swing.JComponent>
listener
- the listener to removepublic void bind()
ViewItem
public DockAction getAction()
ViewItem
public javax.swing.JComponent getItem()
ViewItem