*/
public void endMessages() {
IAnnotationModel model = fEditor.getDocumentProvider()
.getAnnotationModel(fEditor.getEditorInput());
if (model instanceof IAnnotationModelExtension) {
IAnnotationModelExtension modelExt = (IAnnotationModelExtension) model;
Annotation[] oldAnnotations = fAnnotations
.toArray(new Annotation[fAnnotations.size()]);
Map<Annotation, Position> newAnnotations = new HashMap<Annotation, Position>(
fMessages.size());
for (PositionedMessage pm : fMessages) {
Annotation anno = new Annotation(fAnnotationType, false,
pm.message);
newAnnotations.put(anno, pm.pos);
fAnnotations.add(anno);
}
modelExt.replaceAnnotations(oldAnnotations, newAnnotations);
} else {
for (Iterator i = model.getAnnotationIterator(); i.hasNext();) {
Annotation a = (Annotation) i.next();
if (a.getType().equals(fAnnotationType)) {