bibliothek.gui.dock.action
Interface DockAction

All Known Subinterfaces:
ButtonDockAction, CommonDecoratableDockAction, CommonDockAction, CommonDropDownItem, CommonSelectableAction, DropDownAction, ListeningDockAction, MenuDockAction, SelectableDockAction, SharingDropDownDockAction, SharingDropDownItemAction, SharingSelectableDockAction, SharingStandardDockAction, StandardDockAction, StandardDropDownItemAction
All Known Implementing Classes:
AbstractSimpleDropDownAction, AbstractStandardDockAction, CCloseAction.Action, CExtendedModeAction.Action, CloseAction, CommonSeparatorAction, CommonSimpleButtonAction, CommonSimpleCheckAction, CommonSimpleDropDownAction, CommonSimpleMenuAction, CommonSimpleRadioAction, CPanelPopup.PanelPopup, DockFrontend.Hider, ExternalizedModeAction, FlapDockDirection, FlapDockHoldToggle, GroupedButtonDockAction, GroupedDockAction, GroupedDropDownItemAction, GroupedSelectableDockAction, GroupedSelectableDockAction.Check, GroupedSelectableDockAction.Radio, LocationModeAction, MaximizedModeAction, MinimizedModeAction, NormalModeAction, RenameAction, RenameAction.RenameDefaultDockable, RenameAction.RenameFlapDockStation, RenameAction.RenameSplitDockStation, RenameAction.RenameStackDockStation, ReplaceAction, ScreenFullscreenAction, SeparatorAction, SimpleButtonAction, SimpleDockAction, SimpleDropDownAction, SimpleDropDownItemAction, SimpleMenuAction, SimpleSelectableAction, SimpleSelectableAction.Check, SimpleSelectableAction.Radio, SplitFullScreenAction, StationChildrenActionSource.FocusAction

public interface DockAction

A DockAction is an object that represents an action which can be triggered by the user. Every DockAction has a graphical representation which is shown at many places, for example on a DockTitle or in a popupmenu.
A DockAction may choose its own graphical representation, or use the ActionViewConverter to get the default-representations.
Every DockAction is associated with some Dockables. The bind(Dockable)-method will be invoked before a representation is shown, and the unbind(Dockable) when a representation is no longer shown.

Author:
Benjamin Sigg

Field Summary
static PropertyKey<ButtonContentFilter> BUTTON_CONTENT_FILTER
          The ButtonContentFilter decides whether text is shown on buttons that represent DockActions.
 
Method Summary
 void bind(Dockable dockable)
          Informs this DockAction that icons, text, and other stuff like that, will be requested from this DockAction.
<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.
 boolean trigger(Dockable dockable)
          Does the appropriate action that can be done respecting the current state of this action.
 void unbind(Dockable dockable)
          Invoked only if the dockable was bound to this DockAction, and if the dockable will no longer be used for any method calls (except bind) on this DockAction.
 

Field Detail

BUTTON_CONTENT_FILTER

static final PropertyKey<ButtonContentFilter> BUTTON_CONTENT_FILTER
The ButtonContentFilter decides whether text is shown on buttons that represent DockActions.

Method Detail

createView

<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. 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.

Type Parameters:
V - the type of view requested
Parameters:
target - The platform on which the view will be used
converter - A set of methods that can be used to create a view
dockable - The Dockable for which the view will be shown. Note that this action may not yet be bound to this action.
Returns:
a new view

bind

void bind(Dockable dockable)
Informs this DockAction that icons, text, and other stuff like that, will be requested from this DockAction. This method should be called from the object that will display the view of this action.

Parameters:
dockable - the Dockable that may be used in the future
See Also:
unbind(Dockable)

unbind

void unbind(Dockable dockable)
Invoked only if the dockable was bound to this DockAction, and if the dockable will no longer be used for any method calls (except bind) on this DockAction.

Parameters:
dockable - The Dockable that will never be seen again, except it is maybe bind again.

trigger

boolean trigger(Dockable dockable)
Does the appropriate action that can be done respecting the current state of this action.

Parameters:
dockable - the element for which this action is called
Returns:
true if this action could do anything, false if this action was not able to react in any way to the event.