Class AbstractDockingTool
- All Implemented Interfaces:
Tool
,ServiceProvider
- Direct Known Subclasses:
PluginTool
Tool
that serves as a place to share common functionality-
Field Summary
Modifier and TypeFieldDescriptionprotected Map
<String, ToolOptions> protected ToolActions
protected DockingWindowManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAction
(DockingActionIf action) Adds the action to the tool.void
addComponentProvider
(ComponentProvider provider, boolean show) Adds the ComponentProvider to the tool, optionally making it visible.void
addContextListener
(DockingContextListener listener) Adds the given context listener to this toolvoid
addLocalAction
(ComponentProvider provider, DockingActionIf action) Adds the action to the given provider as a local action.void
addPopupActionProvider
(PopupActionProvider provider) Adds the given popup action provider to this tool.void
Clear the status informationvoid
contextChanged
(ComponentProvider provider) Signals to the tool that the provider's context has changed.Returns the active component provider, that which has focusReturn a set of all actions in the tool.getComponentProvider
(String name) Gets the ComponentProvider with the given name.Returns all actions for the given ownerReturn a set of all global actions in the tool.getLocalActions
(ComponentProvider provider) Return a set of all local actions for the givenComponentProvider
.getProviderWindow
(ComponentProvider provider) Returns the parent window for the given providerGet the status informationReturns the class that manages actions for the tool.Returns the DockingWindowManger for this tool.boolean
Return true if the tool's configuration has changedboolean
isActive
(ComponentProvider provider) Returns true if the ComponentProvider is the currently active provider.boolean
Returns true if tool is visibleboolean
isVisible
(ComponentProvider provider) Returns true if the given ComponentProvider is currently visible.void
removeAction
(DockingActionIf action) Removes the given action from the tool.void
removeComponentProvider
(ComponentProvider provider) Removes the given ComponentProvider from the tool.void
removeContextListener
(DockingContextListener listener) Removes the given context listener to this toolvoid
removeLocalAction
(ComponentProvider provider, DockingActionIf action) Removes the action from the providervoid
removePopupActionProvider
(PopupActionProvider provider) Removes the given popup action providervoid
setConfigChanged
(boolean changed) Toggles the "change" state of the tool...void
setMenuGroup
(String[] menuPath, String group) Set the menu group associated with a cascaded submenu.void
setMenuGroup
(String[] menuPath, String group, String menuSubGroup) Set the menu group associated with a cascaded submenu.void
setStatusInfo
(String text) Set the status informationvoid
setStatusInfo
(String text, boolean beep) Set the status informationvoid
setVisible
(boolean visibility) Sets the tool visible or invisible.void
showComponentProvider
(ComponentProvider provider, boolean visible) Shows or hides the component provider in the toolvoid
showDialog
(DialogComponentProvider dialogComponent) Shows the dialog using the tool's root frame as a parent.void
toFront()
Brings this tool to the front.void
toFront
(ComponentProvider provider) Makes the given ComponentProvider move to the front if it is tabbed with other components.void
updateTitle
(ComponentProvider provider) Indicates to the tool that the given componentProvider's title has changed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ghidra.framework.plugintool.ServiceProvider
addServiceListener, getService, removeServiceListener
Methods inherited from interface docking.Tool
close, getIcon, getName, getOptions
-
Field Details
-
winMgr
-
toolActions
-
optionsMap
-
-
Constructor Details
-
AbstractDockingTool
public AbstractDockingTool()
-
-
Method Details
-
isVisible
public boolean isVisible()Description copied from interface:Tool
Returns true if tool is visible -
setVisible
public void setVisible(boolean visibility) Description copied from interface:Tool
Sets the tool visible or invisible. This method is used by the Project to make it's tools visible or invisible depending on whether this tool is in is the active workspace.- Specified by:
setVisible
in interfaceTool
- Parameters:
visibility
- true specifies that the tool should be visible
-
toFront
public void toFront()Description copied from interface:Tool
Brings this tool to the front. Places this tool at the top of the stacking order and shows it in front of any other tools. -
addComponentProvider
Description copied from interface:Tool
Adds the ComponentProvider to the tool, optionally making it visible.- Specified by:
addComponentProvider
in interfaceTool
- Parameters:
provider
- the provider to add to the toolshow
- if true, the component is made visible.
-
removeComponentProvider
Description copied from interface:Tool
Removes the given ComponentProvider from the tool. When a provider has been removed from the tool it is considered disposed and should not be reused.- Specified by:
removeComponentProvider
in interfaceTool
- Parameters:
provider
- the provider to remove from the tool
-
getComponentProvider
Description copied from interface:Tool
Gets the ComponentProvider with the given name.- Specified by:
getComponentProvider
in interfaceTool
- Parameters:
name
- the name of the provider to get- Returns:
- the provider
-
setStatusInfo
Description copied from interface:Tool
Set the status information- Specified by:
setStatusInfo
in interfaceTool
- Parameters:
text
- non-html string to be displayed in the Status display area
-
setStatusInfo
Description copied from interface:Tool
Set the status information- Specified by:
setStatusInfo
in interfaceTool
- Parameters:
text
- string to be displayed in the Status display areabeep
- whether to be or not
-
getStatusInfo
Description copied from interface:Tool
Get the status information- Specified by:
getStatusInfo
in interfaceTool
- Returns:
- the string displayed in the Status area
-
clearStatusInfo
public void clearStatusInfo()Description copied from interface:Tool
Clear the status information- Specified by:
clearStatusInfo
in interfaceTool
-
addAction
Description copied from interface:Tool
Adds the action to the tool. -
removeAction
Description copied from interface:Tool
Removes the given action from the tool. When an action is removed from the tool it will be disposed and should not be reused.- Specified by:
removeAction
in interfaceTool
- Parameters:
action
- the action to be removed.
-
addLocalAction
Description copied from interface:Tool
Adds the action to the given provider as a local action.- Specified by:
addLocalAction
in interfaceTool
- Parameters:
provider
- the provider to add the action to.action
- the DockingAction to add to the componentProvider.
-
getLocalActions
Description copied from interface:Tool
Return a set of all local actions for the givenComponentProvider
.- Specified by:
getLocalActions
in interfaceTool
- Parameters:
provider
- the component provider from which to get local actions- Returns:
- set of all local actions for the given provider
-
removeLocalAction
Description copied from interface:Tool
Removes the action from the provider- Specified by:
removeLocalAction
in interfaceTool
- Parameters:
provider
- the component provider from which to remove the action.action
- the action to remove.
-
getAllActions
Description copied from interface:Tool
Return a set of all actions in the tool.Note: the result may contain conceptually duplicate actions, which is when multiple actions exist that share the same full name (the full name is the action name with the owner name, such as "My Action (MyPlugin)".
- Specified by:
getAllActions
in interfaceTool
- Returns:
- set of all actions
-
getGlobalActions
Description copied from interface:Tool
Return a set of all global actions in the tool.Note: the result may contain conceptually duplicate actions, which is when multiple actions exist that share the same full name (the full name is the action name with the owner name, such as "My Action (MyPlugin)".
- Specified by:
getGlobalActions
in interfaceTool
- Returns:
- set of all global actions
-
addPopupActionProvider
Description copied from interface:Tool
Adds the given popup action provider to this tool. This provider will be called each time the popup menu is about to be shown.- Specified by:
addPopupActionProvider
in interfaceTool
- Parameters:
provider
- the provider
-
removePopupActionProvider
Description copied from interface:Tool
Removes the given popup action provider- Specified by:
removePopupActionProvider
in interfaceTool
- Parameters:
provider
- the provider
-
getDockingActionsByOwnerName
Description copied from interface:Tool
Returns all actions for the given ownerNote: the result may contain conceptually duplicate actions, which is when multiple actions exist that share the same full name (the full name is the action name with the owner name, such as "My Action (MyPlugin)".
- Specified by:
getDockingActionsByOwnerName
in interfaceTool
- Parameters:
owner
- the action owner's name- Returns:
- the actions
-
getActiveComponentProvider
Description copied from interface:Tool
Returns the active component provider, that which has focus- Specified by:
getActiveComponentProvider
in interfaceTool
- Returns:
- the active provider
-
showComponentProvider
Description copied from interface:Tool
Shows or hides the component provider in the tool- Specified by:
showComponentProvider
in interfaceTool
- Parameters:
provider
- the provider to either show or hide.visible
- true to show the provider, false to hide it.
-
showDialog
Description copied from interface:Tool
Shows the dialog using the tool's root frame as a parent. Also, remembers any size and location adjustments made by the user for the next time the dialog is shown.- Specified by:
showDialog
in interfaceTool
- Parameters:
dialogComponent
- the DialogComponentProvider object to be shown in a dialog.
-
getToolFrame
-
getProviderWindow
Description copied from interface:Tool
Returns the parent window for the given provider- Specified by:
getProviderWindow
in interfaceTool
- Parameters:
provider
- the provider- Returns:
- the window
-
toFront
Description copied from interface:Tool
Makes the given ComponentProvider move to the front if it is tabbed with other components. -
isVisible
Description copied from interface:Tool
Returns true if the given ComponentProvider is currently visible. -
isActive
Description copied from interface:Tool
Returns true if the ComponentProvider is the currently active provider. The active provider is the provider that has keyboard focus and provides the current action context. -
updateTitle
Description copied from interface:Tool
Indicates to the tool that the given componentProvider's title has changed.- Specified by:
updateTitle
in interfaceTool
- Parameters:
provider
- the componentProvider whose title has changed.
-
setMenuGroup
Set the menu group associated with a cascaded submenu. This allows a cascading menu item to be grouped with a specific set of actions. The default group for a cascaded submenu is the name of the submenu.- Parameters:
menuPath
- menu name path where the last element corresponds to the specified group name.group
- group name- See Also:
-
setMenuGroup
Description copied from interface:Tool
Set the menu group associated with a cascaded submenu. This allows a cascading menu item to be grouped with a specific set of actions.The default group for a cascaded submenu is the name of the submenu.
- Specified by:
setMenuGroup
in interfaceTool
- Parameters:
menuPath
- menu name path where the last element corresponds to the specified group name.group
- group namemenuSubGroup
- the name used to sort the cascaded menu within other menu items at its level
-
contextChanged
Description copied from interface:Tool
Signals to the tool that the provider's context has changed. This lets toolbar and menu actions update enablement based on current context.Pass
null
to signal that the entire tool's context has changed- Specified by:
contextChanged
in interfaceTool
- Parameters:
provider
- the provider whose context changed; null to signal the tool's context
-
addContextListener
Description copied from interface:Tool
Adds the given context listener to this tool- Specified by:
addContextListener
in interfaceTool
- Parameters:
listener
- the listener to add
-
removeContextListener
Description copied from interface:Tool
Removes the given context listener to this tool- Specified by:
removeContextListener
in interfaceTool
- Parameters:
listener
- the listener to add
-
getWindowManager
Description copied from interface:Tool
Returns the DockingWindowManger for this tool.- Specified by:
getWindowManager
in interfaceTool
- Returns:
- the DockingWindowManger for this tool.
-
setConfigChanged
public void setConfigChanged(boolean changed) Description copied from interface:Tool
Toggles the "change" state of the tool...- Specified by:
setConfigChanged
in interfaceTool
- Parameters:
changed
- true indicates that the tool config has changed.
-
hasConfigChanged
public boolean hasConfigChanged()Description copied from interface:Tool
Return true if the tool's configuration has changed- Specified by:
hasConfigChanged
in interfaceTool
- Returns:
- true if the tool's configuration has changed
-
getToolActions
Description copied from interface:Tool
Returns the class that manages actions for the tool.Most clients will not need to use this methods. Instead, actions should be added to the tool via
Tool.addAction(DockingActionIf)
andTool.addLocalAction(ComponentProvider, DockingActionIf)
.- Specified by:
getToolActions
in interfaceTool
- Returns:
- the action manager
-