Interface ScriptStyler

All Known Implementing Classes:
GroovyStyler, 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
Author:
Melvin Gelbard, Pete Bankhead
  • Method Summary

    Modifier and Type
    Method
    Description
    default org.fxmisc.richtext.model.StyleSpans<Collection<String>>
    computeConsoleStyles(String text, boolean logConsole)
    Compute styling for the specified text, considering it will be used in the console.
    org.fxmisc.richtext.model.StyleSpans<Collection<String>>
    Compute styling for the specified text, considering it will be used in the main editor.
    default String
    Optionally return a base style for the code area.
    Get a set of the scripting languages supported by this styler.
  • Method Details

    • getLanguageNames

      Set<String> 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 ScriptLanguage for QuPath to automatically apply it to the script editor when needed.

      Returns:
    • computeEditorStyles

      org.fxmisc.richtext.model.StyleSpans<Collection<String>> computeEditorStyles(String text)
      Compute styling for the specified text, considering it will be used in the main editor.
      Parameters:
      text - the text to process styling for
      Returns:
      stylespans the StyleSpans to apply
    • computeConsoleStyles

      default org.fxmisc.richtext.model.StyleSpans<Collection<String>> computeConsoleStyles(String text, boolean logConsole)
      Compute styling for the specified text, considering it will be used in the console.
      Parameters:
      text - the text to process styling for
      logConsole - if true, the console prints to the log rather than directly
      Returns:
      stylespans the StyleSpans to apply
    • getBaseStyle

      default String 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: