Search in sources :

Example 1 with XtextResourceMarkerAnnotationModel

use of org.eclipse.xtext.ui.editor.quickfix.XtextResourceMarkerAnnotationModel in project xtext-eclipse by eclipse.

the class AnnotationIssueProcessor method announceAnnotationChanged.

protected void announceAnnotationChanged(Annotation annotation) {
    if (annotationModel instanceof XtextResourceMarkerAnnotationModel)
        ((XtextResourceMarkerAnnotationModel) annotationModel).fireAnnotationChangedEvent(annotation);
    else {
        Position position = annotationModel.getPosition(annotation);
        if (annotationModel instanceof IAnnotationModelExtension)
            ((IAnnotationModelExtension) annotationModel).modifyAnnotationPosition(annotation, position);
        else {
            annotationModel.removeAnnotation(annotation);
            annotationModel.addAnnotation(annotation, position);
        }
    }
}
Also used : Position(org.eclipse.jface.text.Position) XtextResourceMarkerAnnotationModel(org.eclipse.xtext.ui.editor.quickfix.XtextResourceMarkerAnnotationModel) IAnnotationModelExtension(org.eclipse.jface.text.source.IAnnotationModelExtension)

Aggregations

Position (org.eclipse.jface.text.Position)1 IAnnotationModelExtension (org.eclipse.jface.text.source.IAnnotationModelExtension)1 XtextResourceMarkerAnnotationModel (org.eclipse.xtext.ui.editor.quickfix.XtextResourceMarkerAnnotationModel)1