org.netbeans.modules.editor.lib2/1 1.43.1 10

org.netbeans.spi.editor.highlighting
Interface HighlightAttributeValue<T>


public interface HighlightAttributeValue<T>

Lazy evaluator for attribute values. It is up to each particular attribute to declare if its values can be lazily evaluated. Attributes that declare themselvs as supporting lazy evaluation can have their values specified either directly or through HighlightAttributeValue. All users of such an attribute must check for both the direct value and the lazy evaluator and use them accordingly.

If an attribute supports lazy evaluation the result of getValue call should have the same type as if the attribute value were specified directly. For example, the EditorStyleConstants.Tooltip attribute supports lazy evaluation and its value can either be String or HighlightAttributeValue<String>.

Since:
1.5

Method Summary
 T getValue(JTextComponent component, Document document, Object attributeKey, int startOffset, int endOffset)
          Gets value of an attribute.
 

Method Detail

getValue

T getValue(JTextComponent component,
           Document document,
           Object attributeKey,
           int startOffset,
           int endOffset)
Gets value of an attribute.

Parameters:
component - The text component, which highlighting layer supplied a highlight with an attribute using this evaluator as its value.
document - The document, which highlighting layer supplied a highlight with an attribute using this evaluator as its value.
attributeKey - The key of the attribute.
startOffset - The start offset of the original highlight or any other offset inside the highlight. Always less than endOffset.
endOffset - The end offset of the original highlight or any other offset inside the highlight. Always greater than startOffset.
Returns:
The value of the attributeKey attribute.

org.netbeans.modules.editor.lib2/1 1.43.1 10

Built on December 5 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.