|Modifier and Type||Field and Description|
The attribute key for highlights that need to show up on empty lines.
The attribute key for highlights that need to span across a whole line.
|Modifier and Type||Method and Description|
Adds a listener to this highlights container.
Provides the list of highlighted areas that should be used for rendering a document.
Removes a listener from this highlights container.
static final String ATTR_EXTENDS_EOL
Typically highlights only affect rendering of a small part of text (perhaps just several characters). Some layers, however, need to highlight a whole line in an editor window regardless of how much text the line contains. The highlighting of a line with a caret is an example of such a layer.
If you want a highlight that spans accross the whole editor pane you
can add this attribute key to the highlight's
and set its value to
Boolean.TRUE. The highlighted area must
contain the new-line character at the end of the line.
static final String ATTR_EXTENDS_EMPTY_LINE
If you use this key for a highlight which contains the new-line character
at the end of an empty line and set the value of this attribute to
Boolean.TRUE then the highlight will be drawn as
a half-character-wide stripe at the beginning of the line.
HighlightsSequence getHighlights(int startOffset, int endOffset)
The returned highlighted areas (highlights) must obey the following rules:
endOffsetparameters. Any highlights outside of this range will be clipped by the rendering infrastructure.
The editor infrastructure will log any problems it may encounter with provided implementations of this interface. Although the infrastructure will try to do its best to render all highlights supplied by the implementors, if the above rules are violated the results can't be garanteed.
startOffset- The starting offset of the area which the caller attempts to repaint (or create views for). The staring offset is always >=0.
endOffset- The ending offset of the rendered area. The
Integer.MAX_VALUEcan be passed in if the end offset is unknown to the caller. The highlights container is then expected to return all highlights up to the end of the document.
void addHighlightsChangeListener(HighlightsChangeListener listener)
listener- The listener to add.
void removeHighlightsChangeListener(HighlightsChangeListener listener)
listener- The listener to remove.
Built on February 27 2017. | Portions Copyright 1997-2017 Oracle. All rights reserved.