bibliothek.gui.dock.action.actions
Class GroupedDropDownItemAction<K,D extends SimpleDropDownItemAction>

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,D>
Type Parameters:
K - the type of the keys used for groups
D - the type of model used as group
All Implemented Interfaces:
DockAction, DropDownItemAction, StandardDockAction, StandardDropDownItemAction
Direct Known Subclasses:
GroupedButtonDockAction, GroupedSelectableDockAction

public abstract class GroupedDropDownItemAction<K,D extends SimpleDropDownItemAction>
extends GroupedDockAction<K,D>
implements StandardDropDownItemAction

An action that can be shown as child of a DropDownAction.

Author:
Benjamin Sigg

Field Summary
 
Fields inherited from class bibliothek.gui.dock.action.actions.AbstractStandardDockAction
listeners
 
Constructor Summary
GroupedDropDownItemAction(GroupKeyGenerator<? extends K> generator)
          Creates a new action.
 
Method Summary
 boolean isDropDownSelectable(Dockable dockable)
          Tells whether this action can be selected by a DropDownAction, if it is shown for dockable.
 boolean isDropDownSelectable(java.lang.Object key)
          Tells whether the group key can be selected by a DropDownAction.
 boolean isDropDownTriggerable(Dockable dockable, boolean selected)
          Tells whether this action can be triggered if it is shown as child of a DropDownAction.
 boolean isDropDownTriggerable(java.lang.Object key, boolean selected)
          Tells whether the group key can be triggered by a DropDownAction.
 void setDropDownSelectable(K key, boolean selectable)
          Sets whether the group key can be selected by a DropDownAction.
 void setDropDownTriggerableNotSelected(K key, boolean triggerable)
          Sets whether the group key can be triggered if the event occurs in a menu.
 void setDropDownTriggerableSelected(K key, boolean triggerable)
          Sets whether the group key can be triggered if the event occurs on a drop-down-button.
 
Methods inherited from class bibliothek.gui.dock.action.actions.GroupedDockAction
bound, createGroup, createGroupKey, 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, unbound
 
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.StandardDockAction
addDockActionListener, getDisabledIcon, getDockableRepresentation, getIcon, getText, getTooltipText, isEnabled, removeDockActionListener
 
Methods inherited from interface bibliothek.gui.dock.action.DockAction
bind, createView, trigger, unbind
 

Constructor Detail

GroupedDropDownItemAction

public GroupedDropDownItemAction(GroupKeyGenerator<? extends K> generator)
Creates a new action.

Parameters:
generator - the generator that will be used to get a key for Dockables which do not yet have a key. The generator can be null and set later through the method GroupedDockAction.setGenerator(GroupKeyGenerator)
Method Detail

isDropDownSelectable

public boolean isDropDownSelectable(Dockable dockable)
Description copied from interface: DropDownItemAction
Tells whether this action can be selected by a DropDownAction, if it is shown for dockable.

Specified by:
isDropDownSelectable in interface DropDownItemAction
Parameters:
dockable - the Dockable for which the action is shown
Returns:
true if the action can be selected

isDropDownSelectable

public boolean isDropDownSelectable(java.lang.Object key)
Tells whether the group key can be selected by a DropDownAction.

Parameters:
key - the name of the group
Returns:
true if the group can be selected

setDropDownSelectable

public void setDropDownSelectable(K key,
                                  boolean selectable)
Sets whether the group key can be selected by a DropDownAction.

Parameters:
key - the name of the group
selectable - true if the group can be selected

isDropDownTriggerable

public boolean isDropDownTriggerable(Dockable dockable,
                                     boolean selected)
Description copied from interface: DropDownItemAction
Tells whether this action can be triggered if it is shown as child of a DropDownAction.

Specified by:
isDropDownTriggerable in interface DropDownItemAction
Parameters:
dockable - the Dockable for which the action is shown
selected - true if the action is selected (the action is triggered because the user clicks onto the DropDownAction), or false if this action is just in a menu.
Returns:
true if the action can be triggered

isDropDownTriggerable

public boolean isDropDownTriggerable(java.lang.Object key,
                                     boolean selected)
Tells whether the group key can be triggered by a DropDownAction.

Parameters:
key - the name of the group
selected - true if the event will be on a drop-down-button itself, false if the event is in the menu.
Returns:
true if the group can be triggered

setDropDownTriggerableSelected

public void setDropDownTriggerableSelected(K key,
                                           boolean triggerable)
Sets whether the group key can be triggered if the event occurs on a drop-down-button.

Parameters:
key - the name of the group
triggerable - true if the group can be triggered

setDropDownTriggerableNotSelected

public void setDropDownTriggerableNotSelected(K key,
                                              boolean triggerable)
Sets whether the group key can be triggered if the event occurs in a menu.

Parameters:
key - the name of the group
triggerable - true if the group can be triggered