bibliothek.gui.dock.facile.action
Class ReplaceAction
java.lang.Object
bibliothek.gui.dock.action.actions.AbstractStandardDockAction
bibliothek.gui.dock.action.actions.GroupedDockAction<K,D>
bibliothek.gui.dock.action.actions.GroupedDropDownItemAction<K,SimpleButtonAction>
bibliothek.gui.dock.action.actions.GroupedButtonDockAction<java.lang.Boolean>
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 |
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 |
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
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.
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