|
Extension SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.javatools.editor.highlight.HighlightedFragmentsList
A HighlightedFragmentsList
is just a list of
HighlightedFragments that we can re-use without having to constantly
reallocate arrays and HighlightedFragment objects. This class is
similar to the StyledFragmentsList
class except that
it applies to HighlightedFragments.
Since this fragments list is typically used for rendering text highlights, it will take care of resolving priority levels of highlights as they are added to the list. This means highlights can be added to the list out of order (both in terms of offsets as well as priority levels), relieving the view and renderers from the responsibility of having to manually sort through the highlights.
Note, unlike the StyledFragmentsList
, fragments added
to this list are not required to be adjacent regions of text.
Constructor Summary | |
HighlightedFragmentsList()
Constructs a new HighlightedFragmentList with an initial size of the default. |
Method Summary | |
void |
add(HighlightStyle highlightStyle,
int startOffset,
int endOffset)
Adds the given fragment to the list, accounting for priority and offsets so that the list is always sorted in increasing offsets with higher priority highlights displacing lower priority ones. |
void |
addSentinel(HighlightStyle highlightStyle)
Adds a final sentinel fragment. |
void |
clear()
Discards all fragments from the list. |
HighlightedFragment |
get(int index)
Get the fragment at the specified index. |
HighlightStyle |
getSentinel()
Fetch the final sentinel style if any. |
void |
setHighlightRegistry(HighlightRegistry registry)
Set the HighlightRegistry used by this list when
building up its list of highlight fragments. |
int |
size()
Returns the size of the list (number of fragments.) |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HighlightedFragmentsList()
Method Detail |
public void setHighlightRegistry(HighlightRegistry registry)
HighlightRegistry
used by this list when
building up its list of highlight fragments.
public void addSentinel(HighlightStyle highlightStyle)
highlightStyle
- the highlight stylepublic HighlightStyle getSentinel()
public void add(HighlightStyle highlightStyle, int startOffset, int endOffset)
highlightStyle
- the highlight stylestartOffset
- the starting offset of the highlightendOffset
- the ending offset of the highlightpublic void clear()
public int size()
public HighlightedFragment get(int index)
index
- the index of the fragment to retrieve
|
Extension SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright ©1997, 2003, Oracle. All rights reserved.