Package ghidra.framework.model
Interface ToolServices
- All Known Implementing Classes:
ToolServicesAdapter
public interface ToolServices
Services that the Tool uses.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a listener that will be notified when the default tool specification changesboolean
canAutoSave
(PluginTool tool) Returns true if this tool should be saved base on the state of other running instances of the same toolvoid
closeTool
(PluginTool tool) Notify the framework that the tool is closing.void
displaySimilarTool
(PluginTool tool, DomainFile domainFile, PluginEvent event) Find a running tool like the one specified that has the named domain file.exportTool
(ToolTemplate tool) Save the tool to the given location on the local file system.getCompatibleTools
(Class<? extends DomainObject> domainClass) Returns a set of tools that can open the given domain file class.Returns theassociations
, which describe content types and the tools used to open them, for all content types known to the system.getDefaultToolTemplate
(DomainFile domainFile) Returns the default tool template used to open the tool.Return array of running toolsGet the tool chest for the projectlaunchDefaultTool
(DomainFile domainFile) Launch the default tool; if domainFile is not null, this file will be opened in the tool.launchTool
(String toolName, DomainFile domainFile) Launch the tool with the given namevoid
Remove the listenervoid
saveTool
(PluginTool tool) Saves the tool's configuration in the standard tool location.void
Sets theassociations
, which describe content types and the tools used to open them, for the system.
-
Field Details
-
DEFAULT_TOOLNAME
The default tool name for Ghidra- See Also:
-
-
Method Details
-
closeTool
Notify the framework that the tool is closing.- Parameters:
tool
- tool that is closing
-
saveTool
Saves the tool's configuration in the standard tool location.- Parameters:
tool
- tool to save.
-
exportTool
Save the tool to the given location on the local file system.- Parameters:
tool
- the tool template to write- Returns:
- the file to which the tool was saved
- Throws:
FileNotFoundException
- thrown if the file's directory doesn't exist.IOException
- thrown if there is an error writing the file.
-
getToolChest
ToolChest getToolChest()Get the tool chest for the project- Returns:
- the tool chest
-
displaySimilarTool
Find a running tool like the one specified that has the named domain file. If it finds a matching tool, then it is brought to the front. Otherwise, it creates one and runs it. It then invokes the specified event on the running tool.- Parameters:
tool
- find/create a tool like this one.domainFile
- open this file in the found/created tool.event
- invoke this event on the found/created tool
-
getDefaultToolTemplate
Returns the default tool template used to open the tool. Here default means the tool that should be used to open the given file, whether defined by the user or the system default.- Parameters:
domainFile
- The file for which to find the preferred tool.- Returns:
- The preferred tool that should be used to open the given file.
-
getCompatibleTools
Returns a set of tools that can open the given domain file class.- Parameters:
domainClass
- The domain file class type for which to get tools- Returns:
- the tools
-
getContentTypeToolAssociations
Set<ToolAssociationInfo> getContentTypeToolAssociations()Returns theassociations
, which describe content types and the tools used to open them, for all content types known to the system.- Returns:
- the associations
- See Also:
-
setContentTypeToolAssociations
Sets theassociations
, which describe content types and the tools used to open them, for the system.- Parameters:
infos
- The associations to be applied- See Also:
-
launchDefaultTool
Launch the default tool; if domainFile is not null, this file will be opened in the tool.- Parameters:
domainFile
- the file to open; may be null- Returns:
- the tool
-
launchTool
Launch the tool with the given name- Parameters:
toolName
- name of the tool to launchdomainFile
- the file to open; may be null- Returns:
- the tool
-
addDefaultToolChangeListener
Add a listener that will be notified when the default tool specification changes- Parameters:
listener
- the listener
-
removeDefaultToolChangeListener
Remove the listener- Parameters:
listener
- the listener
-
getRunningTools
PluginTool[] getRunningTools()Return array of running tools- Returns:
- array of Tools
-
canAutoSave
Returns true if this tool should be saved base on the state of other running instances of the same tool- Parameters:
tool
- the tool to check for saving- Returns:
- true if the tool should be saved
-