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

NbDocument.Annotatable (NetBeans Text API) - NetBeans API Javadoc 5.0.0

 

org.openide.text
Interface NbDocument.Annotatable

All Superinterfaces:
Document
Enclosing interface:
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

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 May 3 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.