@Override public void setRangeIndication(int start, int length, boolean moveCursor) { if (moveCursor) { setSelectedRange(start, 0); revealRange(start, length); } if (fRangeIndicator != null && fVisualAnnotationModel instanceof IAnnotationModelExtension) { IAnnotationModelExtension extension= (IAnnotationModelExtension) fVisualAnnotationModel; extension.modifyAnnotationPosition(fRangeIndicator, new Position(start, length)); } }
@Override public void setRangeIndication(int start, int length, boolean moveCursor) { if (moveCursor) { setSelectedRange(start, 0); revealRange(start, length); } if (fRangeIndicator != null && fVisualAnnotationModel instanceof IAnnotationModelExtension) { IAnnotationModelExtension extension= (IAnnotationModelExtension) fVisualAnnotationModel; extension.modifyAnnotationPosition(fRangeIndicator, new Position(start, length)); } }
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); } } }
/** * Updated annotation. * * @param annotations the annotations */ @Override public void updatedAnnotation(Collection<AnnotationFS> annotations) { IAnnotationModelExtension annotationModel = (IAnnotationModelExtension) getDocumentProvider().getAnnotationModel(getEditorInput()); for (AnnotationFS annotation : annotations) { annotationModel.modifyAnnotationPosition(new EclipseAnnotationPeer(annotation), new Position(annotation.getBegin(), annotation.getEnd() - annotation.getBegin())); } selectionChanged(getSite().getPage().getActivePart(), mFeatureStructureSelectionProvider.getSelection()); }