Interface ScriptStyler
- All Known Implementing Classes:
GroovyStyler,ImageJMacroStyler,JavaStyler,JsonStyler,MarkdownStyler,PlainStyler,PropertiesStyler,PythonStyler,XmlStyler,YamlStyler
public interface ScriptStyler
Interface for classes that apply some styling to a RichTextFX's
CodeArea.- Since:
- v0.4.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault org.fxmisc.richtext.model.StyleSpans<Collection<String>> computeConsoleStyles(String text, boolean logConsole) Compute styling for the specifiedtext, considering it will be used in the console.org.fxmisc.richtext.model.StyleSpans<Collection<String>> computeEditorStyles(String text) Compute styling for the specifiedtext, considering it will be used in the main editor.default StringOptionally return a base style for the code area.Get a set of the scripting languages supported by this styler.
-
Method Details
-
getLanguageNames
Get a set of the scripting languages supported by this styler.Note: One of the names returned by this method must match exactly (but case-insensitive) that of the corresponding
ScriptLanguagefor QuPath to automatically apply it to the script editor when needed.- Returns:
-
computeEditorStyles
Compute styling for the specifiedtext, considering it will be used in the main editor.- Parameters:
text- the text to process styling for- Returns:
- stylespans the
StyleSpansto apply
-
computeConsoleStyles
default org.fxmisc.richtext.model.StyleSpans<Collection<String>> computeConsoleStyles(String text, boolean logConsole) Compute styling for the specifiedtext, considering it will be used in the console.- Parameters:
text- the text to process styling forlogConsole- if true, the console prints to the log rather than directly- Returns:
- stylespans the
StyleSpansto apply
-
getBaseStyle
Optionally return a base style for the code area. The default is to return null, but one use is to return "-fx-font-family: sans-serif" if the language should not be formatted as code.- Returns:
-