Interface ScriptSyntax


public interface ScriptSyntax
Interface for classes that apply some syntax formatting to an EditableText.
Since:
v0.4.0
Author:
Melvin Gelbard, Pete Bankhead
  • Method Details

    • getLanguageNames

      Set<String> getLanguageNames()
      Get a set of the scripting languages supported by this syntax.
      Returns:
    • getTabString

      default String getTabString()
      String to insert when tab key pressed
      Returns:
    • getLineCommentString

      default String getLineCommentString()
      Get the String that represents the start of a comment line.
      Returns:
      comment string
    • handleLeftParenthesis

      default void handleLeftParenthesis(EditableText control, boolean smartEditing)
      Handle left parentheses (.
      Parameters:
      control - the text/code area
      smartEditing - whether smart editing is enabled
    • handleRightParenthesis

      default void handleRightParenthesis(EditableText control, boolean smartEditing)
      Handle right parentheses ).
      Parameters:
      control - the text/code area
      smartEditing - whether smart editing is enabled
    • handleQuotes

      default void handleQuotes(EditableText control, boolean isDoubleQuote, boolean smartEditing)
      Handle single/double quotes.
      Parameters:
      control - the text/code area
      isDoubleQuote - whether the input is single/double quotes
      smartEditing - whether smart editing is enabled
    • handleLineComment

      default void handleLineComment(EditableText control)
      Handle line comments.
      Parameters:
      control - the text/code area
    • handleNewLine

      default void handleNewLine(EditableText control, boolean smartEditing)
      Handle a new line.
      Parameters:
      control - the text/code area
      smartEditing - whether smart editing is enabled
    • handleBackspace

      default boolean handleBackspace(EditableText control, boolean smartEditing)
      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

      default void handleTabPress(EditableText control, boolean shiftDown)
      Handle tab key.
      Parameters:
      control - the text/code area
      shiftDown -
    • beautify

      default String beautify(String text)
      Beautifies the specified text, according to the syntax.
      Parameters:
      text - the text to beautify
      Returns:
      beautified text
    • canBeautify

      default boolean canBeautify()
      Returns true if beautify(String) is capable of beautifying the text, false otherwise.
      Returns:
    • compress

      default String compress(String text)
      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 true if compress(String) is capable of compressing the text, false otherwise.
      Returns: