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, getItemclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittriggeredpublic DropDownView getView()
nullpublic void addActionListener(ActionListener listener)
MenuViewItemaddActionListener in interface MenuViewItem<JComponent>listener - the new listenerpublic boolean isSelectable()
DropDownViewItemfalse.isSelectable in interface DropDownViewItempublic boolean isTriggerable(boolean selected)
DropDownViewItemisTriggerable in interface DropDownViewItemselected - 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)
MenuViewItemremoveActionListener in interface MenuViewItem<JComponent>listener - the listener to removepublic void setView(DropDownView view)
DropDownViewItemsetView in interface DropDownViewItemview - the view, might be nullpublic void bind()
AbstractMenuHandlerbind in interface ViewItem<JComponent>bind in class AbstractMenuHandler<JMenuItem,S extends StandardDropDownItemAction>public void unbind()
AbstractMenuHandlerunbind in interface ViewItem<JComponent>unbind in class AbstractMenuHandler<JMenuItem,S extends StandardDropDownItemAction>Copyright © 2017 Docking Frames. All rights reserved.