Package org.eclipse.jface.text.source
Class AnnotationModelEvent
java.lang.Object
org.eclipse.jface.text.source.AnnotationModelEvent
Specification of changes applied to annotation models. The event carries the
 changed annotation model as well as added, removed, and modified annotations.
 
An event can be sealed. Afterwards it can not be modified. Thus, the normal process is that an empty event is created, filled with the changed information, and before it is sent to the listeners, the event is sealed.
- Since:
- 2.0
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a new annotation model event for the given model.AnnotationModelEvent(IAnnotationModel model, boolean isWorldChange) Creates a new annotation model event for the given model.
- 
Method SummaryModifier and TypeMethodDescriptionvoidannotationAdded(Annotation annotation) Adds the given annotation to the set of annotations that are reported as being added from the model.voidannotationChanged(Annotation annotation) Adds the given annotation to the set of annotations that are reported as being changed from the model.voidannotationRemoved(Annotation annotation) Adds the given annotation to the set of annotations that are reported as being removed from the model.voidannotationRemoved(Annotation annotation, Position position) Adds the given annotation to the set of annotations that are reported as being removed from the model.Returns the added annotations.Returns the model this event refers to.Returns the changed annotations.getPositionOfRemovedAnnotation(Annotation annotation) Returns the position of the removed annotation at that point in time when the annotation has been removed.Returns the removed annotations.booleanisEmpty()Returns whether this annotation model event is empty or not.booleanisValid()Returns whether this annotation model event is still valid.booleanReturns whether this annotation model events contains detailed information about the modifications applied to the event annotation model or whether it represents a world change.voidSeals this event.
- 
Constructor Details- 
AnnotationModelEventCreates a new annotation model event for the given model.- Parameters:
- model- the model
 
- 
AnnotationModelEventCreates a new annotation model event for the given model.- Parameters:
- model- the model
- isWorldChange-- trueif world change
- Since:
- 3.0
 
 
- 
- 
Method Details- 
getAnnotationModelReturns the model this event refers to.- Returns:
- the model this events belongs to
 
- 
annotationAddedAdds the given annotation to the set of annotations that are reported as being added from the model. If this event is considered a world change, it is no longer so after this method has successfully finished.- Parameters:
- annotation- the added annotation
- Since:
- 3.0
 
- 
getAddedAnnotationsReturns the added annotations.- Returns:
- the added annotations
- Since:
- 3.0
 
- 
annotationRemovedAdds the given annotation to the set of annotations that are reported as being removed from the model. If this event is considered a world change, it is no longer so after this method has successfully finished.- Parameters:
- annotation- the removed annotation
- Since:
- 3.0
 
- 
annotationRemovedAdds the given annotation to the set of annotations that are reported as being removed from the model. If this event is considered a world change, it is no longer so after this method has successfully finished.- Parameters:
- annotation- the removed annotation
- position- the position of the removed annotation
- Since:
- 3.0
 
- 
getRemovedAnnotationsReturns the removed annotations.- Returns:
- the removed annotations
- Since:
- 3.0
 
- 
getPositionOfRemovedAnnotationReturns the position of the removed annotation at that point in time when the annotation has been removed.- Parameters:
- annotation- the removed annotation
- Returns:
- the position of the removed annotation or null
- Since:
- 3.0
 
- 
annotationChangedAdds the given annotation to the set of annotations that are reported as being changed from the model. If this event is considered a world change, it is no longer so after this method has successfully finished.- Parameters:
- annotation- the changed annotation
- Since:
- 3.0
 
- 
getChangedAnnotationsReturns the changed annotations.- Returns:
- the changed annotations
- Since:
- 3.0
 
- 
isEmptypublic boolean isEmpty()Returns whether this annotation model event is empty or not. If this event represents a world change, this method returnsfalsealthough the event does not carry any added, removed, or changed annotations.- Returns:
- trueif this event is empty
- Since:
- 3.0
 
- 
isWorldChangepublic boolean isWorldChange()Returns whether this annotation model events contains detailed information about the modifications applied to the event annotation model or whether it represents a world change. I.e. everything in the model might have changed.- Returns:
- trueif world change,- falseotherwise
- Since:
- 3.0
 
- 
isValidpublic boolean isValid()Returns whether this annotation model event is still valid.- Returns:
- trueif this event is still valid,- falseotherwise
- Since:
- 3.0
 
- 
markSealedpublic void markSealed()Seals this event. Any direct modification to the annotation model after the event has been sealed invalidates this event.- Since:
- 3.0
 
 
-