Package sc.fiji.snt.gui
Class ScriptInstaller
java.lang.Object
sc.fiji.snt.gui.ScriptInstaller
- All Implemented Interfaces:
EventListener,MenuKeyListener
Utility class for discovery of SNT scripts
- Author:
- Tiago Ferreira
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a UI list of SNT's 'Batch' scriptsstatic StringgetBoilerplateScript(String extension) Returns a UI list with all the bundled non-demo SNT scriptsgetScriptsMenu(Pattern excludePattern, String... directories) Returns a UI list with the bundled SNT scripts (specified directories only).voidvoidvoidstatic voidvoidopenScript(String folder, String name) static booleanRuns the specified script known toScriptService.voidstatic boolean
-
Field Details
-
DEMO_SCRIPT
Pattern to match demo scripts (case-insensitive) -
NON_DEMO_SCRIPT
Pattern to match non-demo scripts (case-insensitive)
-
-
Constructor Details
-
ScriptInstaller
-
-
Method Details
-
getScriptsDir
-
getBatchScriptsMenu
Returns a UI list of SNT's 'Batch' scripts -
getScriptsMenu
Returns a UI list with all the bundled non-demo SNT scripts -
getScriptsMenu
Returns a UI list with the bundled SNT scripts (specified directories only).- Parameters:
excludePattern- the exclusion pattern (e.g.,DEMO_SCRIPT). Null allowed.directories- the subset of directories (e.g., Analysis, Batch, etc.)- Returns:
- the scripts menu
-
openScript
- Throws:
IllegalArgumentException
-
runScript
- Throws:
IllegalArgumentException
-
newScript
-
getBoilerplateScript
-
runScript
-
runScript
Runs the specified script known toScriptService.- Parameters:
scriptPath- the script path as registered in ScriptService, (e.g., File/Open_Samples/Comparing_Lengths.ijm or File > Open Samples > Comparing Lengths)- Returns:
- whether the script was executed
-