S
- the type of action handled by this handlerpublic abstract class AbstractDropDownHandler<S extends StandardDropDownItemAction> extends AbstractMenuHandler<JMenuItem,S> implements DropDownViewItem
StandardDropDownItemAction
with a
drop-down-button.action, dockable, item
Constructor and Description |
---|
AbstractDropDownHandler(S action,
Dockable dockable,
JMenuItem item)
Creates an 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.
|
DropDownView |
getView()
Gets the view that can be used to send properties directly to the drop-down-button.
|
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(ActionListener listener)
Removes a listener from this view.
|
void |
setView(DropDownView view)
Sends the current settings of this item to the view.
|
void |
unbind()
Disconnects this handler from its action
|
getAction, getDockable, getItem
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
triggered
public DropDownView getView()
null
public void addActionListener(ActionListener listener)
MenuViewItem
addActionListener
in interface MenuViewItem<JComponent>
listener
- the new listenerpublic 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 removeActionListener(ActionListener listener)
MenuViewItem
removeActionListener
in interface MenuViewItem<JComponent>
listener
- the listener to removepublic void setView(DropDownView view)
DropDownViewItem
setView
in interface DropDownViewItem
view
- the view, might be null
public void bind()
AbstractMenuHandler
bind
in interface ViewItem<JComponent>
bind
in class AbstractMenuHandler<JMenuItem,S extends StandardDropDownItemAction>
public void unbind()
AbstractMenuHandler
unbind
in interface ViewItem<JComponent>
unbind
in class AbstractMenuHandler<JMenuItem,S extends StandardDropDownItemAction>