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.StringDELIMITTERThe delimiter used in categories and menu paths.static java.lang.String[]METADATA
-
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()java.lang.StringgetImportPackage()Returns the script importsjavax.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 in categories and menu paths.- See Also:
- Constant Field Values
-
METADATA
public static final java.lang.String[] METADATA
-
-
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()
- Returns:
- an error resulting from parsing keybinding metadata
-
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
-
getImportPackage
public java.lang.String getImportPackage()
Returns the script imports- Returns:
- the script imports
-
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()
- Returns:
- true if the script either has compiler errors, or is a duplicate
-
getErrorMessage
public java.lang.String getErrorMessage()
- Returns:
- a generic error message
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-