Class KeyedActionSource
java.lang.Object
bibliothek.gui.dock.action.AbstractDockActionSource
bibliothek.gui.dock.facile.action.KeyedActionSource
- All Implemented Interfaces:
DockActionSource,Iterable<DockAction>
An action source using
CDockable.getAction(String) to determine which
action to use. If getAction returns null, then
a default action can be used. This action source also allows to disable any
action.- Author:
- Benjamin Sigg
-
Field Summary
Fields inherited from class bibliothek.gui.dock.action.AbstractDockActionSource
listeners -
Constructor Summary
ConstructorsConstructorDescriptionKeyedActionSource(CDockable dockable, String key) Creates a new action source -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddestroy()Detaches the listeners thisDockActionSourceadded to other objects.Gets the default action of this source.getDockAction(int index) intgetKey()Gets the key which is used for callingCDockable.getAction(String)iterator()voidvoidsetDefaultAction(DockAction defaultAction) Sets the default action of this source.voidsetVisible(boolean visible) Changes whether any actions are shown or not.Methods inherited from class bibliothek.gui.dock.action.AbstractDockActionSource
fireAdded, fireRemoved, hasListeners, indexOfMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
KeyedActionSource
Creates a new action source- Parameters:
dockable- the element for which this source is usedkey- the key for callingCDockable.getAction(String)
-
-
Method Details
-
getKey
Gets the key which is used for callingCDockable.getAction(String)- Returns:
- the key, not
null
-
addDockActionSourceListener
- Specified by:
addDockActionSourceListenerin interfaceDockActionSource- Overrides:
addDockActionSourceListenerin classAbstractDockActionSource
-
removeDockActionSourceListener
- Specified by:
removeDockActionSourceListenerin interfaceDockActionSource- Overrides:
removeDockActionSourceListenerin classAbstractDockActionSource
-
destroy
public void destroy()Detaches the listeners thisDockActionSourceadded to other objects. -
setVisible
public void setVisible(boolean visible) Changes whether any actions are shown or not.- Parameters:
visible- the new state
-
setDefaultAction
Sets the default action of this source. The default action is used ifCDockable.getAction(String)returnsnull.- Parameters:
defaultAction- the default action, may benull
-
getDefaultAction
Gets the default action of this source.- Returns:
- the default action, can be
null
-
getDockAction
-
getDockActionCount
public int getDockActionCount() -
getLocationHint
-
iterator
-