Interface ToolServices

  • All Known Implementing Classes:

    public interface ToolServices
    Services that the Tool uses.
    • Field Detail


        static final java.lang.String DEFAULT_TOOLNAME
        The default tool name for Ghidra
        See Also:
        Constant Field Values
    • Method Detail

      • closeTool

        void closeTool​(Tool tool)
        Notify the framework that the tool is closing.
        tool - tool that is closing
      • saveTool

        void saveTool​(Tool tool)
        Saves the tool's configuration in the standard tool location.
        tool - tool to save.
      • exportTool exportTool​(ToolTemplate tool)
        Save the tool to the given location on the local file system.
        tool - the tool template to write
        the file to which the tool was saved
        Throws: - thrown if the file's directory doesn't exist. - thrown if there is an error writing the file.
      • getToolChest

        ToolChest getToolChest()
        Get the tool chest for the project.
      • displaySimilarTool

        void displaySimilarTool​(Tool 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.
        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.
        domainFile - The file for which to find the preferred tool.
        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.
        domainClass - The domain file class type for which to get tools
      • launchDefaultTool

        Tool launchDefaultTool​(DomainFile domainFile)
        Launch the default tool; if domainFile is not null, this file will be opened in the tool.
        domainFile - the file to open; may be null
        See Also:
      • launchTool

        Tool launchTool​(java.lang.String toolName,
                        DomainFile domainFile)
        Launch the tool with the given name
        toolName - name of the tool to launch
        domainFile - the file to open; may be null
      • addDefaultToolChangeListener

        void addDefaultToolChangeListener​(DefaultToolChangeListener listener)
        Add a listener that will be notified when the default tool specification changes.
      • removeDefaultToolChangeListener

        void removeDefaultToolChangeListener​(DefaultToolChangeListener listener)
        Remove the listener.
      • getRunningTools

        Tool[] getRunningTools()
        Return array of running tools
        array of Tools
      • canAutoSave

        boolean canAutoSave​(Tool tool)
        Returns true if this tool should be saved base on the state of other runnings instances of the same tool
        tool - the tool to check for saving
        true if the tool should be saved