Class SyntaxToken
java.lang.Object
com.codename1.ui.editor.SyntaxToken
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
FieldsModifier and TypeFieldDescriptionstatic final intStandard semantic kind for a comment.final intExplicit dark-theme RGB color, or -1 to use the palette color forkind.static final intStandard semantic kind for a language keyword.final intSemantic kind, usually one of the constants in this class.final intLength of the highlighted range.final intExplicit light-theme RGB color, or -1 to use the palette color forkind.static final intStandard semantic kind for a numeric literal.static final intStandard semantic kind for a property or attribute name.final intZero-based start column.static final intStandard semantic kind for a string or character literal.static final intStandard semantic kind for a tag or declared type. -
Constructor Summary
ConstructorsConstructorDescriptionSyntaxToken(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
-
Field Details
-
KEYWORD
public static final int KEYWORDStandard semantic kind for a language keyword.- See Also:
-
STRING
public static final int STRINGStandard semantic kind for a string or character literal.- See Also:
-
COMMENT
public static final int COMMENTStandard semantic kind for a comment.- See Also:
-
NUMBER
public static final int NUMBERStandard semantic kind for a numeric literal.- See Also:
-
TYPE
public static final int TYPEStandard semantic kind for a tag or declared type.- See Also:
-
PROPERTY
public static final int PROPERTYStandard semantic kind for a property or attribute name.- See Also:
-
start
public final int startZero-based start column. -
length
public final int lengthLength of the highlighted range. -
kind
public final int kindSemantic kind, usually one of the constants in this class. -
lightColor
public final int lightColorExplicit light-theme RGB color, or -1 to use the palette color forkind. -
darkColor
public final int darkColorExplicit dark-theme RGB color, or -1 to use the palette color forkind.
-
-
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.
-