Package qupath.lib.gui.scripting
Class DefaultScriptEditor
java.lang.Object
qupath.lib.gui.scripting.DefaultScriptEditor
- All Implemented Interfaces:
ScriptEditor
- Direct Known Subclasses:
RichScriptEditor
Default multilingual script editor.
Lacks syntax highlighting and other pleasant features, unfortunately.
- Author:
- Pete Bankhead
-
Property Summary
TypePropertyDescriptionprotected ReadOnlyObjectProperty
<ScriptLanguage> protected ReadOnlyObjectProperty
<ScriptSyntax> protected ObservableBooleanValue
Boolean property indicating whether the console should display the log, rather than directly-printed information. -
Field Summary
Modifier and TypeFieldDescriptionprotected org.controlsfx.control.action.Action
protected KeyCombination
protected final KeyCodeCombination
protected org.controlsfx.control.action.Action
protected org.controlsfx.control.action.Action
protected org.controlsfx.control.action.Action
protected org.controlsfx.control.action.Action
protected org.controlsfx.control.action.Action
protected org.controlsfx.control.action.Action
protected org.controlsfx.control.action.Action
protected org.controlsfx.control.action.Action
protected org.controlsfx.control.action.Action
protected org.controlsfx.control.action.Action
protected org.controlsfx.control.action.Action
protected org.controlsfx.control.action.Action
protected org.controlsfx.control.action.Action
protected org.controlsfx.control.action.Action
protected org.controlsfx.control.action.Action
protected org.controlsfx.control.action.Action
protected org.controlsfx.control.action.Action
protected org.controlsfx.control.action.Action
protected org.controlsfx.control.action.Action
protected BooleanProperty
protected org.controlsfx.control.action.Action
protected org.controlsfx.control.action.Action
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addNewScript
(String script, ScriptLanguage language, boolean doSelect) Create a new script in the specified language.protected ReadOnlyObjectProperty
<ScriptLanguage> protected ReadOnlyObjectProperty
<ScriptSyntax> protected static String
getClipboardText
(boolean escapeCharacters) protected ScriptEditorControl
<? extends Region> protected ScriptEditorControl
<? extends Region> protected ScriptLanguage
Gets the value of thecurrentLanguage
property.protected ScriptTab
protected ScriptSyntax
Gets the value of thecurrentSyntax
property.protected String
protected ScriptEditorControl
<?> protected ScriptEditorControl
<?> protected String
getStage()
Get the stage for this script editor.protected static boolean
pasteFromClipboard
(ScriptEditorControl<?> control, boolean escapeCharacters) protected void
Update the font size for the script editor and console.Observable value indicating whether a script is currently running or not.protected ObservableBooleanValue
Boolean property indicating whether the console should display the log, rather than directly-printed information.void
Show the script editor.void
showScript
(File file) Show the script editor, opening an existing script file.void
showScript
(String name, String script) Show the script editor, including a new script with the specified name.boolean
supportsFile
(File file) Query whether a file represents a supported script.
-
Property Details
-
currentLanguage
- See Also:
-
currentSyntax
- See Also:
-
sendLogToConsole
Boolean property indicating whether the console should display the log, rather than directly-printed information.- See Also:
-
-
Field Details
-
comboPasteEscape
-
completionCodeCombination
-
beautifySourceAction
protected org.controlsfx.control.action.Action beautifySourceAction -
compressSourceAction
protected org.controlsfx.control.action.Action compressSourceAction -
copyAction
protected org.controlsfx.control.action.Action copyAction -
cutAction
protected org.controlsfx.control.action.Action cutAction -
pasteAction
protected org.controlsfx.control.action.Action pasteAction -
pasteAndEscapeAction
protected org.controlsfx.control.action.Action pasteAndEscapeAction -
undoAction
protected org.controlsfx.control.action.Action undoAction -
redoAction
protected org.controlsfx.control.action.Action redoAction -
runScriptAction
protected org.controlsfx.control.action.Action runScriptAction -
runSelectedAction
protected org.controlsfx.control.action.Action runSelectedAction -
runProjectScriptAction
protected org.controlsfx.control.action.Action runProjectScriptAction -
runProjectScriptNoSaveAction
protected org.controlsfx.control.action.Action runProjectScriptNoSaveAction -
killRunningScriptAction
protected org.controlsfx.control.action.Action killRunningScriptAction -
insertMuAction
protected org.controlsfx.control.action.Action insertMuAction -
insertQPImportAction
protected org.controlsfx.control.action.Action insertQPImportAction -
insertQPExImportAction
protected org.controlsfx.control.action.Action insertQPExImportAction -
insertAllDefaultImportAction
protected org.controlsfx.control.action.Action insertAllDefaultImportAction -
insertPixelClassifiersAction
protected org.controlsfx.control.action.Action insertPixelClassifiersAction -
insertObjectClassifiersAction
protected org.controlsfx.control.action.Action insertObjectClassifiersAction -
insertDetectionMeasurementsAction
protected org.controlsfx.control.action.Action insertDetectionMeasurementsAction -
findAction
protected org.controlsfx.control.action.Action findAction -
smartEditingAction
protected org.controlsfx.control.action.Action smartEditingAction -
smartEditing
-
-
Constructor Details
-
DefaultScriptEditor
Constructor.- Parameters:
qupath
- current QuPath instance.
-
-
Method Details
-
supportsFile
Query whether a file represents a supported script. Currently, this test looks at the file extension only.- Specified by:
supportsFile
in interfaceScriptEditor
- Parameters:
file
- the file to test- Returns:
- true if the file is likely to contain a supported script, false otherwise
-
getStage
Get the stage for this script editor.- Returns:
-
scriptRunning
Observable value indicating whether a script is currently running or not. This can be used (for example) to determine whether a user action should be blocked until the script has completed.- Returns:
-
promptToSetFontSize
protected void promptToSetFontSize()Update the font size for the script editor and console. -
addNewScript
Create a new script in the specified language.- Parameters:
script
- text of the script to addlanguage
- language of the scriptdoSelect
- if true, select the script when it is added
-
getNewConsole
-
getNewEditor
-
currentLanguageProperty
- Returns:
- the
currentLanguage
property - See Also:
-
currentSyntaxProperty
- Returns:
- the
currentSyntax
property - See Also:
-
getCurrentLanguage
Gets the value of thecurrentLanguage
property.- Property description:
- Returns:
- the value of the
currentLanguage
property - See Also:
-
getCurrentSyntax
Gets the value of thecurrentSyntax
property.- Property description:
- Returns:
- the value of the
currentSyntax
property - See Also:
-
getCurrentScriptTab
-
getCurrentEditorControl
-
getCurrentConsoleControl
-
getSelectedText
-
getCurrentText
-
sendLogToConsoleProperty
Boolean property indicating whether the console should display the log, rather than directly-printed information.- Returns:
-
getClipboardText
-
pasteFromClipboard
protected static boolean pasteFromClipboard(ScriptEditorControl<?> control, boolean escapeCharacters) -
showEditor
public void showEditor()Description copied from interface:ScriptEditor
Show the script editor.- Specified by:
showEditor
in interfaceScriptEditor
-
showScript
Description copied from interface:ScriptEditor
Show the script editor, including a new script with the specified name.- Specified by:
showScript
in interfaceScriptEditor
- Parameters:
name
- name of the script to showscript
- content of the script
-
showScript
Description copied from interface:ScriptEditor
Show the script editor, opening an existing script file.- Specified by:
showScript
in interfaceScriptEditor
- Parameters:
file
- the script file
-