Package ghidra.framework.plugintool.mgr
Class ProjectActionManager
- java.lang.Object
-
- ghidra.framework.plugintool.mgr.ProjectActionManager
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.util.EventListener
public class ProjectActionManager extends java.lang.Object implements java.beans.PropertyChangeListener
Helper class to manage plugin actions for the tool.
-
-
Constructor Summary
Constructors Constructor Description ProjectActionManager(PluginTool tool, DockingWindowManager winMgr)
Construct an ActionManager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLocalAction(ComponentProvider provider, DockingActionIf action)
Add an action that works specifically with a component provider.void
addToolAction(DockingActionIf action)
Adds the action to the tool.void
dispose()
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.void
propertyChange(java.beans.PropertyChangeEvent evt)
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.void
removeProviderAction(ComponentProvider provider, DockingActionIf action)
Remove an action that works specifically with a component provider.void
removeToolAction(DockingActionIf action)
Removes the given action from the toolvoid
removeToolActions(java.lang.String owner)
Remove all actions that have the given owner.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.
-
-
-
Constructor Detail
-
ProjectActionManager
public ProjectActionManager(PluginTool tool, DockingWindowManager winMgr)
Construct an ActionManager.- Parameters:
tool
- plugin tool using this ActionManagerwinMgr
- 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:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
-