Class ToolServicesAdapter

  • All Implemented Interfaces:
    ToolServices

    public class ToolServicesAdapter
    extends java.lang.Object
    implements ToolServices
    • Constructor Detail

      • ToolServicesAdapter

        public ToolServicesAdapter()
    • Method Detail

      • canAutoSave

        public boolean canAutoSave​(Tool tool)
        Description copied from interface: ToolServices
        Returns true if this tool should be saved base on the state of other runnings instances of the same tool
        Specified by:
        canAutoSave in interface ToolServices
        Parameters:
        tool - the tool to check for saving
        Returns:
        true if the tool should be saved
      • closeTool

        public void closeTool​(Tool tool)
        Description copied from interface: ToolServices
        Notify the framework that the tool is closing.
        Specified by:
        closeTool in interface ToolServices
        Parameters:
        tool - tool that is closing
      • displaySimilarTool

        public void displaySimilarTool​(Tool tool,
                                       DomainFile domainFile,
                                       PluginEvent event)
        Description copied from interface: ToolServices
        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.
        Specified by:
        displaySimilarTool in interface ToolServices
        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
      • exportTool

        public java.io.File exportTool​(ToolTemplate tool)
                                throws java.io.FileNotFoundException,
                                       java.io.IOException
        Description copied from interface: ToolServices
        Save the tool to the given location on the local file system.
        Specified by:
        exportTool in interface ToolServices
        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.
      • getCompatibleTools

        public java.util.Set<ToolTemplate> getCompatibleTools​(java.lang.Class<? extends DomainObject> domainClass)
        Description copied from interface: ToolServices
        Returns a set of tools that can open the given domain file class.
        Specified by:
        getCompatibleTools in interface ToolServices
        Parameters:
        domainClass - The domain file class type for which to get tools
      • getDefaultToolTemplate

        public ToolTemplate getDefaultToolTemplate​(DomainFile domainFile)
        Description copied from interface: ToolServices
        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.
        Specified by:
        getDefaultToolTemplate in interface ToolServices
        Parameters:
        domainFile - The file for which to find the preferred tool.
        Returns:
        The preferred tool that should be used to open the given file.
      • launchDefaultTool

        public Tool launchDefaultTool​(DomainFile domainFile)
        Description copied from interface: ToolServices
        Launch the default tool; if domainFile is not null, this file will be opened in the tool.
        Specified by:
        launchDefaultTool in interface ToolServices
        Parameters:
        domainFile - the file to open; may be null
        See Also:
        #setDefaultTool(ToolTemplate)
      • launchTool

        public Tool launchTool​(java.lang.String toolName,
                               DomainFile domainFile)
        Description copied from interface: ToolServices
        Launch the tool with the given name
        Specified by:
        launchTool in interface ToolServices
        Parameters:
        toolName - name of the tool to launch
        domainFile - the file to open; may be null
      • saveTool

        public void saveTool​(Tool tool)
        Description copied from interface: ToolServices
        Saves the tool's configuration in the standard tool location.
        Specified by:
        saveTool in interface ToolServices
        Parameters:
        tool - tool to save.