Package qupath.lib.gui.scripting.syntax
Interface ScriptSyntax
public interface ScriptSyntax
Interface for classes that apply some syntax formatting to an
EditableText.- Since:
- v0.4.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringBeautifies the specified text, according to the syntax.default booleandefault booleandefault StringCompresses the specified text by removing extra space, according to the syntax.Get a set of the scripting languages supported by this syntax.default StringGet the String that represents the start of a comment line.default StringString to insert when tab key presseddefault booleanhandleBackspace(EditableText control, boolean smartEditing) Handle a backspace.default voidhandleLeftParenthesis(EditableText control, boolean smartEditing) Handle left parentheses(.default voidhandleLineComment(EditableText control) Handle line comments.default voidhandleNewLine(EditableText control, boolean smartEditing) Handle a new line.default voidhandleQuotes(EditableText control, boolean isDoubleQuote, boolean smartEditing) Handle single/double quotes.default voidhandleRightParenthesis(EditableText control, boolean smartEditing) Handle right parentheses).default voidhandleTabPress(EditableText control, boolean shiftDown) Handle tab key.
-
Method Details
-
getLanguageNames
Get a set of the scripting languages supported by this syntax.- Returns:
-
getTabString
String to insert when tab key pressed- Returns:
-
getLineCommentString
Get the String that represents the start of a comment line.- Returns:
- comment string
-
handleLeftParenthesis
Handle left parentheses(.- Parameters:
control- the text/code areasmartEditing- whether smart editing is enabled
-
handleRightParenthesis
Handle right parentheses).- Parameters:
control- the text/code areasmartEditing- whether smart editing is enabled
-
handleQuotes
Handle single/double quotes.- Parameters:
control- the text/code areaisDoubleQuote- whether the input is single/double quotessmartEditing- whether smart editing is enabled
-
handleLineComment
Handle line comments.- Parameters:
control- the text/code area
-
handleNewLine
Handle a new line.- Parameters:
control- the text/code areasmartEditing- whether smart editing is enabled
-
handleBackspace
Handle a backspace.- Parameters:
control-smartEditing- whether smart editing is enabled- Returns:
- whether the source event should be consumed; if this returns false then backspace is handled elsewhere
-
handleTabPress
Handle tab key.- Parameters:
control- the text/code areashiftDown-
-
beautify
Beautifies the specified text, according to the syntax.- Parameters:
text- the text to beautify- Returns:
- beautified text
-
canBeautify
default boolean canBeautify()- Returns:
-
compress
Compresses the specified text by removing extra space, according to the syntax.- Parameters:
text- the text to compress- Returns:
- beautified text
-
canCompress
default boolean canCompress()- Returns:
-