bibliothek.gui.dock.station.flap
Class FlapDockHoldToggle

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,SimpleSelectableAction>
              extended by bibliothek.gui.dock.action.actions.GroupedSelectableDockAction<K>
                  extended by bibliothek.gui.dock.action.actions.GroupedSelectableDockAction.Check<Boolean>
                      extended by bibliothek.gui.dock.station.flap.FlapDockHoldToggle
All Implemented Interfaces:
DockAction, DropDownItemAction, ListeningDockAction, SelectableDockAction, StandardDockAction, StandardDropDownItemAction

public class FlapDockHoldToggle
extends GroupedSelectableDockAction.Check<Boolean>
implements ListeningDockAction

This DockAction is shown together with the children of a FlapDockStation, and allows to "stick" a Dockable. When a Dockable is sticked, it will not be disposed by the FlapDockStation, when it looses the focus. In fact, this action just uses the setHold-method of the station.

Author:
Benjamin Sigg

Nested Class Summary
 
Nested classes/interfaces inherited from class bibliothek.gui.dock.action.actions.GroupedSelectableDockAction
GroupedSelectableDockAction.Check<K>, GroupedSelectableDockAction.Radio<K>
 
Constructor Summary
FlapDockHoldToggle(FlapDockStation station)
          Constructor, sets the icons and makes the action ready to be shown.
 
Method Summary
protected  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 setSelected(Dockable dockable, boolean selected)
          Sets the selected state for dockable.
 boolean trigger(Dockable dockable)
          Does the appropriate action that can be done respecting the current state of this action.
 
Methods inherited from class bibliothek.gui.dock.action.actions.GroupedSelectableDockAction.Check
createGroup
 
Methods inherited from class bibliothek.gui.dock.action.actions.GroupedSelectableDockAction
addSelectableListener, createGroup, createView, fireSelectedChanged, fireSelectedChanged, getDisabledSelectedIcon, getSelectedIcon, isSelected, isSelected, removeSelectableListener, setDisabledSelectedIcon, setGroup, setSelected, setSelectedIcon
 
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
bound, ensureGroup, getAccelerator, getDisabledIcon, getDisabledIcon, getGenerator, getGroup, getGroup, getIcon, getIcon, getText, getText, getTooltip, getTooltipText, getTooltipText, groupExists, isEnabled, isEnabled, isKnown, isRemoveEmptyGroups, removeGroup, setAccelerator, setDisabledIcon, setEnabled, setGenerator, setIcon, setRemoveEmptyGroups, setText, setTooltip, unbound
 
Methods inherited from class bibliothek.gui.dock.action.actions.AbstractStandardDockAction
addDockActionListener, bind, fireActionDisabledIconChanged, fireActionEnabledChanged, fireActionIconChanged, 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, unbind
 
Methods inherited from interface bibliothek.gui.dock.action.dropdown.DropDownItemAction
isDropDownSelectable, isDropDownTriggerable
 

Constructor Detail

FlapDockHoldToggle

public FlapDockHoldToggle(FlapDockStation station)
Constructor, sets the icons and makes the action ready to be shown.

Parameters:
station - The station on which the Dockables are registered.
Method Detail

trigger

public boolean trigger(Dockable dockable)
Description copied from interface: DockAction
Does the appropriate action that can be done respecting the current state of this action.

Specified by:
trigger in interface DockAction
Overrides:
trigger in class GroupedDockAction<Boolean,SimpleSelectableAction>
Parameters:
dockable - the element for which this action is called
Returns:
true if this action could do anything, false if this action was not able to react in any way to the event.

setSelected

public void setSelected(Dockable dockable,
                        boolean selected)
Description copied from interface: SelectableDockAction
Sets the selected state for dockable.

Specified by:
setSelected in interface SelectableDockAction
Overrides:
setSelected in class GroupedSelectableDockAction<Boolean>
Parameters:
dockable - the affected dockable
selected - the new state

createGroupKey

protected 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<Boolean,SimpleSelectableAction>
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.

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