Package ghidra.framework.project.tool

# Class GhidraToolTemplate

java.lang.Object
ghidra.framework.project.tool.GhidraToolTemplate

All Implemented Interfaces:
  `ToolTemplate`

public class GhidraToolTemplate extends Object implements ToolTemplate
Implementation for a tool template that has the class names of the plugins that are part of the tool, and the tool's icon.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static String`
  `TEMPLATE_NAME`

  ### Fields inherited from interface ghidra.framework.model.ToolTemplate

  `TOOL_INSTANCE_NAME_XML_NAME, TOOL_NAME_XML_NAME, TOOL_XML_NAME`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GhidraToolTemplate(ToolIconURL iconURL, org.jdom.Element toolElement, Class<?>[] supportedDataTypes)`
  `GhidraToolTemplate(org.jdom.Element root, String path)`
  Constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `PluginTool`
  `createTool(Project project)`
  Creates a tool like only this template knows how.
  `boolean`
  `equals(Object obj)`
  Indicates whether some other object is "equal to" this one.
  `ImageIcon`
  `getIcon()`
  Get the icon for this tool template.
  `ToolIconURL`
  `getIconURL()`
  Get the icon URL.
  `String`
  `getName()`
  Get the name for the tool.
  `String`
  `getPath()`
  Returns the path from whence this tool template came; may be null if the tool was not loaded from the filesystem
  `Class<?>[]`
  `getSupportedDataTypes()`
  Get the classes of the data types that this tool supports, i.e., what data types can be dropped onto this tool.
  `org.jdom.Element`
  `getToolElement()`
  This returns the XML element that represents the tool part of the overall XML hierarchy.
  `int`
  `hashCode()`
  Returns a hash code value for the object.
  `void`
  `restoreFromXml(org.jdom.Element root)`
  Restore this object from a saved XML element.
  `org.jdom.Element`
  `saveToXml()`
  Save this object to an XML Element.
  `void`
  `setIconURL(ToolIconURL url)`
  `void`
  `setName(String name)`
  Set the name for the tool template.
  `String`
  `toString()`
  Returns a string representation of the object.

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### TEMPLATE_NAME

    public static String TEMPLATE_NAME

- ## Constructor Details

  - ### GhidraToolTemplate

    public GhidraToolTemplate(org.jdom.Element root, String path)
    Constructor.
    Parameters:
      `root` - XML element that contains the tool template data
      `path` - the path of the template

  - ### GhidraToolTemplate

    public GhidraToolTemplate(ToolIconURL iconURL, org.jdom.Element toolElement, Class<?>[] supportedDataTypes)

- ## Method Details

  - ### getName

    public String getName()
    Description copied from interface: `ToolTemplate`
    Get the name for the tool.
    Specified by:
      `getName` in interface `ToolTemplate`
    Returns:
      the name

  - ### getPath

    public String getPath()
    Description copied from interface: `ToolTemplate`
    Returns the path from whence this tool template came; may be null if the tool was not loaded from the filesystem
    Specified by:
      `getPath` in interface `ToolTemplate`
    Returns:
      the path

  - ### setName

    public void setName(String name)
    Description copied from interface: `ToolTemplate`
    Set the name for the tool template.
    Specified by:
      `setName` in interface `ToolTemplate`
    Parameters:
      `name` - new tool template name

  - ### getIcon

    public ImageIcon getIcon()
    Description copied from interface: `ToolTemplate`
    Get the icon for this tool template. This is equivalent to calling `getIconURL().getIcon()`
    Specified by:
      `getIcon` in interface `ToolTemplate`
    Returns:
      the icon for this tool template.

  - ### getSupportedDataTypes

    public Class<?>[] getSupportedDataTypes()
    Description copied from interface: `ToolTemplate`
    Get the classes of the data types that this tool supports, i.e., what data types can be dropped onto this tool.
    Specified by:
      `getSupportedDataTypes` in interface `ToolTemplate`
    Returns:
      list of supported data type classes.

  - ### getIconURL

    public ToolIconURL getIconURL()
    Get the icon URL.
    Specified by:
      `getIconURL` in interface `ToolTemplate`
    Returns:
      the iconURL for this tool template

  - ### hashCode

    public int hashCode()
    Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by `java.util.Hashtable`.
    Overrides:
      `hashCode` in class `Object`

  - ### equals

    public boolean equals(Object obj)
    Indicates whether some other object is "equal to" this one.
    Overrides:
      `equals` in class `Object`

  - ### toString

    public String toString()
    Returns a string representation of the object. In general, the `toString` method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read.
    Overrides:
      `toString` in class `Object`

  - ### restoreFromXml

    public void restoreFromXml(org.jdom.Element root)
    Description copied from interface: `ToolTemplate`
    Restore this object from a saved XML element.
    Specified by:
      `restoreFromXml` in interface `ToolTemplate`
    Parameters:
      `root` - element to restore this object into

  - ### saveToXml

    public org.jdom.Element saveToXml()
    Description copied from interface: `ToolTemplate`
    Save this object to an XML Element.
    Specified by:
      `saveToXml` in interface `ToolTemplate`
    Returns:
      the ToolConfig saved as an XML element

  - ### setIconURL

    public void setIconURL(ToolIconURL url)

  - ### getToolElement

    public org.jdom.Element getToolElement()
    Description copied from interface: `ToolTemplate`
    This returns the XML element that represents the tool part of the overall XML hierarchy.
    Specified by:
      `getToolElement` in interface `ToolTemplate`
    Returns:
      the XML element that represents the tool part of the overall XML hierarchy.

  - ### createTool

    public PluginTool createTool(Project project)
    Description copied from interface: `ToolTemplate`
    Creates a tool like only this template knows how.
    Specified by:
      `createTool` in interface `ToolTemplate`
    Parameters:
      `project` - the project in which the tool will be living.
    Returns:
      a new tool for this template implementation.