public class RSyntaxTextAreaHighlighter extends RTextAreaHighlighter
RSyntaxTextArea
s. 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.LayeredHighlightInfoImpl
javax.swing.text.DefaultHighlighter.DefaultHighlightPainter
textArea
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)
When leaf Views (such as LabelView) are rendering they should
call into this method.
|
getMarkAllHighlightCount, getMarkAllHighlightRanges, install, paintListLayered, repaintListHighlight
public void clearParserHighlights(Parser parser)
parser
- The parser.public void deinstall(javax.swing.text.JTextComponent c)
deinstall
in interface javax.swing.text.Highlighter
deinstall
in class RTextAreaHighlighter
public 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)
RTextAreaHighlighter
paintLayeredHighlights
in class RTextAreaHighlighter
g
- Graphics used to drawlineStart
- starting offset of viewlineEnd
- ending offset of viewviewBounds
- Bounds of Vieweditor
- JTextComponentview
- View instance being rendered