bibliothek.gui.dock.facile.action
Class ReplaceAction

java.lang.Object
  extended by bibliothek.gui.dock.action.actions.AbstractStandardDockAction
      extended by bibliothek.gui.dock.action.actions.GroupedDockAction<K,D>
          extended by bibliothek.gui.dock.action.actions.GroupedDropDownItemAction<K,SimpleButtonAction>
              extended by bibliothek.gui.dock.action.actions.GroupedButtonDockAction<java.lang.Boolean>
                  extended by bibliothek.gui.dock.facile.action.ReplaceAction
All Implemented Interfaces:
ButtonDockAction, DockAction, DropDownItemAction, ListeningDockAction, StandardDockAction, StandardDropDownItemAction

@ClientOnly
public class ReplaceAction
extends GroupedButtonDockAction<java.lang.Boolean>
implements ListeningDockAction

A DockAction that can replace a DockStation by it's only child. This action is only enabled, if the associated DockStation has exactly one or zero children. This action can handle only the one station that was provided through the constructor.

Author:
Benjamin Sigg

Field Summary
static java.lang.String KEY_ICON
          the key uses for the IconManager to get the Icon of this action
 
Fields inherited from class bibliothek.gui.dock.action.actions.AbstractStandardDockAction
listeners
 
Constructor Summary
ReplaceAction(DockController controller)
          Sets up this action.
 
Method Summary
 void action(Dockable dockable)
          Invoked when this action is triggered by the user.
 void bound(Dockable dockable)
          Invoked by this AbstractStandardDockAction when a Dockable was bound to this action the first time.
protected  java.lang.Boolean createGroupKey(Dockable dockable)
          Calculates the name of the group to which the dockable should be added.
 void setController(DockController controller)
          Called when a new controller has been set.
 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.GroupedButtonDockAction
createGroup, createView
 
Methods inherited from class bibliothek.gui.dock.action.actions.GroupedDropDownItemAction
isDropDownSelectable, isDropDownSelectable, isDropDownTriggerable, isDropDownTriggerable, setDropDownSelectable, setDropDownTriggerableNotSelected, setDropDownTriggerableSelected
 
Methods inherited from class bibliothek.gui.dock.action.actions.GroupedDockAction
ensureGroup, getAccelerator, getDisabledIcon, getDisabledIcon, getDockableRepresentation, getDockableRepresentation, getGenerator, getGroup, getGroup, getIcon, getIcon, getText, getText, getTooltip, getTooltipText, getTooltipText, groupExists, isEnabled, isEnabled, isKnown, isRemoveEmptyGroups, removeGroup, setAccelerator, setDisabledIcon, setDockableRepresentation, setEnabled, setGenerator, setGroup, setIcon, setRemoveEmptyGroups, setText, setTooltip, trigger
 
Methods inherited from class bibliothek.gui.dock.action.actions.AbstractStandardDockAction
addDockActionListener, bind, fireActionDisabledIconChanged, 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.DockAction
bind, createView, trigger, unbind
 
Methods inherited from interface bibliothek.gui.dock.action.dropdown.DropDownItemAction
isDropDownSelectable, isDropDownTriggerable
 

Field Detail

KEY_ICON

public static final java.lang.String KEY_ICON
the key uses for the IconManager to get the Icon of this action

See Also:
Constant Field Values
Constructor Detail

ReplaceAction

public ReplaceAction(DockController controller)
Sets up this action.

Parameters:
controller - The controller for which this action is used. This action will add some listeners to the controller. To remove those listeners, call setController(DockController) with a null argument.
Method Detail

createGroupKey

protected java.lang.Boolean createGroupKey(Dockable dockable)
Description copied from class: GroupedDockAction
Calculates the name of the group to which the dockable should be added.
Every Dockable is member of one group. The membership determines text, icon, etc. for the dockable. Whenever a dockable is bound to this action, the group will be determined by this method. Later on, the group can be changed by the method setGroup.
The default implementation uses the generator of this action.

Overrides:
createGroupKey in class GroupedDockAction<java.lang.Boolean,SimpleButtonAction>
Parameters:
dockable - The Dockable whose group has to be found
Returns:
the name of the dockable's group. That can be an existing or a non existing group. null is not a valid result.

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
Parameters:
dockable - The Dockable which is associated with this DockAction, and which shall be used for the current action.

bound

public 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 GroupedDockAction<java.lang.Boolean,SimpleButtonAction>
Parameters:
dockable - The Dockable that was not known to this action before the method was invoked

unbound

public 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 GroupedDockAction<java.lang.Boolean,SimpleButtonAction>
Parameters:
dockable - The Dockable which will not by used in any way.

setController

public void setController(DockController controller)
Description copied from interface: ListeningDockAction
Called when a new controller has been set.

Specified by:
setController in interface ListeningDockAction
Parameters:
controller - the new controller