Package ghidra.framework.project.tool
Class ToolManagerImpl
java.lang.Object
ghidra.framework.project.tool.ToolManagerImpl
- All Implemented Interfaces:
ToolManager,PropertyChangeListener,EventListener
Tool manager that knows about all the running tools for each workspace
in the project; the tool manager is responsible for launching new tools,
and managing connections among tools.
-
Field Summary
Fields inherited from interface ghidra.framework.model.ToolManager
DEFAULT_WORKSPACE_NAME, WORKSPACE_NAME_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the listener that will be notified when a tool is added or removed.booleancanAutoSave(PluginTool tool) voidClear the flag so the user does not get prompted to save the project; flag gets set to true when a workspace is created, and a workspace is created when a new project is created.createWorkspace(String name) Create a workspace with the given name.voiddisconnectTool(PluginTool tool) Removes all connections involving toolvoiddispose()voidDebug method for printing out the list of connections.Get the active workspacegetConnection(PluginTool producer, PluginTool consumer) Get the connection object for the producer and consumer toolsGet a list of tools that consume at least one tool event.Get a list of tools that produce at least one tool event.Get a list running tools across all workspaces.Called by WorkspaceImpl when it is restoring its state.Get any tool services available from this toolGet list of known workspaces.booleanReturn whether any tools have changed, or if any tools were added or removed from any of the workspaces.voidvoidRemove the workspace.voidRemove the workspace listener.voidrestoreFromXml(org.jdom.Element root) restores the object from an XML elementbooleanSave the tools that are opened and changed, that will be brought back up when the project is reopenedorg.jdom.ElementSaves this object to an XML elementvoidtoolChanged(PluginTool tool) A configuration change was made to the tool; a plugin was added or removed.voidtoolSaved(PluginTool tool, boolean toolChanged)
-
Constructor Details
-
ToolManagerImpl
-
-
Method Details
-
getActiveWorkspace
Description copied from interface:ToolManagerGet the active workspace- Specified by:
getActiveWorkspacein interfaceToolManager- Returns:
- the active workspace
-
getConsumerTools
Description copied from interface:ToolManagerGet a list of tools that consume at least one tool event.- Specified by:
getConsumerToolsin interfaceToolManager- Returns:
- zero-length array if no tool consumes any events
-
getProducerTools
Description copied from interface:ToolManagerGet a list of tools that produce at least one tool event.- Specified by:
getProducerToolsin interfaceToolManager- Returns:
- zero-length array if no tool produces any events
-
getRunningTools
Description copied from interface:ToolManagerGet a list running tools across all workspaces.- Specified by:
getRunningToolsin interfaceToolManager- Returns:
- zero-length array if there are no running tools.
-
getConnection
Description copied from interface:ToolManagerGet the connection object for the producer and consumer tools- Specified by:
getConnectionin interfaceToolManager- Parameters:
producer- tool that is producing the tool eventconsumer- tool that is consuming the tool event- Returns:
- the connection
-
createWorkspace
Description copied from interface:ToolManagerCreate a workspace with the given name.- Specified by:
createWorkspacein interfaceToolManager- Parameters:
name- name of workspace- Returns:
- the workspace
- Throws:
DuplicateNameException- if a workspace with this name already exists
-
removeWorkspace
Description copied from interface:ToolManagerRemove the workspace.- Specified by:
removeWorkspacein interfaceToolManager- Parameters:
ws- workspace to remove
-
getWorkspaces
Description copied from interface:ToolManagerGet list of known workspaces.- Specified by:
getWorkspacesin interfaceToolManager- Returns:
- an array of known workspaces
-
saveToXml
public org.jdom.Element saveToXml()Saves this object to an XML element- Returns:
- the element containing the tool XML
-
restoreFromXml
public void restoreFromXml(org.jdom.Element root) restores the object from an XML element- Parameters:
root- root element of saved XML state
-
hasChanged
public boolean hasChanged()Return whether any tools have changed, or if any tools were added or removed from any of the workspaces.- Returns:
- true if any tools in this workspace have changed
-
saveSessionTools
public boolean saveSessionTools()Save the tools that are opened and changed, that will be brought back up when the project is reopened- Returns:
- true if the session was saved
-
dispose
public void dispose() -
dumpConnectionList
public void dumpConnectionList()Debug method for printing out the list of connections. -
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
addWorkspaceChangeListener
Description copied from interface:ToolManagerAdd the listener that will be notified when a tool is added or removed.- Specified by:
addWorkspaceChangeListenerin interfaceToolManager- Parameters:
l- workspace listener to add
-
removeWorkspaceChangeListener
Description copied from interface:ToolManagerRemove the workspace listener.- Specified by:
removeWorkspaceChangeListenerin interfaceToolManager- Parameters:
l- workspace listener to remove
-
clearWorkspaceChanged
public void clearWorkspaceChanged()Clear the flag so the user does not get prompted to save the project; flag gets set to true when a workspace is created, and a workspace is created when a new project is created. -
getToolServices
Get any tool services available from this tool- Returns:
- ToolServices list of tool services this tool can provide.
-
toolChanged
Description copied from interface:ToolManagerA configuration change was made to the tool; a plugin was added or removed.- Specified by:
toolChangedin interfaceToolManager- Parameters:
tool- tool that changed
-
getTool
Called by WorkspaceImpl when it is restoring its state.- Parameters:
toolName- the name of the tool- Returns:
- the tool
-
disconnectTool
Description copied from interface:ToolManagerRemoves all connections involving tool- Specified by:
disconnectToolin interfaceToolManager- Parameters:
tool- tool for which to remove all connections
-
canAutoSave
-
toolSaved
-