public class RSyntaxTextAreaHighlighter extends RTextAreaHighlighter
RSyntaxTextAreas. It knows to
always paint "marked occurrences" highlights below selection highlights,
and squiggle underline highlights above all other highlights.Most of this code is copied from javax.swing.text.DefaultHighlighter; unfortunately, we cannot re-use much of it since it is package private.
RTextAreaHighlighter.HighlightInfo, RTextAreaHighlighter.HighlightInfoImpl, RTextAreaHighlighter.LayeredHighlightInfo, RTextAreaHighlighter.LayeredHighlightInfoImpljavax.swing.text.DefaultHighlighter.DefaultHighlightPaintertextArea| Constructor and Description |
|---|
RSyntaxTextAreaHighlighter()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearParserHighlights(Parser parser)
Removes all of the highlights for a specific parser.
|
void |
deinstall(javax.swing.text.JTextComponent c) |
java.util.List<DocumentRange> |
getMarkedOccurrences()
Returns a list of "marked occurrences" in the text area.
|
void |
paintLayeredHighlights(java.awt.Graphics g,
int lineStart,
int lineEnd,
java.awt.Shape viewBounds,
javax.swing.text.JTextComponent editor,
javax.swing.text.View view)
Paints the "marked occurrences" highlights, then any other standard
layered highlights (e.g.
|
void |
paintParserHighlights(java.awt.Graphics g,
int lineStart,
int lineEnd,
java.awt.Shape viewBounds,
javax.swing.text.JTextComponent editor,
javax.swing.text.View view)
Paints any highlights from
Parsers. |
getMarkAllHighlightCount, getMarkAllHighlightRanges, install, paintListLayered, repaintListHighlightpublic void clearParserHighlights(Parser parser)
parser - The parser.public void deinstall(javax.swing.text.JTextComponent c)
deinstall in interface javax.swing.text.Highlighterdeinstall in class RTextAreaHighlighterpublic java.util.List<DocumentRange> getMarkedOccurrences()
DocumentRange.public void paintLayeredHighlights(java.awt.Graphics g,
int lineStart,
int lineEnd,
java.awt.Shape viewBounds,
javax.swing.text.JTextComponent editor,
javax.swing.text.View view)
paintLayeredHighlights in class RTextAreaHighlighterg - The graphics context.lineStart - The starting offset of the line.lineEnd - The end offset of the line.viewBounds - The bounds of the view.editor - The parent text component.view - The view instance being rendered.paintParserHighlights(Graphics, int, int, Shape, JTextComponent, View)public void paintParserHighlights(java.awt.Graphics g,
int lineStart,
int lineEnd,
java.awt.Shape viewBounds,
javax.swing.text.JTextComponent editor,
javax.swing.text.View view)
Parsers.g - The graphics context.lineStart - The starting offset of the line.lineEnd - The end offset of the line.viewBounds - The bounds of the view.editor - The parent text component.view - The view instance being rendered.paintLayeredHighlights(Graphics, int, int, Shape, JTextComponent, View)