public abstract class AbstractSimpleDropDownAction extends SimpleDockAction implements DropDownAction
DockActionSource which has to be specified
by a subclass.BUTTON_CONTENT_FILTER| Constructor and Description |
|---|
AbstractSimpleDropDownAction(boolean monitorDisabling)
Creates a new action
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDropDownActionListener(DropDownActionListener listener)
Adds a listener to this action.
|
<V> V |
createView(ViewTarget<V> target,
ActionViewConverter converter,
Dockable dockable)
Creates a view for this action, for the platform
target and
with help of converter. |
protected void |
fireSelectionChanged()
Informs all listeners that the selection has changed.
|
DropDownFilterFactory |
getFilter(Dockable dockable)
Gets a filter that chooses the values that will be shown for this
action and its selection.
|
protected DropDownActionListener[] |
getListeners()
Gets an array of all listeners that are registered to this action.
|
DockAction |
getSelection()
Returns the currently selected action.
|
DockAction |
getSelection(Dockable dockable)
Gets the last selected action, which may be
null. |
protected abstract DockActionSource |
getSubActions()
Gets the
DockActionSource which contains all the actions of this dropdown menu. |
DockActionSource |
getSubActions(Dockable dockable)
Gets the actions that should be shown for this action.
|
void |
removeDropDownActionListener(DropDownActionListener listener)
Removes a listener from this action.
|
void |
setFilter(DropDownFilterFactory filter)
Sets the filter that will be used to filter text, icon, tooltips, etc.
|
void |
setSelection(Dockable dockable,
DockAction selection)
Sets the current selection.
|
void |
setSelection(DockAction selection)
Changes the selection of this drop-down-action.
|
boolean |
trigger(Dockable dockable)
Does the appropriate action that can be done respecting the current
state of this action.
|
bound, getAccelerator, getDisabledIcon, getDockableRepresentation, getDockableRepresentation, getIcon, getIcon, getIcon, getIconContexts, getText, getText, getTooltip, getTooltipText, getTooltipText, isAcceleratorGlobal, isEnabled, isEnabled, setAccelerator, setAcceleratorIsGlobal, setDisabledIcon, setDockableRepresentation, setEnabled, setIcon, setIcon, setText, setTooltip, trigger, unboundaddDockActionListener, bind, fireActionEnabledChanged, fireActionIconChanged, fireActionRepresentativeChanged, fireActionTextChanged, fireActionTooltipTextChanged, getBoundDockables, isBound, removeDockActionListener, unbindclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddDockActionListener, getDockableRepresentation, getIcon, getIconContexts, getText, getTooltipText, isEnabled, removeDockActionListenerbind, unbindpublic AbstractSimpleDropDownAction(boolean monitorDisabling)
monitorDisabling - whether the current DisablingStrategy should be monitoredpublic <V> V createView(ViewTarget<V> target, ActionViewConverter converter, Dockable dockable)
DockActiontarget and
with help of converter. Clients might use their own
code to create a new view, but the preferred way is to call
ActionViewConverter.createView(ActionType, DockAction, ViewTarget, Dockable)
with an ActionType that fits to this DockAction.createView in interface DockActionV - the type of view requestedtarget - The platform on which the view will be usedconverter - A set of methods that can be used to create a viewdockable - The Dockable for which the view will be shown. Note that
this action may not yet be bound to this action.public DockAction getSelection(Dockable dockable)
DropDownActionnull.getSelection in interface DropDownActiondockable - the Dockable for which the last action is requestednullpublic DockAction getSelection()
nullpublic void setSelection(Dockable dockable, DockAction selection)
DropDownActionselection should
be part of the menu
it should be selectable. The behavior of this method is not
defined if those two conditions are not fulfilled.setSelection in interface DropDownActiondockable - the dockable for which the selection has been changedselection - the new selection, may be nullpublic void setSelection(DockAction selection)
selection - the newly selected actionpublic void setFilter(DropDownFilterFactory filter)
filter - the filter, not nullpublic DropDownFilterFactory getFilter(Dockable dockable)
DropDownActiongetFilter in interface DropDownActiondockable - the dockable for which all values will be usedprotected abstract DockActionSource getSubActions()
DockActionSource which contains all the actions of this dropdown menu.nullpublic DockActionSource getSubActions(Dockable dockable)
DropDownActiongetSubActions in interface DropDownActiondockable - the Dockable for which the actions are requestedpublic void addDropDownActionListener(DropDownActionListener listener)
DropDownActionaddDropDownActionListener in interface DropDownActionlistener - the listenerpublic void removeDropDownActionListener(DropDownActionListener listener)
DropDownActionremoveDropDownActionListener in interface DropDownActionlistener - the listener to removeprotected DropDownActionListener[] getListeners()
protected void fireSelectionChanged()
public boolean trigger(Dockable dockable)
DockActiontrigger in interface DockActiondockable - the element for which this action is calledtrue if this action could do anything, false
if this action was not able to react in any way to the event.Copyright © 2017 Docking Frames. All rights reserved.