当前页面:
在线文档首页 >
NetBeans API Javadoc 5.5.1
NbDocument.Annotatable (NetBeans Text API) - NetBeans API Javadoc 5.5.1
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
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
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 textlength
- length of the annotated text. If -1 is specified
the whole line will be annotatedannotation
- 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