public class CodeEditorHighlighter
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CodeEditorHighlighter.Highlight
Represents a highlight on a line which encompass the entire line.
|
static class |
CodeEditorHighlighter.HighlightZone
Represents a highlight on a zone in a line.
|
static class |
CodeEditorHighlighter.ZoneHighlight
Represents a highlight on a line which can encompass several zones on the line.
|
Constructor and Description |
---|
CodeEditorHighlighter()
Constructor.
|
CodeEditorHighlighter(boolean absolute)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
append(int line,
java.awt.Color color)
Add a highlight for a specified line number.
|
void |
append(int line,
java.awt.Color color,
int startOffset,
int endOffset)
Add a highlight for a specified line number and offset.
|
void |
clear()
Clear all highlights.
|
int |
count()
Return the number of highlights.
|
java.awt.Color |
getColor(int line)
Return the highlight color for a specified line number.
|
CodeEditorHighlighter.Highlight |
getHighlight(int line)
Return the highlight for a specified line number.
|
java.util.Map<java.lang.Integer,CodeEditorHighlighter.Highlight> |
getHighlights()
Return the highlights.
|
boolean |
hasHighlight(int line)
Return if there is a highlight on a line.
|
boolean |
isAbsolute()
Return true if the highlighter uses absolute line numbers to paint lines.
|
boolean |
removeHighlight(int line)
Remove a highlight.
|
public CodeEditorHighlighter()
public CodeEditorHighlighter(boolean absolute)
absolute
- true if the highlighter uses absolute line numbers to paint linespublic boolean isAbsolute()
public void append(int line, java.awt.Color color)
line
- the line numbercolor
- the highlight colorpublic void append(int line, java.awt.Color color, int startOffset, int endOffset)
line
- the line numbercolor
- the highlight colorstartOffset
- the start offsetendOffset
- the end offsetpublic boolean removeHighlight(int line)
line
- the line numberpublic void clear()
public java.util.Map<java.lang.Integer,CodeEditorHighlighter.Highlight> getHighlights()
public boolean hasHighlight(int line)
line
- the line numberpublic java.awt.Color getColor(int line)
line
- the line numberpublic CodeEditorHighlighter.Highlight getHighlight(int line)
line
- the line numberpublic int count()
Copyright © 2016, 2017, 2018, 2019, 2023 Herve Girod. All Rights Reserved. Documentation and source under the MIT licence