Package ghidra.app.script
Class ScriptInfo
- java.lang.Object
-
- ghidra.app.script.ScriptInfo
-
public class ScriptInfo extends java.lang.ObjectThis class parses the meta-data about a script.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAT_AUTHORstatic java.lang.StringAT_CATEGORYstatic java.lang.StringAT_KEYBINDINGstatic java.lang.StringAT_MENUPATHstatic java.lang.StringAT_TOOLBARstatic java.lang.StringDELIMITTERThe delimiter used to categories and menu paths.static java.lang.String[]METADATA
-
Constructor Summary
Constructors Constructor Description ScriptInfo(GhidraScriptProvider provider, ResourceFile sourceFile)Constructs a new script.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAuthor()Returns the script author information.java.lang.String[]getCategory()Returns the script category path.java.lang.StringgetDescription()Returns the script description.java.lang.StringgetErrorMessage()javax.swing.KeyStrokegetKeyBinding()Returns the script key binding.java.lang.StringgetKeyBindingErrorMessage()java.lang.String[]getMenuPath()Returns the script menu path.java.lang.StringgetMenuPathAsString()Returns the script menu path as a string.java.lang.StringgetName()Returns the name of the script.ResourceFilegetSourceFile()Returns the script source file.javax.swing.ImageIcongetToolBarImage(boolean scaled)Returns the script tool bar icon.java.lang.StringgetToolTipText()Returns a string designed to be used as a tool tip for describing this scriptbooleanhasErrors()booleanisCategory(java.lang.String[] otherCategory)Returns true if 'cat' is a category.booleanisCompileErrors()Returns true if the script has compile errors.booleanisDuplicate()Returns true if this script is a duplicate.voidrefresh()Setting the toolbar image to null forces it to be reloaded on the next request.voidsetCompileErrors(boolean b)Sets whether the script has compile errors.voidsetDuplicate(boolean isDuplicate)Sets whether the script is a duplicate.java.lang.StringtoString()
-
-
-
Field Detail
-
DELIMITTER
public static final java.lang.String DELIMITTER
The delimiter used to categories and menu paths.- See Also:
- Constant Field Values
-
AT_AUTHOR
public static final java.lang.String AT_AUTHOR
- See Also:
- Constant Field Values
-
AT_CATEGORY
public static final java.lang.String AT_CATEGORY
- See Also:
- Constant Field Values
-
AT_KEYBINDING
public static final java.lang.String AT_KEYBINDING
- See Also:
- Constant Field Values
-
AT_MENUPATH
public static final java.lang.String AT_MENUPATH
- See Also:
- Constant Field Values
-
AT_TOOLBAR
public static final java.lang.String AT_TOOLBAR
- 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:
toStringin classjava.lang.Object
-
-