Package docking.actions
Class ToolActions
java.lang.Object
docking.actions.ToolActions
- All Implemented Interfaces:
DockingToolActions,PropertyChangeListener,EventListener
An class to manage actions registered with the tool
-
Constructor Summary
ConstructorsConstructorDescriptionToolActions(Tool tool, ActionToGuiHelper actionToGuiHelper) Construct an ActionManager -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGlobalAction(DockingActionIf action) Adds the given action that is enabled, regardless of the active providervoidaddLocalAction(ComponentProvider provider, DockingActionIf action) Add an action that works specifically with a component provider.voiddispose()getActions(String owner) Returns all actions with the given ownerReturns all actions known to the toolgetLocalAction(ComponentProvider provider, String actionName) Gets the provider action by the given namevoidvoidAllows clients to register an action by using a placeholder.voidremoveActions(ComponentProvider provider) Removes all local actions for the given providervoidremoveActions(String owner) Removes all global actions for the given ownervoidremoveGlobalAction(DockingActionIf action) Removes the given global actionvoidremoveLocalAction(ComponentProvider provider, DockingActionIf action) Remove an action that works specifically with a component provider.voidGet 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 Details
-
ToolActions
Construct an ActionManager- Parameters:
tool- tool using this ActionManageractionToGuiHelper- the class that takes actions and maps them to GUI widgets
-
-
Method Details
-
dispose
public void dispose() -
addLocalAction
Add an action that works specifically with a component provider.- Specified by:
addLocalActionin interfaceDockingToolActions- Parameters:
provider- provider associated with the actionaction- local action to the provider
-
addGlobalAction
Description copied from interface:DockingToolActionsAdds the given action that is enabled, regardless of the active provider- Specified by:
addGlobalActionin interfaceDockingToolActions- Parameters:
action- the action
-
removeGlobalAction
Description copied from interface:DockingToolActionsRemoves the given global action- Specified by:
removeGlobalActionin interfaceDockingToolActions- Parameters:
action- the action
-
removeActions
Description copied from interface:DockingToolActionsRemoves all global actions for the given owner- Specified by:
removeActionsin interfaceDockingToolActions- Parameters:
owner- the owner
-
getActions
Description copied from interface:DockingToolActionsReturns all actions with the given owner- Specified by:
getActionsin interfaceDockingToolActions- Parameters:
owner- the owner- Returns:
- the actions
-
getAllActions
Description copied from interface:DockingToolActionsReturns all actions known to the tool- Specified by:
getAllActionsin interfaceDockingToolActions- Returns:
- the actions
-
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. -
removeLocalAction
Remove an action that works specifically with a component provider.- Specified by:
removeLocalActionin interfaceDockingToolActions- Parameters:
provider- provider associated with the actionaction- local action to the provider
-
removeActions
Description copied from interface:DockingToolActionsRemoves all local actions for the given provider- Specified by:
removeActionsin interfaceDockingToolActions- Parameters:
provider- the provider
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
getLocalAction
Description copied from interface:DockingToolActionsGets the provider action by the given name- Specified by:
getLocalActionin interfaceDockingToolActions- Parameters:
provider- the provideractionName- the action name- Returns:
- the action
-
getAction
-