bibliothek.gui.dock.action
Interface DropDownAction

All Superinterfaces:
DockAction, StandardDockAction
All Known Implementing Classes:
AbstractSimpleDropDownAction, SimpleDropDownAction

public interface DropDownAction
extends StandardDockAction

A DockAction that consists of other actions. The user can either open a popup menu and select one of the subactions, or click onto this action to trigger the last selected action again.

Author:
Benjamin Sigg

Method Summary
 void addDropDownActionListener(DropDownActionListener listener)
          Adds a listener to this action.
 DropDownFilterFactory getFilter(Dockable dockable)
          Gets a filter that chooses the values that will be shown for this action and its selection.
 DockAction getSelection(Dockable dockable)
          Gets the last selected action, which may be null.
 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 setSelection(Dockable dockable, DockAction selection)
          Sets the current selection.
 
Methods inherited from interface bibliothek.gui.dock.action.StandardDockAction
addDockActionListener, getDisabledIcon, getDockableRepresentation, getIcon, getText, getTooltipText, isEnabled, removeDockActionListener
 
Methods inherited from interface bibliothek.gui.dock.action.DockAction
bind, createView, trigger, unbind
 

Method Detail

getSelection

DockAction getSelection(Dockable dockable)
Gets the last selected action, which may be null.

Parameters:
dockable - the Dockable for which the last action is requested
Returns:
the action, may be null

setSelection

void setSelection(Dockable dockable,
                  DockAction selection)
Sets the current selection. The item selection 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.

Parameters:
dockable - the dockable for which the selection has been changed
selection - the new selection, may be null

getSubActions

DockActionSource getSubActions(Dockable dockable)
Gets the actions that should be shown for this action.

Parameters:
dockable - the Dockable for which the actions are requested
Returns:
the children

addDropDownActionListener

void addDropDownActionListener(DropDownActionListener listener)
Adds a listener to this action. The listener will be informed if actions are added or removed, or if the selected action changes.

Parameters:
listener - the listener

removeDropDownActionListener

void removeDropDownActionListener(DropDownActionListener listener)
Removes a listener from this action.

Parameters:
listener - the listener to remove

getFilter

DropDownFilterFactory getFilter(Dockable dockable)
Gets a filter that chooses the values that will be shown for this action and its selection.

Parameters:
dockable - the dockable for which all values will be used
Returns:
the filter