Class SyntaxToken

java.lang.Object
com.codename1.ui.editor.SyntaxToken

public final class SyntaxToken extends Object
One highlighted source span. Third-party highlighters may use a standard semantic kind or provide explicit colors without depending on the built-in tokenizer implementation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Standard semantic kind for a comment.
    final int
    Explicit dark-theme RGB color, or -1 to use the palette color for kind.
    static final int
    Standard semantic kind for a language keyword.
    final int
    Semantic kind, usually one of the constants in this class.
    final int
    Length of the highlighted range.
    final int
    Explicit light-theme RGB color, or -1 to use the palette color for kind.
    static final int
    Standard semantic kind for a numeric literal.
    static final int
    Standard semantic kind for a property or attribute name.
    final int
    Zero-based start column.
    static final int
    Standard semantic kind for a string or character literal.
    static final int
    Standard semantic kind for a tag or declared type.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SyntaxToken(int start, int length, int kind)
    Creates a token that uses the editor palette for its semantic kind.
    SyntaxToken(int start, int length, int kind, int lightColor, int darkColor)
    Creates a token with explicit light and dark theme colors.
  • Method Summary

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • KEYWORD

      public static final int KEYWORD
      Standard semantic kind for a language keyword.
      See Also:
    • STRING

      public static final int STRING
      Standard semantic kind for a string or character literal.
      See Also:
    • COMMENT

      public static final int COMMENT
      Standard semantic kind for a comment.
      See Also:
    • NUMBER

      public static final int NUMBER
      Standard semantic kind for a numeric literal.
      See Also:
    • TYPE

      public static final int TYPE
      Standard semantic kind for a tag or declared type.
      See Also:
    • PROPERTY

      public static final int PROPERTY
      Standard semantic kind for a property or attribute name.
      See Also:
    • start

      public final int start
      Zero-based start column.
    • length

      public final int length
      Length of the highlighted range.
    • kind

      public final int kind
      Semantic kind, usually one of the constants in this class.
    • lightColor

      public final int lightColor
      Explicit light-theme RGB color, or -1 to use the palette color for kind.
    • darkColor

      public final int darkColor
      Explicit dark-theme RGB color, or -1 to use the palette color for kind.
  • Constructor Details

    • SyntaxToken

      public SyntaxToken(int start, int length, int kind)
      Creates a token that uses the editor palette for its semantic kind.
    • SyntaxToken

      public SyntaxToken(int start, int length, int kind, int lightColor, int darkColor)
      Creates a token with explicit light and dark theme colors.