Package ghidra.framework.plugintool
Class ToolServicesAdapter
java.lang.Object
ghidra.framework.plugintool.ToolServicesAdapter
- All Implemented Interfaces:
ToolServices
-
Field Summary
Fields inherited from interface ghidra.framework.model.ToolServices
DEFAULT_TOOLNAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanAutoSave(PluginTool tool) Returns true if this tool should be saved base on the state of other running instances of the same toolvoidcloseTool(PluginTool tool) Notify the framework that the tool is closing.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/preferred tool template which should be used to open the specified domain file, whether defined by the user or the system default.getDefaultToolTemplate(String contentType) Returns the default/preferred tool template which should be used to open the specified domain file content type, whether defined by the user or the system default.Return array of running toolsGet the tool chest for the projectlaunchDefaultTool(Collection<DomainFile> domainFile) Launch the defaulttooland open the specified domainFiles.Launch the default tool and open the specified Ghidra URL resource.launchTool(String toolName, Collection<DomainFile> domainFile) Launch thetoolwith the given name and open the specified domainFiles.launchToolWithURL(String toolName, URL url) Launch the tool with the given name and attempt to open the specified Ghidra URL resource.voidsaveTool(PluginTool tool) Saves the tool's configuration in the standard tool location.voidSets theassociations, which describe content types and the tools used to open them, for the system.
-
Constructor Details
-
ToolServicesAdapter
public ToolServicesAdapter()
-
-
Method Details
-
canAutoSave
Description copied from interface:ToolServicesReturns true if this tool should be saved base on the state of other running instances of the same tool- Specified by:
canAutoSavein interfaceToolServices- Parameters:
tool- the tool to check for saving- Returns:
- true if the tool should be saved
-
closeTool
Description copied from interface:ToolServicesNotify the framework that the tool is closing.- Specified by:
closeToolin interfaceToolServices- Parameters:
tool- tool that is closing
-
exportTool
Description copied from interface:ToolServicesSave the tool to the given location on the local file system.- Specified by:
exportToolin interfaceToolServices- 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.
-
getCompatibleTools
Description copied from interface:ToolServicesReturns a set of tools that can open the given domain file class.- Specified by:
getCompatibleToolsin interfaceToolServices- Parameters:
domainClass- The domain file class type for which to get tools- Returns:
- the tools
-
getContentTypeToolAssociations
Description copied from interface:ToolServicesReturns theassociations, which describe content types and the tools used to open them, for all content types known to the system.- Specified by:
getContentTypeToolAssociationsin interfaceToolServices- Returns:
- the associations
- See Also:
-
getDefaultToolTemplate
Description copied from interface:ToolServicesReturns the default/preferred tool template which should be used to open the specified domain file, whether defined by the user or the system default.- Specified by:
getDefaultToolTemplatein interfaceToolServices- Parameters:
domainFile- The file whose preferred tool should be found.- Returns:
- The preferred tool that should be used to open the given file or null if none found.
-
getDefaultToolTemplate
Description copied from interface:ToolServicesReturns the default/preferred tool template which should be used to open the specified domain file content type, whether defined by the user or the system default.- Specified by:
getDefaultToolTemplatein interfaceToolServices- Parameters:
contentType- The content type whose preferred tool should be found.- Returns:
- The preferred tool that should be used to open the given file or null if none found.
-
getRunningTools
Description copied from interface:ToolServicesReturn array of running tools- Specified by:
getRunningToolsin interfaceToolServices- Returns:
- array of Tools
-
getToolChest
Description copied from interface:ToolServicesGet the tool chest for the project- Specified by:
getToolChestin interfaceToolServices- Returns:
- the tool chest
-
launchDefaultTool
Description copied from interface:ToolServicesLaunch the defaulttooland open the specified domainFiles. NOTE: running tool reuse is implementation dependent- Specified by:
launchDefaultToolin interfaceToolServices- Parameters:
domainFile- the files to open. A null or empty list will results in an immediate return of a nullPluginTool. Null entries are not permitted.- Returns:
- the launched tool. Null returned if a suitable default tool for the file content type was not found or failed to launch.
-
launchTool
Description copied from interface:ToolServicesLaunch thetoolwith the given name and open the specified domainFiles. Only those domainFiles with a content type supported by the specified tool will be opened. NOTE: running tool reuse is implementation dependent.- Specified by:
launchToolin interfaceToolServices- Parameters:
toolName- name of thetool templateto launch or re-usedomainFile- the files to open; may be null or empty. Null entries are not permitted.- Returns:
- the resulting
toolor null if the specified tool was not found or failed to launch
-
launchDefaultToolWithURL
Description copied from interface:ToolServicesLaunch the default tool and open the specified Ghidra URL resource. The tool chosen will be based upon the content type of the specified resource. NOTE: running tool re-use is implementation dependent- Specified by:
launchDefaultToolWithURLin interfaceToolServices- Parameters:
url- resource to be opened (seeGhidraURL)- Returns:
- the launched tool. Null returned if a failure occurs while accessing the specified resource or a suitable default tool for the file content type was not found.
-
launchToolWithURL
Description copied from interface:ToolServicesLaunch the tool with the given name and attempt to open the specified Ghidra URL resource.- Specified by:
launchToolWithURLin interfaceToolServices- Parameters:
toolName- name of the tool to launchurl- resource to be opened (seeGhidraURL)- Returns:
- the requested tool or null if the specified tool not found.
-
saveTool
Description copied from interface:ToolServicesSaves the tool's configuration in the standard tool location.- Specified by:
saveToolin interfaceToolServices- Parameters:
tool- tool to save.
-
setContentTypeToolAssociations
Description copied from interface:ToolServicesSets theassociations, which describe content types and the tools used to open them, for the system.- Specified by:
setContentTypeToolAssociationsin interfaceToolServices- Parameters:
infos- The associations to be applied- See Also:
-