bibliothek.gui.dock.action
Interface StandardDockAction

All Superinterfaces:
DockAction
All Known Subinterfaces:
ButtonDockAction, CommonDecoratableDockAction, CommonDropDownItem, CommonSelectableAction, DropDownAction, MenuDockAction, SelectableDockAction, SharingDropDownDockAction, SharingDropDownItemAction, SharingSelectableDockAction, SharingStandardDockAction, StandardDropDownItemAction
All Known Implementing Classes:
AbstractSimpleDropDownAction, AbstractStandardDockAction, CCloseAction.Action, CExtendedModeAction.Action, CloseAction, 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, SimpleButtonAction, SimpleDockAction, SimpleDropDownAction, SimpleDropDownItemAction, SimpleMenuAction, SimpleSelectableAction, SimpleSelectableAction.Check, SimpleSelectableAction.Radio, SplitFullScreenAction, StationChildrenActionSource.FocusAction

public interface StandardDockAction
extends DockAction

A StandardDockAction is an object that is shown as graphical interface (like a button) on some Components. The user can trigger an action, for example by pressing a button.
StandardDockActions are linked with one or many Dockables.
Note: this interface allows that one action is used for many Dockables with unspecified type. However, some implementations may have restrictions, read the documentation of those actions carefully.

Author:
Benjamin Sigg

Field Summary
 
Fields inherited from interface bibliothek.gui.dock.action.DockAction
BUTTON_CONTENT_FILTER
 
Method Summary
 void addDockActionListener(StandardDockActionListener listener)
          Adds a listener to this DockAction.
 Dockable getDockableRepresentation(Dockable dockable)
          Tells whether this DockAction represents a Dockable.
 Icon getIcon(Dockable dockable, ActionContentModifier modifier)
          Gets the Icon of this DockAction, when this DockAction is shown together with dockable.
 ActionContentModifier[] getIconContexts(Dockable dockable)
          Gets all the ActionContentModifiers for which getIcon(Dockable, ActionContentModifier) would return a value other than null.
 String getText(Dockable dockable)
          Gets the text of this DockActon, when this DockAction is shown together with dockable.
 String getTooltipText(Dockable dockable)
          Gets a tooltip for this DockActon, when this DockAction is shown together with dockable.
 boolean isEnabled(Dockable dockable)
          Tells whether this DockAction can be triggered together with the dockable.
 void removeDockActionListener(StandardDockActionListener listener)
          Removes a listener from this DockStation.
 
Methods inherited from interface bibliothek.gui.dock.action.DockAction
bind, createView, trigger, unbind
 

Method Detail

getIcon

Icon getIcon(Dockable dockable,
             ActionContentModifier modifier)
Gets the Icon of this DockAction, when this DockAction is shown together with dockable. This method must ignore the backup property of modifier.

Parameters:
dockable - The Dockable for which the action-icon should be chosen.
modifier - how the icon will be used
Returns:
The icon to show for this action when the action is associated with dockable, or null.

getIconContexts

ActionContentModifier[] getIconContexts(Dockable dockable)
Gets all the ActionContentModifiers for which getIcon(Dockable, ActionContentModifier) would return a value other than null.

Parameters:
dockable - the Dockable for which the action-icons may be chosen.
Returns:
the contexts in which an icon is present

getText

String getText(Dockable dockable)
Gets the text of this DockActon, when this DockAction is shown together with dockable.

Parameters:
dockable - The Dockable for which the action-text should be chosen.
Returns:
The text to show for this action when the action is associated with dockable, or null.

getTooltipText

String getTooltipText(Dockable dockable)
Gets a tooltip for this DockActon, when this DockAction is shown together with dockable.

Parameters:
dockable - The Dockable for which the action-tooltip should be chosen.
Returns:
The tooltip to show for this action when the action is associated with dockable, or null.

addDockActionListener

void addDockActionListener(StandardDockActionListener listener)
Adds a listener to this DockAction. The listener should be triggered whenever an icon, a text, a tooltip, or the selected/enabled state changes.

Parameters:
listener - The listener to add

removeDockActionListener

void removeDockActionListener(StandardDockActionListener listener)
Removes a listener from this DockStation. Note that this can happen at any time, even while this DockAction is sending an event.

Parameters:
listener - The listener to remove

isEnabled

boolean isEnabled(Dockable dockable)
Tells whether this DockAction can be triggered together with the dockable.

Parameters:
dockable - The Dockable for which this action maybe triggered.
Returns:
true if the user should be able to trigger this action, false otherwise

getDockableRepresentation

Dockable getDockableRepresentation(Dockable dockable)
Tells whether this DockAction represents a Dockable. If so, the framework may register views for this action as DockElementRepresentative.

Parameters:
dockable - The Dockable for which this action may be triggered
Returns:
the Dockable which is represented by this action, can be null. Normally dockable should not be the result.