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
ConstructorDescriptionToolActions
(Tool tool, ActionToGuiHelper actionToGuiHelper) Construct an ActionManager -
Method Summary
Modifier and TypeMethodDescriptionvoid
addGlobalAction
(DockingActionIf action) Adds the given action that is enabled, regardless of the active providervoid
addLocalAction
(ComponentProvider provider, DockingActionIf action) Add an action that works specifically with a component provider.void
dispose()
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.void
void
void
Allows clients to register an action by using a placeholder.void
removeActions
(ComponentProvider provider) Removes all local actions for the given providervoid
removeActions
(String owner) Removes all global actions for the given ownervoid
removeGlobalAction
(DockingActionIf action) Removes the given global actionvoid
removeLocalAction
(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:
addLocalAction
in interfaceDockingToolActions
- Parameters:
provider
- provider associated with the actionaction
- local action to the provider
-
addGlobalAction
Description copied from interface:DockingToolActions
Adds the given action that is enabled, regardless of the active provider- Specified by:
addGlobalAction
in interfaceDockingToolActions
- Parameters:
action
- the action
-
removeGlobalAction
Description copied from interface:DockingToolActions
Removes the given global action- Specified by:
removeGlobalAction
in interfaceDockingToolActions
- Parameters:
action
- the action
-
removeActions
Description copied from interface:DockingToolActions
Removes all global actions for the given owner- Specified by:
removeActions
in interfaceDockingToolActions
- Parameters:
owner
- the owner
-
getLocalActions
Description copied from interface:DockingToolActions
Gets all the local actions registered for the given ComponentProvider.- Specified by:
getLocalActions
in 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:DockingToolActions
Returns all actions with the given owner- Specified by:
getActions
in interfaceDockingToolActions
- Parameters:
owner
- the owner- Returns:
- the actions
-
getGlobalActions
Description copied from interface:DockingToolActions
Returns all global actions known to the tool- Specified by:
getGlobalActions
in interfaceDockingToolActions
- Returns:
- the global actions known to the tool
-
getAllActions
Description copied from interface:DockingToolActions
Returns all actions known to the tool.- Specified by:
getAllActions
in interfaceDockingToolActions
- Returns:
- the actions
-
optionsRebuilt
public void optionsRebuilt() -
removeLocalAction
Remove an action that works specifically with a component provider.- Specified by:
removeLocalAction
in interfaceDockingToolActions
- Parameters:
provider
- provider associated with the actionaction
- local action to the provider
-
removeActions
Description copied from interface:DockingToolActions
Removes all local actions for the given provider- Specified by:
removeActions
in interfaceDockingToolActions
- Parameters:
provider
- the provider
-
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
-
getLocalAction
Description copied from interface:DockingToolActions
Gets the provider action by the given name- Specified by:
getLocalAction
in 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
-