Package docking.actions
Class DockingToolActionManager
- java.lang.Object
-
- docking.actions.DockingToolActionManager
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener,java.util.EventListener
public class DockingToolActionManager extends java.lang.Object implements java.beans.PropertyChangeListenerAn class to manage actions registered with the tool
-
-
Constructor Summary
Constructors Constructor Description DockingToolActionManager(DockingTool tool, DockingWindowManager windowManager)Construct an ActionManager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLocalAction(ComponentProvider provider, DockingActionIf action)Add an action that works specifically with a component provider.voidaddToolAction(DockingActionIf action)Adds the action to the tool.voiddispose()java.util.List<DockingActionIf>getActions(java.lang.String owner)Get all actions for the given owner.java.util.List<DockingActionIf>getAllActions()Get a list of all actions in the tool.java.util.List<DockingActionIf>getDockingActionsByFullActionName(java.lang.String fullActionName)Get all actions that have the action name which includes the action owner's name.voidpropertyChange(java.beans.PropertyChangeEvent evt)voidremoveComponent(ComponentProvider provider)Get the actions for the given provider and remove them from the actionMap; call the window manager to remove the provider.voidremoveProviderAction(ComponentProvider provider, DockingActionIf action)Remove an action that works specifically with a component provider.voidremoveToolAction(DockingActionIf action)Removes the given action from the toolvoidremoveToolActions(java.lang.String owner)Remove all actions that have the given owner.voidrestoreKeyBindings()Get the keybindings for each action so that they are still registered as being used; otherwise the options will be removed because they are noted as not being used.
-
-
-
Constructor Detail
-
DockingToolActionManager
public DockingToolActionManager(DockingTool tool, DockingWindowManager windowManager)
Construct an ActionManager.- Parameters:
tool- tool using this ActionManagerwindowManager- manager of the "Docking" arrangement of a set of components and actions in the tool
-
-
Method Detail
-
dispose
public void dispose()
-
addToolAction
public void addToolAction(DockingActionIf action)
Adds the action to the tool.- Parameters:
action- the action to be added.
-
removeToolAction
public void removeToolAction(DockingActionIf action)
Removes the given action from the tool- Parameters:
action- the action to be removed.
-
removeToolActions
public void removeToolActions(java.lang.String owner)
Remove all actions that have the given owner.- Parameters:
owner- owner of the actions to remove
-
addLocalAction
public void addLocalAction(ComponentProvider provider, DockingActionIf action)
Add an action that works specifically with a component provider.- Parameters:
provider- provider associated with the actionaction- local action to the provider
-
removeProviderAction
public void removeProviderAction(ComponentProvider provider, DockingActionIf action)
Remove an action that works specifically with a component provider.- Parameters:
provider- provider associated with the actionaction- local action to the provider
-
getDockingActionsByFullActionName
public java.util.List<DockingActionIf> getDockingActionsByFullActionName(java.lang.String fullActionName)
Get all actions that have the action name which includes the action owner's name.- Parameters:
fullName- full name for the action, e.g., "My Action (My Plugin)"- Returns:
- list of actions; empty if no action exists with the given name
-
getActions
public java.util.List<DockingActionIf> getActions(java.lang.String owner)
Get all actions for the given owner.- Parameters:
owner- owner of the actions- Returns:
- array of actions; zero length array is returned if no action exists with the given name
-
getAllActions
public java.util.List<DockingActionIf> getAllActions()
Get a list of all actions in the tool.- Returns:
- list of PluginAction objects
-
restoreKeyBindings
public void restoreKeyBindings()
Get the keybindings for each action so that they are still registered as being used; otherwise the options will be removed because they are noted as not being used.
-
removeComponent
public void removeComponent(ComponentProvider provider)
Get the actions for the given provider and remove them from the actionMap; call the window manager to remove the provider.- Parameters:
provider- provider to be removed
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener
-
-