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

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

public 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

public void removeAnnotation(Annotation annotation)
Removal of added annotation.
Parameters:
annotation - annotation which is going to be removed


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