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
PropertiesTypePropertyDescriptionprotected ReadOnlyObjectProperty<ScriptLanguage>protected ReadOnlyObjectProperty<ScriptSyntax>protected ObservableBooleanValueBoolean property indicating whether the console should display the log, rather than directly-printed information. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.controlsfx.control.action.Actionprotected KeyCombinationprotected final KeyCodeCombinationprotected org.controlsfx.control.action.Actionprotected org.controlsfx.control.action.Actionprotected org.controlsfx.control.action.Actionprotected org.controlsfx.control.action.Actionprotected org.controlsfx.control.action.Actionprotected org.controlsfx.control.action.Actionprotected org.controlsfx.control.action.Actionprotected org.controlsfx.control.action.Actionprotected org.controlsfx.control.action.Actionprotected org.controlsfx.control.action.Actionprotected org.controlsfx.control.action.Actionprotected org.controlsfx.control.action.Actionprotected org.controlsfx.control.action.Actionprotected org.controlsfx.control.action.Actionprotected org.controlsfx.control.action.Actionprotected org.controlsfx.control.action.Actionprotected org.controlsfx.control.action.Actionprotected org.controlsfx.control.action.Actionprotected org.controlsfx.control.action.Actionprotected BooleanPropertyprotected org.controlsfx.control.action.Actionprotected org.controlsfx.control.action.Action -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNewScript(String script, ScriptLanguage language, boolean doSelect) Create a new script in the specified language.protected ReadOnlyObjectProperty<ScriptLanguage>protected ReadOnlyObjectProperty<ScriptSyntax>protected static StringgetClipboardText(boolean escapeCharacters) protected ScriptEditorControl<? extends Region>protected ScriptEditorControl<? extends Region>protected ScriptLanguageGets the value of the property currentLanguage.protected ScriptTabprotected ScriptSyntaxGets the value of the property currentSyntax.protected Stringprotected ScriptEditorControl<?>protected ScriptEditorControl<?>protected StringgetStage()Get the stage for this script editor.protected static booleanpasteFromClipboard(ScriptEditorControl<?> control, boolean escapeCharacters) protected voidUpdate the font size for the script editor and console.Observable value indicating whether a script is currently running or not.protected ObservableBooleanValueBoolean property indicating whether the console should display the log, rather than directly-printed information.voidShow the script editor.voidshowScript(File file) Show the script editor, opening an existing script file.voidshowScript(String name, String script) Show the script editor, including a new script with the specified name.booleansupportsFile(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.
-
-
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:
supportsFilein 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
- See Also:
-
currentSyntaxProperty
- See Also:
-
getCurrentLanguage
Gets the value of the property currentLanguage.- Property description:
-
getCurrentSyntax
Gets the value of the property currentSyntax.- Property description:
-
getCurrentScriptTab
-
getCurrentEditorControl
-
getCurrentConsoleControl
-
getSelectedText
-
getCurrentText
-
sendLogToConsoleProperty
Boolean property indicating whether the console should display the log, rather than directly-printed information. -
getClipboardText
-
pasteFromClipboard
protected static boolean pasteFromClipboard(ScriptEditorControl<?> control, boolean escapeCharacters) -
showEditor
public void showEditor()Description copied from interface:ScriptEditorShow the script editor.- Specified by:
showEditorin interfaceScriptEditor
-
showScript
Description copied from interface:ScriptEditorShow the script editor, including a new script with the specified name.- Specified by:
showScriptin interfaceScriptEditor- Parameters:
name- name of the script to showscript- content of the script
-
showScript
Description copied from interface:ScriptEditorShow the script editor, opening an existing script file.- Specified by:
showScriptin interfaceScriptEditor- Parameters:
file- the script file
-