bibliothek.gui.dock.facile.mode.action
Class LocationModeAction

java.lang.Object
  extended by bibliothek.gui.dock.action.actions.AbstractStandardDockAction
      extended by bibliothek.gui.dock.action.actions.SimpleDockAction
          extended by bibliothek.gui.dock.action.actions.SimpleDropDownItemAction
              extended by bibliothek.gui.dock.action.actions.SimpleButtonAction
                  extended by bibliothek.gui.dock.facile.mode.action.LocationModeAction
All Implemented Interfaces:
SharingDropDownItemAction, SharingStandardDockAction, ButtonDockAction, DockAction, DropDownItemAction, StandardDockAction, StandardDropDownItemAction
Direct Known Subclasses:
ExternalizedModeAction, MaximizedModeAction, MinimizedModeAction, NormalModeAction

public class LocationModeAction
extends SimpleButtonAction

Action for changing the LocationMode of a Dockable.

Author:
Benjamin Sigg

Field Summary
 
Fields inherited from interface bibliothek.gui.dock.action.DockAction
BUTTON_CONTENT_FILTER
 
Constructor Summary
LocationModeAction(DockController controller, LocationMode mode, String iconKey, String textKey, String tooltipKey, PropertyKey<KeyStroke> gotoStroke)
          Creates a new action.
 
Method Summary
 void action(Dockable dockable)
          Invoked when this action is triggered by the user.
protected  void bound(Dockable dockable)
          Invoked by this AbstractStandardDockAction when a Dockable was bound to this action the first time.
protected  boolean checkTrigger(KeyEvent event)
          Checks whether this action is able to trigger this action.
protected  DockController getController()
          Gets the controller from which this action currently reads its content.
protected  void setController(DockController controller)
          Exchanges all the properties such that they are read from controller
protected  void unbound(Dockable dockable)
          Called by this AbstractStandardDockAction when the Dockable dockable will not be used in any means by this action.
 
Methods inherited from class bibliothek.gui.dock.action.actions.SimpleButtonAction
addActionListener, createView, getCommand, removeActionListener, setCommand, trigger
 
Methods inherited from class bibliothek.gui.dock.action.actions.SimpleDropDownItemAction
isDropDownSelectable, isDropDownSelectable, isDropDownTriggerable, isDropDownTriggerableNotSelected, isDropDownTriggerableSelected, setDropDownSelectable, setDropDownTriggerableNotSelected, setDropDownTriggerableSelected
 
Methods inherited from class bibliothek.gui.dock.action.actions.SimpleDockAction
getAccelerator, getDisabledIcon, getDockableRepresentation, getDockableRepresentation, getIcon, getIcon, getIcon, getIconContexts, getText, getText, getTooltip, getTooltipText, getTooltipText, isEnabled, isEnabled, setAccelerator, setDisabledIcon, setDockableRepresentation, setEnabled, setIcon, setIcon, setText, setTooltip, trigger
 
Methods inherited from class bibliothek.gui.dock.action.actions.AbstractStandardDockAction
addDockActionListener, bind, fireActionEnabledChanged, fireActionIconChanged, fireActionRepresentativeChanged, fireActionTextChanged, fireActionTooltipTextChanged, getBoundDockables, isBound, removeDockActionListener, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bibliothek.gui.dock.action.dropdown.DropDownItemAction
isDropDownSelectable, isDropDownTriggerable
 
Methods inherited from interface bibliothek.gui.dock.action.StandardDockAction
addDockActionListener, getDockableRepresentation, getIcon, getIconContexts, getText, getTooltipText, isEnabled, removeDockActionListener
 
Methods inherited from interface bibliothek.gui.dock.action.DockAction
bind, unbind
 
Methods inherited from interface bibliothek.gui.dock.action.actions.SharingStandardDockAction
getAccelerator, getDisabledIcon, getDockableRepresentation, getIcon, getIcon, getText, getTooltip, getTooltipText, isEnabled, setAccelerator, setDisabledIcon, setDockableRepresentation, setEnabled, setIcon, setIcon, setText, setTooltip
 

Constructor Detail

LocationModeAction

public LocationModeAction(DockController controller,
                          LocationMode mode,
                          String iconKey,
                          String textKey,
                          String tooltipKey,
                          PropertyKey<KeyStroke> gotoStroke)
Creates a new action.

Parameters:
controller - the controller in whose realm this action works
mode - the mode that is applied to any Dockable for which this button is pressed
iconKey - the key of an icon to be used on this action
textKey - the key for the text of this action when searching the TextManager
tooltipKey - the key for the tooltip of this action when searching the TextManager
gotoStroke - the key for an accelerator which triggers this action
Method Detail

action

public void action(Dockable dockable)
Description copied from interface: ButtonDockAction
Invoked when this action is triggered by the user.

Specified by:
action in interface ButtonDockAction
Overrides:
action in class SimpleButtonAction
Parameters:
dockable - The Dockable which is associated with this DockAction, and which shall be used for the current action.

setController

protected void setController(DockController controller)
Exchanges all the properties such that they are read from controller

Parameters:
controller - the controller from which to read properties, or null

getController

protected DockController getController()
Gets the controller from which this action currently reads its content.

Returns:
the controller or null

checkTrigger

protected boolean checkTrigger(KeyEvent event)
Checks whether this action is able to trigger this action.

Parameters:
event - an event that matches the accelerator of this action
Returns:
true if this action really is triggered

bound

protected void bound(Dockable dockable)
Description copied from class: AbstractStandardDockAction
Invoked by this AbstractStandardDockAction when a Dockable was bound to this action the first time.

Overrides:
bound in class SimpleDockAction
Parameters:
dockable - The Dockable that was not known to this action before the method was invoked

unbound

protected void unbound(Dockable dockable)
Description copied from class: AbstractStandardDockAction
Called by this AbstractStandardDockAction when the Dockable dockable will not be used in any means by this action. Note that the AbstractStandardDockAction.bound(Dockable)-method can be invoked again with the dockable.

Overrides:
unbound in class SimpleDockAction
Parameters:
dockable - The Dockable which will not by used in any way.