Package org.fife.ui.rtextarea
Class LineHighlightManager
java.lang.Object
org.fife.ui.rtextarea.LineHighlightManager
Manages line highlights in an
RTextArea
.- Version:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
Information about a line highlight.private static class
Comparator used when adding new highlights. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddLineHighlight
(int line, Color color) Highlights the specified line.Returns the current line highlights' tags.protected int
Returns the current number of line highlights.void
Paints any highlighted lines in the specified line range.void
Removes all line highlights.void
Removes a line highlight.private void
Repaints the line pointed to by the specified highlight information.
-
Field Details
-
textArea
-
lineHighlights
-
comparator
-
-
Constructor Details
-
LineHighlightManager
LineHighlightManager(RTextArea textArea) Constructor.- Parameters:
textArea
- The parent text area.
-
-
Method Details
-
addLineHighlight
Highlights the specified line.- Parameters:
line
- The line to highlight.color
- The color to highlight with.- Returns:
- A tag for the highlight.
- Throws:
BadLocationException
- Ifline
is not a valid line number.- See Also:
-
getCurrentLineHighlightTags
Returns the current line highlights' tags.- Returns:
- The current line highlights' tags, or an empty list if there are none.
-
getLineHighlightCount
protected int getLineHighlightCount()Returns the current number of line highlights. Useful for testing.- Returns:
- The current number of line highlights.
-
paintLineHighlights
Paints any highlighted lines in the specified line range.- Parameters:
g
- The graphics context.
-
removeAllLineHighlights
public void removeAllLineHighlights()Removes all line highlights.- See Also:
-
removeLineHighlight
Removes a line highlight.- Parameters:
tag
- The tag of the line highlight to remove.- See Also:
-
repaintLine
Repaints the line pointed to by the specified highlight information.- Parameters:
lhi
- The highlight information.
-