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 tool.Returns all global actions known to the toolgetLocalAction(ComponentProvider provider, String actionName) Gets the provider action by the given namegetLocalActions(ComponentProvider provider) Gets all the local actions registered for the given ComponentProvider.voidvoidvoidAllows 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.validateActionKeyBinding(DockingActionIf action, KeyStroke ks) Checks whether the given key stroke can be used for the given action for restrictions such as those for System level actions.
-
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
-
getLocalActions
Description copied from interface:DockingToolActionsGets all the local actions registered for the given ComponentProvider.- Specified by:
getLocalActionsin interfaceDockingToolActions- Parameters:
provider- the ComponentProvider for which to get its local actions- Returns:
- all the local actions registered for the given ComponentProvider
-
getActions
Description copied from interface:DockingToolActionsReturns all actions with the given owner- Specified by:
getActionsin interfaceDockingToolActions- Parameters:
owner- the owner- Returns:
- the actions
-
getGlobalActions
Description copied from interface:DockingToolActionsReturns all global actions known to the tool- Specified by:
getGlobalActionsin interfaceDockingToolActions- Returns:
- the global actions known to the tool
-
getAllActions
Description copied from interface:DockingToolActionsReturns all actions known to the tool.- Specified by:
getAllActionsin interfaceDockingToolActions- Returns:
- the actions
-
optionsRebuilt
public void optionsRebuilt() -
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
-
validateActionKeyBinding
Checks whether the given key stroke can be used for the given action for restrictions such as those for System level actions.- Parameters:
action- the action; may be nullks- the key stroke- Returns:
- A null value if valid; a non-null error message if invalid
-
getAction
-
getAction
-