Package qupath.lib.gui.scripting
Interface ScriptEditorControl<T extends Region>
- Type Parameters:
- T- the tile of component used for display
- All Superinterfaces:
- EditableText,- TextAppendable
- All Known Implementing Classes:
- CodeAreaControl,- TextAreaControl
Basic script editor control using JavaFX.
 The reason for its existence is to enable custom script editors to be implemented that provide additional functionality 
 (e.g. syntax highlighting), but do not rely upon subclassing any specific JavaFX control.
 
Note: This is rather cumbersome, and may be removed in the future if the script editor design is revised.
- 
Property SummaryPropertiesTypePropertyDescriptionProperty for the current caret position.Text currently selected in the editor control.Text currently in the editor control.Request wordwrap.
- 
Method SummaryModifier and TypeMethodDescriptionProperty for the current caret position.voidcopy()Request copy the current selection.voidcut()Request cut the current selection.Get the context menu for the control.default ScriptLanguageGet any language stored for text to be displayed by this control.Get the region representing this control, so it may be added to a scene.Get the range of the currently-selected text.default intGet the ending position for any selection (exclusive).default intGet the starting position for any selection (inclusive).booleanReturns true if 'redo' can be applied to the control.booleanReturns true if 'undo' can be applied to the control.voidpaste()Request paste from the system clipboard.voidredo()Request redo.default voidRequest that the control is focused.default voidRequest that the X and Y scrolls are adjusted to ensure the caret is visible.Text currently selected in the editor control.voidsetContextMenu(ContextMenu menu) Set the context menu for the control.default voidsetLanguage(ScriptLanguage language) Set the language for text to be displayed by this control.Text currently in the editor control.voidundo()Request undo.Request wordwrap.Methods inherited from interface qupath.lib.gui.scripting.EditableTextappendText, clear, deleteText, deselect, getCaretPosition, getSelectedText, getSelectionLength, getText, insertText, positionCaret, replaceSelection, selectRange, setTextMethods inherited from interface qupath.lib.gui.logging.TextAppendableappendText
- 
Property Details- 
textStringProperty textPropertyText currently in the editor control.- See Also:
 
- 
selectedTextObservableValue<String> selectedTextPropertyText currently selected in the editor control.- See Also:
 
- 
wrapTextBooleanProperty wrapTextPropertyRequest wordwrap.- See Also:
 
- 
caretPositionReadOnlyIntegerProperty caretPositionPropertyProperty for the current caret position.- See Also:
 
 
- 
- 
Method Details- 
textPropertyStringProperty textProperty()Text currently in the editor control.- Returns:
 
- 
getSelectionIndexRange getSelection()Get the range of the currently-selected text.- Returns:
 
- 
getSelectionStartdefault int getSelectionStart()Description copied from interface:EditableTextGet the starting position for any selection (inclusive).- Specified by:
- getSelectionStartin interface- EditableText
- Returns:
 
- 
getSelectionEnddefault int getSelectionEnd()Description copied from interface:EditableTextGet the ending position for any selection (exclusive). If this is equal to or less thanEditableText.getSelectionStart()this means there is no selection.- Specified by:
- getSelectionEndin interface- EditableText
- Returns:
 
- 
pastevoid paste()Request paste from the system clipboard.
- 
selectedTextPropertyObservableValue<String> selectedTextProperty()Text currently selected in the editor control.- Returns:
 
- 
isUndoableboolean isUndoable()Returns true if 'undo' can be applied to the control.- Returns:
 
- 
isRedoableboolean isRedoable()Returns true if 'redo' can be applied to the control.- Returns:
 
- 
getRegionT getRegion()Get the region representing this control, so it may be added to a scene.- Returns:
 
- 
undovoid undo()Request undo.
- 
redovoid redo()Request redo.
- 
copyvoid copy()Request copy the current selection.
- 
cutvoid cut()Request cut the current selection.
- 
wrapTextPropertyBooleanProperty wrapTextProperty()Request wordwrap.- Returns:
 
- 
requestFollowCaretdefault void requestFollowCaret()Request that the X and Y scrolls are adjusted to ensure the caret is visible.This method does nothing by default. This means that a class extending this interface must specifically implement this method if a different behavior is expected. 
- 
caretPositionPropertyReadOnlyIntegerProperty caretPositionProperty()Property for the current caret position.- Returns:
 
- 
setContextMenuSet the context menu for the control.- Parameters:
- menu-
 
- 
getContextMenuContextMenu getContextMenu()Get the context menu for the control.- Returns:
 
- 
requestFocusdefault void requestFocus()Request that the control is focused.
- 
setLanguageSet the language for text to be displayed by this control.The default implementation does nothing. Implementing classes may choose to change the control's behavior based on the language. - Parameters:
- language-
 
- 
getLanguageGet any language stored for text to be displayed by this control.The default implementation always returns null. Implementing classes may choose to store any set language, and modify the control's behavior accordingly. - Returns:
 
 
-