public class AnnotationModelEvent extends Object
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.
IAnnotationModel
,
IAnnotationModelListenerExtension
Constructor and Description |
---|
AnnotationModelEvent(IAnnotationModel model)
Creates a new annotation model event for the given model.
|
AnnotationModelEvent(IAnnotationModel model,
boolean isWorldChange)
Creates a new annotation model event for the given model.
|
Modifier and Type | Method and Description |
---|---|
void |
annotationAdded(Annotation annotation)
Adds the given annotation to the set of annotations that are reported as
being added from the model.
|
void |
annotationChanged(Annotation annotation)
Adds the given annotation to the set of annotations that are reported as
being changed from the model.
|
void |
annotationRemoved(Annotation annotation)
Adds the given annotation to the set of annotations that are reported as
being removed from the model.
|
void |
annotationRemoved(Annotation annotation,
Position position)
Adds the given annotation to the set of annotations that are reported as
being removed from the model.
|
Annotation[] |
getAddedAnnotations()
Returns the added annotations.
|
IAnnotationModel |
getAnnotationModel()
Returns the model this event refers to.
|
Annotation[] |
getChangedAnnotations()
Returns the changed annotations.
|
Position |
getPositionOfRemovedAnnotation(Annotation annotation)
Returns the position of the removed annotation at that point in time
when the annotation has been removed.
|
Annotation[] |
getRemovedAnnotations()
Returns the removed annotations.
|
boolean |
isEmpty()
Returns whether this annotation model event is empty or not.
|
boolean |
isValid()
Returns whether this annotation model event is still valid.
|
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.
|
void |
markSealed()
Seals this event.
|
public AnnotationModelEvent(IAnnotationModel model)
model
- the modelpublic AnnotationModelEvent(IAnnotationModel model, boolean isWorldChange)
model
- the modelisWorldChange
- true
if world changepublic IAnnotationModel getAnnotationModel()
public void annotationAdded(Annotation annotation)
annotation
- the added annotationpublic Annotation[] getAddedAnnotations()
public void annotationRemoved(Annotation annotation)
annotation
- the removed annotationpublic void annotationRemoved(Annotation annotation, Position position)
annotation
- the removed annotationposition
- the position of the removed annotationpublic Annotation[] getRemovedAnnotations()
public Position getPositionOfRemovedAnnotation(Annotation annotation)
annotation
- the removed annotationnull
public void annotationChanged(Annotation annotation)
annotation
- the changed annotationpublic Annotation[] getChangedAnnotations()
public boolean isEmpty()
false
although the event does not carry any added, removed, or changed
annotations.true
if this event is emptypublic boolean isWorldChange()
true
if world change, false
otherwisepublic boolean isValid()
true
if this event is still valid, false
otherwisepublic void markSealed()
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.