Class ScriptInfo


  • public class ScriptInfo
    extends java.lang.Object
    This class parses the meta-data about a script.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String AT_AUTHOR  
      static java.lang.String AT_CATEGORY  
      static java.lang.String AT_KEYBINDING  
      static java.lang.String AT_MENUPATH  
      static java.lang.String AT_TOOLBAR  
      static java.lang.String DELIMITTER
      The delimiter used to categories and menu paths.
      static java.lang.String[] METADATA  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getAuthor()
      Returns the script author information.
      java.lang.String[] getCategory()
      Returns the script category path.
      java.lang.String getDescription()
      Returns the script description.
      java.lang.String getErrorMessage()  
      javax.swing.KeyStroke getKeyBinding()
      Returns the script key binding.
      java.lang.String getKeyBindingErrorMessage()  
      java.lang.String[] getMenuPath()
      Returns the script menu path.
      java.lang.String getMenuPathAsString()
      Returns the script menu path as a string.
      java.lang.String getName()
      Returns the name of the script.
      ResourceFile getSourceFile()
      Returns the script source file.
      javax.swing.ImageIcon getToolBarImage​(boolean scaled)
      Returns the script tool bar icon.
      java.lang.String getToolTipText()
      Returns a string designed to be used as a tool tip for describing this script
      boolean hasErrors()  
      boolean isCategory​(java.lang.String[] otherCategory)
      Returns true if 'cat' is a category.
      boolean isCompileErrors()
      Returns true if the script has compile errors.
      boolean isDuplicate()
      Returns true if this script is a duplicate.
      void refresh()
      Setting the toolbar image to null forces it to be reloaded on the next request.
      void setCompileErrors​(boolean b)
      Sets whether the script has compile errors.
      void setDuplicate​(boolean isDuplicate)
      Sets whether the script is a duplicate.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • DELIMITTER

        public static final java.lang.String DELIMITTER
        The delimiter used to categories and menu paths.
        See Also:
        Constant Field Values
      • METADATA

        public static final java.lang.String[] METADATA
    • Constructor Detail

      • ScriptInfo

        public ScriptInfo​(GhidraScriptProvider provider,
                          ResourceFile sourceFile)
        Constructs a new script.
        Parameters:
        provider - the script provider (for example, java or python)
        sourceFile - the script source file
    • Method Detail

      • refresh

        public void refresh()
        Setting the toolbar image to null forces it to be reloaded on the next request.
      • getName

        public java.lang.String getName()
        Returns the name of the script. The name of the script is the file name.
        Returns:
        the name of the script
      • getSourceFile

        public ResourceFile getSourceFile()
        Returns the script source file.
        Returns:
        the script source file
      • getAuthor

        public java.lang.String getAuthor()
        Returns the script author information.
        Returns:
        the script author information.
      • isCompileErrors

        public boolean isCompileErrors()
        Returns true if the script has compile errors.
        Returns:
        true if the script has compile errors
      • setCompileErrors

        public void setCompileErrors​(boolean b)
        Sets whether the script has compile errors.
        Parameters:
        b - true if the script has compile errors
      • isDuplicate

        public boolean isDuplicate()
        Returns true if this script is a duplicate. When two or more scripts exists with the same name, this is considered a duplicate script.
        Returns:
        true if this script is a duplicate
      • setDuplicate

        public void setDuplicate​(boolean isDuplicate)
        Sets whether the script is a duplicate.
        Parameters:
        isDuplicate - true if the script is a duplicate
      • getDescription

        public java.lang.String getDescription()
        Returns the script description.
        Returns:
        the script description
      • isCategory

        public boolean isCategory​(java.lang.String[] otherCategory)
        Returns true if 'cat' is a category.
        Parameters:
        otherCategory - the script category
        Returns:
        true if 'cat' is a category
      • getCategory

        public java.lang.String[] getCategory()
        Returns the script category path.
        Returns:
        the script category path
      • getMenuPath

        public java.lang.String[] getMenuPath()
        Returns the script menu path.
        Returns:
        the script menu path
      • getMenuPathAsString

        public java.lang.String getMenuPathAsString()
        Returns the script menu path as a string. For example, "Path1->Path2->Path3".
        Returns:
        the script menu path as a string
      • getKeyBinding

        public javax.swing.KeyStroke getKeyBinding()
        Returns the script key binding.
        Returns:
        the script key binding
      • getKeyBindingErrorMessage

        public java.lang.String getKeyBindingErrorMessage()
      • getToolBarImage

        public javax.swing.ImageIcon getToolBarImage​(boolean scaled)
        Returns the script tool bar icon.
        Parameters:
        scaled - true if the icon should be scaled to 16x16.
        Returns:
        the script tool bar icon
      • getToolTipText

        public java.lang.String getToolTipText()
        Returns a string designed to be used as a tool tip for describing this script
        Returns:
        a string designed to be used as a tool tip
      • hasErrors

        public boolean hasErrors()
      • getErrorMessage

        public java.lang.String getErrorMessage()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object