Class RSyntaxTextAreaHighlighter
java.lang.Object
javax.swing.text.LayeredHighlighter
javax.swing.text.DefaultHighlighter
javax.swing.plaf.basic.BasicTextUI.BasicHighlighter
org.fife.ui.rtextarea.RTextAreaHighlighter
org.fife.ui.rsyntaxtextarea.RSyntaxTextAreaHighlighter
- All Implemented Interfaces:
UIResource, Highlighter
The highlighter implementation used by
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.
- Version:
- 1.0
- Author:
- Robert Futrell
-
Nested Class Summary
Nested classes/interfaces inherited from class RTextAreaHighlighter
RTextAreaHighlighter.HighlightInfo, RTextAreaHighlighter.HighlightInfoImpl, RTextAreaHighlighter.LayeredHighlightInfo, RTextAreaHighlighter.LayeredHighlightInfoImplNested classes/interfaces inherited from class DefaultHighlighter
DefaultHighlighter.DefaultHighlightPainterNested classes/interfaces inherited from class LayeredHighlighter
LayeredHighlighter.LayerPainterNested classes/interfaces inherited from interface Highlighter
Highlighter.Highlight, Highlighter.HighlightPainter -
Field Summary
Fields inherited from class RTextAreaHighlighter
textAreaFields inherited from class DefaultHighlighter
DefaultPainter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclearParserHighlights(Parser parser) Removes all the highlights for a specific parser.voidReturns a list of "marked occurrences" in the text area.voidpaintLayeredHighlights(Graphics g, int lineStart, int lineEnd, Shape viewBounds, JTextComponent editor, View view) Paints the "marked occurrences" highlights, then any other standard layered highlights (e.g. the text selection).voidpaintParserHighlights(Graphics g, int lineStart, int lineEnd, Shape viewBounds, JTextComponent editor, View view) Paints any highlights fromParsers.Methods inherited from class RTextAreaHighlighter
getMarkAllHighlightCount, getMarkAllHighlightRanges, install, paintListLayered, repaintListHighlightMethods inherited from class DefaultHighlighter
addHighlight, changeHighlight, getDrawsLayeredHighlights, getHighlights, paint, removeAllHighlights, removeHighlight, setDrawsLayeredHighlights
-
Constructor Details
-
RSyntaxTextAreaHighlighter
public RSyntaxTextAreaHighlighter()Constructor.
-
-
Method Details
-
clearParserHighlights
Removes all the highlights for a specific parser.- Parameters:
parser- The parser.
-
deinstall
- Specified by:
deinstallin interfaceHighlighter- Overrides:
deinstallin classRTextAreaHighlighter
-
getMarkedOccurrences
Returns a list of "marked occurrences" in the text area. If there are no marked occurrences, this will be an empty list.- Returns:
- The list of marked occurrences, or an empty list if none. The
contents of this list will be of type
DocumentRange.
-
paintLayeredHighlights
public void paintLayeredHighlights(Graphics g, int lineStart, int lineEnd, Shape viewBounds, JTextComponent editor, View view) Paints the "marked occurrences" highlights, then any other standard layered highlights (e.g. the text selection).- Overrides:
paintLayeredHighlightsin classRTextAreaHighlighter- Parameters:
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.- See Also:
-
paintParserHighlights
public void paintParserHighlights(Graphics g, int lineStart, int lineEnd, Shape viewBounds, JTextComponent editor, View view) Paints any highlights fromParsers.- Parameters:
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.- See Also:
-