当前页面: 
在线文档首页 > 
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
 
 
 
| 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 | 
 
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