Class LanguageDef

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

public final class LanguageDef extends Object
Describes the lexical rules of a programming language for the pure code editor's tokenizer: its keyword set, comment styles, string delimiters and number syntax. The keyword lists match the ones the previous BrowserComponent highlighter used.
  • Method Details

    • isPlain

      public boolean isPlain()
      True for plain text (no syntax highlighting at all).
    • isKeyword

      public boolean isKeyword(String word)
      True when word is a keyword in this language.
    • hasLineCommentSlash

      public boolean hasLineCommentSlash()
      True when // starts a line comment.
    • hasLineCommentHash

      public boolean hasLineCommentHash()
      True when # starts a line comment.
    • hasBlockComment

      public boolean hasBlockComment()
      True when /* */ block comments are supported.
    • hasTemplateString

      public boolean hasTemplateString()
      True when backtick template strings (which may span lines) are supported.
    • forName

      public static LanguageDef forName(String language)
      Returns the language definition for the given language id, defaulting to a plain text definition (no highlighting) for unknown ids.