Class LexerBasedHighlighter
- java.lang.Object
-
- net.sourceforge.pmd.util.fxdesigner.util.codearea.LexerBasedHighlighter
-
- All Implemented Interfaces:
SyntaxHighlighter
- Direct Known Subclasses:
ScalaSyntaxHighlighter
public abstract class LexerBasedHighlighter extends Object implements SyntaxHighlighter
Language-specific engine for syntax highlighting.- Since:
- 6.19.0
- Author:
- Clément Fournier
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
LexerBasedHighlighter.JflexLexer
Generated lexers should implement this interface.
-
Constructor Summary
Constructors Modifier Constructor Description protected
LexerBasedHighlighter(String languageName)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description org.fxmisc.richtext.model.StyleSpans<Collection<String>>
computeHighlighting(String text)
Computes the syntax highlighting on the given text.String
getLanguageTerseName()
Gets the terse name of the language this highlighter cares for.protected abstract LexerBasedHighlighter.JflexLexer
newLexer(String text, Set<String> baseClasses)
-
-
-
Constructor Detail
-
LexerBasedHighlighter
protected LexerBasedHighlighter(String languageName)
-
-
Method Detail
-
newLexer
protected abstract LexerBasedHighlighter.JflexLexer newLexer(String text, Set<String> baseClasses)
-
computeHighlighting
public org.fxmisc.richtext.model.StyleSpans<Collection<String>> computeHighlighting(String text)
Description copied from interface:SyntaxHighlighter
Computes the syntax highlighting on the given text. The returned spans are exactly the length of the given text.- Specified by:
computeHighlighting
in interfaceSyntaxHighlighter
- Parameters:
text
- The text- Returns:
- The computed style spans
-
getLanguageTerseName
public final String getLanguageTerseName()
Description copied from interface:SyntaxHighlighter
Gets the terse name of the language this highlighter cares for. That's used as a css class for text regions.- Specified by:
getLanguageTerseName
in interfaceSyntaxHighlighter
- Returns:
- The terse name of the language
-
-