Package org.eclipse.jface.text.source
Class Annotation
java.lang.Object
org.eclipse.jface.text.source.Annotation
- Direct Known Subclasses:
AbstractInlinedAnnotation,AnnotationBag,DefaultRangeIndicator,ProjectionAnnotation,SimpleMarkerAnnotation,SpellingAnnotation
Annotation managed by an
IAnnotationModel.
Annotations are typed, can have an 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".
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates 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. -
Method Summary
Modifier and TypeMethodDescriptiongetText()Returns the text associated with this annotation.getType()Returns the type of the annotation.booleanReturns whether this annotation is marked as deleted.booleanReturns whether this annotation is persistent.voidmarkDeleted(boolean deleted) Marks this annotation deleted according to the value of thedeletedparameter.voidSets the text associated with this annotation.voidSets the type of this annotation.
-
Field Details
-
TYPE_UNKNOWN
Constant for unknown annotation types.Value:
"org.eclipse.text.annotation.unknown"- Since:
- 3.0
- See Also:
-
-
Constructor Details
-
Annotation
protected Annotation()Creates a new annotation that is not persistent and type less. -
Annotation
Creates a new annotation with the given properties.- Parameters:
type- the unique name of this annotation typeisPersistent-trueif this annotation is persistent,falseotherwisetext- the text associated with this annotation- Since:
- 3.0
-
Annotation
public Annotation(boolean isPersistent) Creates a new annotation with the given persistence state.- Parameters:
isPersistent-trueif persistent,falseotherwise- Since:
- 3.0
-
-
Method Details
-
isPersistent
public boolean isPersistent()Returns whether this annotation is persistent.- Returns:
trueif this annotation is persistent,falseotherwise- Since:
- 3.0
-
setType
Sets the type of this annotation.- Parameters:
type- the annotation type- Since:
- 3.0
-
getType
Returns the type of the annotation.- Returns:
- the type of the annotation
- Since:
- 3.0
-
markDeleted
public void markDeleted(boolean deleted) Marks this annotation deleted according to the value of thedeletedparameter.- Parameters:
deleted-trueif annotation should be marked as deleted- Since:
- 3.0
-
isMarkedDeleted
public boolean isMarkedDeleted()Returns whether this annotation is marked as deleted.- Returns:
trueif annotation is marked as deleted,falseotherwise- Since:
- 3.0
-
setText
Sets the text associated with this annotation.- Parameters:
text- the text associated with this annotation- Since:
- 3.0
-
getText
Returns the text associated with this annotation.- Returns:
- the text associated with this annotation or
null - Since:
- 3.0
-