public class RSyntaxTextAreaHighlighter extends BasicTextUI.BasicHighlighter
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.
Modifier and Type | Class and Description |
---|---|
static interface |
RSyntaxTextAreaHighlighter.HighlightInfo |
DefaultHighlighter.DefaultHighlightPainter
LayeredHighlighter.LayerPainter
Highlighter.Highlight, Highlighter.HighlightPainter
DefaultPainter
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(JTextComponent c) |
List<DocumentRange> |
getMarkedOccurrences()
Returns a list of "marked occurrences" in the text area.
|
void |
install(JTextComponent c) |
void |
paint(Graphics g)
Renders the highlights.
|
void |
paintLayeredHighlights(Graphics g,
int p0,
int p1,
Shape viewBounds,
JTextComponent editor,
View view)
When leaf Views (such as LabelView) are rendering they should
call into this method.
|
addHighlight, changeHighlight, getDrawsLayeredHighlights, getHighlights, removeAllHighlights, removeHighlight, setDrawsLayeredHighlights
public void clearParserHighlights(Parser parser)
parser
- The parser.public void deinstall(JTextComponent c)
deinstall
in interface Highlighter
deinstall
in class DefaultHighlighter
public List<DocumentRange> getMarkedOccurrences()
DocumentRange
.public void install(JTextComponent c)
install
in interface Highlighter
install
in class DefaultHighlighter
public void paint(Graphics g)
paint
in interface Highlighter
paint
in class DefaultHighlighter
g
- the graphics contextpublic void paintLayeredHighlights(Graphics g, int p0, int p1, Shape viewBounds, JTextComponent editor, View view)
paintLayeredHighlights
in class DefaultHighlighter
g
- Graphics used to drawp0
- starting offset of viewp1
- ending offset of viewviewBounds
- Bounds of Vieweditor
- JTextComponentview
- View instance being rendered