站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

HighlightsSequence (Editor Library 2) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor.lib2/1 1.3 2

org.netbeans.spi.editor.highlighting
Interface HighlightsSequence


public interface HighlightsSequence

An iterator through highlights in a HighlightsContainer.

Implementation: Any HighlightsSequence obtained from any of the classes in the Highlighting API will behave as so called fast-fail iterator. It means that it will throw ConcurrentModificationException from its methods if the underlying data (highlights) have changed since when the instance of the HighlightsSequence was obtained.


Field Summary
static HighlightsSequence EMPTY
          An empty HighlightsSequence.
 
Method Summary
 AttributeSet getAttributes()
          Gets the set of attributes that define how to render a current highlight.
 int getEndOffset()
          Gets the end offset of a current highlight.
 int getStartOffset()
          Gets the start offset of a current highlight.
 boolean moveNext()
          Moves the internal pointer to the next highlight in this sequence (if there is any).
 

Field Detail

EMPTY

static final HighlightsSequence EMPTY
An empty HighlightsSequence.

Method Detail

moveNext

boolean moveNext()
Moves the internal pointer to the next highlight in this sequence (if there is any). If this method returns true highlight's boundaries and attributes can be retrieved by calling the getter methods.

Returns:
true If there is a highlight available and it is safe to call the getters.
Throws:
ConcurrentModificationException - If the highlights this sequence is iterating through have been changed since the creation of the sequence.

getStartOffset

int getStartOffset()
Gets the start offset of a current highlight.

Returns:
The offset in a document where the current highlight starts.
Throws:
ConcurrentModificationException - If the highlights this sequence is iterating through have been changed since the creation of the sequence.

getEndOffset

int getEndOffset()
Gets the end offset of a current highlight.

Returns:
The offset in a document where the current highlight ends.
Throws:
ConcurrentModificationException - If the highlights this sequence is iterating through have been changed since the creation of the sequence.

getAttributes

AttributeSet getAttributes()
Gets the set of attributes that define how to render a current highlight.

Since the AttributeSet can contain any attributes implementors must be aware of whether the attributes returned from this method affect metrics or not and set the isFixedSize parameter appropriately when createing HighlightsLayers.

Returns:
The set of text rendering attributes. Must not return null.
Throws:
ConcurrentModificationException - If the highlights this sequence is iterating through have been changed since the creation of the sequence.
See Also:
HighlightsLayer

org.netbeans.modules.editor.lib2/1 1.3 2

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.