bibliothek.gui.dock.common.intern.action
Class CExtendedModeAction

java.lang.Object
  extended by bibliothek.gui.dock.common.action.CAction
      extended by bibliothek.gui.dock.common.intern.action.CDecorateableAction<A>
          extended by bibliothek.gui.dock.common.intern.action.CDropDownItem<CExtendedModeAction.Action>
              extended by bibliothek.gui.dock.common.intern.action.CExtendedModeAction
Direct Known Subclasses:
CExternalizeAction, CMaximizeAction, CMinimizeAction, CNormalizeAction, CUnexternalizeAction, CUnmaximizeExternalizedAction

@FrameworkOnly
public class CExtendedModeAction
extends CDropDownItem<CExtendedModeAction.Action>

This action is intended to change the ExtendedMode of a CDockable by calling CDockable.setExtendedMode(ExtendedMode).

Author:
Benjamin Sigg

Nested Class Summary
 class CExtendedModeAction.Action
          The internal representation of a CExtendedModeAction.
 
Constructor Summary
protected CExtendedModeAction()
          Creates an empty, non initialized action.
protected CExtendedModeAction(CControl control, ExtendedMode mode, String iconKey, String textKey, String tooltipKey, PropertyKey<KeyStroke> gotoStroke)
          Creates a new action.
 
Method Summary
 void action(CDockable dockable)
          This method actually changes the ExtendedMode of dockable to the mode that was given to this action in the constructor.
protected  boolean checkTrigger(KeyEvent event)
          Checks whether this action is able to trigger this action.
protected  CExtendedModeAction.Action createAction()
          Creates an instance of the action representing this CExtendedModeAction.
protected  DockController getController()
          Gets the controller from which this action currently reads its content.
protected  void init(CControl control, ExtendedMode mode, String iconKey, String textKey, String tooltipKey, PropertyKey<KeyStroke> gotoStroke)
          Creates a new action, this method must be called only once.
protected  void setController(DockController controller)
          Exchanges all the properties such that they are read from controller
 
Methods inherited from class bibliothek.gui.dock.common.intern.action.CDropDownItem
isDropDownSelectable, isDropDownTriggerableNotSelected, isDropDownTriggerableSelected, setDropDownSelectable, setDropDownTriggerableNotSelected, setDropDownTriggerableSelected
 
Methods inherited from class bibliothek.gui.dock.common.intern.action.CDecorateableAction
addDecorateableActionListener, getAccelerator, getDisabledHoverIcon, getDisabledIcon, getDisabledPressedIcon, getHoverIcon, getIcon, getPressedIcon, getText, getTooltip, init, intern, isEnabled, isShowTextOnButtons, removeDecorateableActionListener, setAccelerator, setDisabledHoverIcon, setDisabledIcon, setDisabledPressedIcon, setEnabled, setHoverIcon, setIcon, setPressedIcon, setShowTextOnButtons, setText, setTooltip
 
Methods inherited from class bibliothek.gui.dock.common.action.CAction
init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CExtendedModeAction

protected CExtendedModeAction(CControl control,
                              ExtendedMode mode,
                              String iconKey,
                              String textKey,
                              String tooltipKey,
                              PropertyKey<KeyStroke> gotoStroke)
Creates a new action.

Parameters:
control - the control for which this action will be used
mode - the mode into which this action leads
iconKey - the key of the icon when searching in the IconManager
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 to the KeyStroke that triggers this action

CExtendedModeAction

protected CExtendedModeAction()
Creates an empty, non initialized action. Subclasses must call init(CControl, ExtendedMode, String, String, String, PropertyKey) to complete initialization.

Method Detail

init

protected void init(CControl control,
                    ExtendedMode mode,
                    String iconKey,
                    String textKey,
                    String tooltipKey,
                    PropertyKey<KeyStroke> gotoStroke)
Creates a new action, this method must be called only once.

Parameters:
control - the control for which this action will be used
mode - the mode into which this action leads
iconKey - the key of the icon when searching in the IconManager
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 to the KeyStroke that triggers this 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

action

public void action(CDockable dockable)
This method actually changes the ExtendedMode of dockable to the mode that was given to this action in the constructor. Every triggering of this action will finally call this method, so this method is the optimal point to be overridden and modified.

Parameters:
dockable - the element for which the action is executed

createAction

protected CExtendedModeAction.Action createAction()
Creates an instance of the action representing this CExtendedModeAction.

Returns:
the action