public class Annotation extends Object
IAnnotationModel.
Annotations are types, associated text, and can be marked as persistent and
deleted. Annotations which are not explicitly initialized with an annotation
type are of type "org.eclipse.text.annotation.unknown".
| Modifier and Type | Field and Description |
|---|---|
static String |
TYPE_UNKNOWN
Constant for unknown annotation types.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Annotation()
Creates a new annotation that is not persistent and type less.
|
|
Annotation(boolean isPersistent)
Creates a new annotation with the given persistence state.
|
|
Annotation(String type,
boolean isPersistent,
String text)
Creates a new annotation with the given properties.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getText()
Returns the text associated with this annotation.
|
String |
getType()
Returns the type of the annotation.
|
boolean |
isMarkedDeleted()
Returns whether this annotation is marked as deleted.
|
boolean |
isPersistent()
Returns whether this annotation is persistent.
|
void |
markDeleted(boolean deleted)
Marks this annotation deleted according to the value of the
deleted parameter. |
void |
setText(String text)
Sets the text associated with this annotation.
|
void |
setType(String type)
Sets the type of this annotation.
|
public static final String TYPE_UNKNOWN
Value: "org.eclipse.text.annotation.unknown"
protected Annotation()
public Annotation(String type, boolean isPersistent, String text)
type - the type of this annotationisPersistent - true if this annotation is
persistent, false otherwisetext - the text associated with this annotationpublic Annotation(boolean isPersistent)
isPersistent - true if persistent, false otherwisepublic boolean isPersistent()
true if this annotation is persistent, false
otherwisepublic void setType(String type)
type - the annotation typepublic String getType()
public void markDeleted(boolean deleted)
deleted parameter.deleted - true if annotation should be marked as deletedpublic boolean isMarkedDeleted()
true if annotation is marked as deleted, false
otherwisepublic void setText(String text)
text - the text associated with this annotationpublic String getText()
nullGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.