Package ghidra.framework.model
Interface ToolServices
-
- All Known Implementing Classes:
ToolServicesAdapter
public interface ToolServicesServices that the Tool uses.
-
-
Field Summary
Fields Change Modifier and Type Field Description static java.lang.StringDEFAULT_TOOLNAMEThe default tool name for Ghidra
-
Method Summary
All Methods Instance Methods Abstract Methods Change Modifier and Type Method Description voidaddDefaultToolChangeListener(DefaultToolChangeListener listener)Add a listener that will be notified when the default tool specification changesNEW booleancanAutoSave(PluginTool tool)Returns true if this tool should be saved base on the state of other running instances of the same toolNEW voidcloseTool(PluginTool tool)Notify the framework that the tool is closing.NEW voiddisplaySimilarTool(PluginTool tool, DomainFile domainFile, PluginEvent event)Find a running tool like the one specified that has the named domain file.java.io.FileexportTool(ToolTemplate tool)Save the tool to the given location on the local file system.java.util.Set<ToolTemplate>getCompatibleTools(java.lang.Class<? extends DomainObject> domainClass)Returns a set of tools that can open the given domain file class.java.util.Set<ToolAssociationInfo>getContentTypeToolAssociations()Returns theassociations, which describe content types and the tools used to open them, for all content types known to the system.ToolTemplategetDefaultToolTemplate(DomainFile domainFile)Returns the default tool template used to open the tool.MODIFIED PluginTool[]getRunningTools()Return array of running toolsToolChestgetToolChest()Get the tool chest for the projectMODIFIED PluginToollaunchDefaultTool(DomainFile domainFile)Launch the default tool; if domainFile is not null, this file will be opened in the tool.MODIFIED PluginToollaunchTool(java.lang.String toolName, DomainFile domainFile)Launch the tool with the given namevoidremoveDefaultToolChangeListener(DefaultToolChangeListener listener)Remove the listenerNEW voidsaveTool(PluginTool tool)Saves the tool's configuration in the standard tool location.voidsetContentTypeToolAssociations(java.util.Set<ToolAssociationInfo> infos)Sets theassociations, which describe content types and the tools used to open them, for the system.REMOVED voidcloseTool(Tool tool) (Removed)REMOVED voidsaveTool(Tool tool) (Removed)REMOVED voiddisplaySimilarTool(Tool tool, DomainFile domainFile, PluginEvent event) (Removed)REMOVED booleancanAutoSave(Tool tool) (Removed)
-
-
-
Field Detail
-
DEFAULT_TOOLNAME
static final java.lang.String DEFAULT_TOOLNAME
The default tool name for Ghidra- See Also:
- Constant Field Values
-
-
Method Detail
-
closeTool NEW
void closeTool(PluginTool tool)
Notify the framework that the tool is closing.- Parameters:
tool- tool that is closing
-
saveTool NEW
void saveTool(PluginTool tool)
Saves the tool's configuration in the standard tool location.- Parameters:
tool- tool to save.
-
exportTool
java.io.File exportTool(ToolTemplate tool) throws java.io.FileNotFoundException, java.io.IOException
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:
java.io.FileNotFoundException- thrown if the file's directory doesn't exist.java.io.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 NEW
void displaySimilarTool(PluginTool tool, DomainFile domainFile, PluginEvent event)
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
ToolTemplate getDefaultToolTemplate(DomainFile domainFile)
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
java.util.Set<ToolTemplate> getCompatibleTools(java.lang.Class<? extends DomainObject> domainClass)
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
java.util.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(Set)
-
setContentTypeToolAssociations
void setContentTypeToolAssociations(java.util.Set<ToolAssociationInfo> infos)
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:
getContentTypeToolAssociations()
-
launchDefaultTool MODIFIED
return type: Tool → PluginTool-ghidra.framework.model.Tool launchDefaultTool(ghidra.framework.model.DomainFile domainFile)+ghidra.framework.plugintool.PluginTool launchDefaultTool(ghidra.framework.model.DomainFile domainFile)PluginTool launchDefaultTool(DomainFile domainFile)
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 MODIFIED
return type: Tool → PluginTool-ghidra.framework.model.Tool launchTool(java.lang.String toolName, ghidra.framework.model.DomainFile domainFile)+ghidra.framework.plugintool.PluginTool launchTool(java.lang.String toolName, ghidra.framework.model.DomainFile domainFile)PluginTool launchTool(java.lang.String toolName, DomainFile domainFile)
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
void addDefaultToolChangeListener(DefaultToolChangeListener listener)
Add a listener that will be notified when the default tool specification changes- Parameters:
listener- the listener
-
removeDefaultToolChangeListener
void removeDefaultToolChangeListener(DefaultToolChangeListener listener)
Remove the listener- Parameters:
listener- the listener
-
getRunningTools MODIFIED
return type: ghidra.framework.model.Tool[] → ghidra.framework.plugintool.PluginTool[]-ghidra.framework.model.Tool[] getRunningTools()+ghidra.framework.plugintool.PluginTool[] getRunningTools()PluginTool[] getRunningTools()
Return array of running tools- Returns:
- array of Tools
-
canAutoSave NEW
boolean canAutoSave(PluginTool tool)
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
-
-