org.openide.text 6.9.22

org.openide.text
Interface NbDocument.Annotatable

All Superinterfaces:
Document
Enclosing class:
NbDocument

public static interface NbDocument.Annotatable
extends Document

Enhanced version of document which is capable of attaching/detaching of annotations. It is guaranteed that annotations are added/removed to document only in AWT thread.

Since:
1.20

Field Summary
 
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Method Summary
 void addAnnotation(Position startPos, int length, Annotation annotation)
          Add annotation to the document.
 void removeAnnotation(Annotation annotation)
          Removal of added annotation.
 
Methods inherited from interface javax.swing.text.Document
addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, insertString, putProperty, remove, removeDocumentListener, removeUndoableEditListener, render
 

Method Detail

addAnnotation

void addAnnotation(Position startPos,
                   int length,
                   Annotation annotation)
Add annotation to the document. For annotation of whole line the length parameter can be ignored (specify value -1).

Parameters:
startPos - position which represent begining of the annotated text
length - length of the annotated text. If -1 is specified the whole line will be annotated
annotation - annotation which is attached to this text

removeAnnotation

void removeAnnotation(Annotation annotation)
Removal of added annotation.

Parameters:
annotation - annotation which is going to be removed

org.openide.text 6.9.22

Built on July 11 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.