@Override public void setDocument(IDocument document, IAnnotationModel annotationModel, int modelRangeOffset, int modelRangeLength) { disposeVisualAnnotationModel(); if (annotationModel != null && document != null) { fVisualAnnotationModel= createVisualAnnotationModel(annotationModel); // Make sure the visual model uses the same lock as the underlying model if (annotationModel instanceof ISynchronizable && fVisualAnnotationModel instanceof ISynchronizable) { ISynchronizable sync= (ISynchronizable)fVisualAnnotationModel; sync.setLockObject(((ISynchronizable)annotationModel).getLockObject()); } fVisualAnnotationModel.connect(document); } if (modelRangeOffset == -1 && modelRangeLength == -1) super.setDocument(document); else super.setDocument(document, modelRangeOffset, modelRangeLength); if (fVerticalRuler != null) fVerticalRuler.setModel(fVisualAnnotationModel); if (fOverviewRuler != null) fOverviewRuler.setModel(fVisualAnnotationModel); }
@Override public void setDocument(IDocument document, IAnnotationModel annotationModel, int modelRangeOffset, int modelRangeLength) { disposeVisualAnnotationModel(); if (annotationModel != null && document != null) { fVisualAnnotationModel= createVisualAnnotationModel(annotationModel); // Make sure the visual model uses the same lock as the underlying model if (annotationModel instanceof ISynchronizable && fVisualAnnotationModel instanceof ISynchronizable) { ISynchronizable sync= (ISynchronizable)fVisualAnnotationModel; sync.setLockObject(((ISynchronizable)annotationModel).getLockObject()); } fVisualAnnotationModel.connect(document); } if (modelRangeOffset == -1 && modelRangeLength == -1) super.setDocument(document); else super.setDocument(document, modelRangeOffset, modelRangeLength); if (fVerticalRuler != null) fVerticalRuler.setModel(fVisualAnnotationModel); if (fOverviewRuler != null) fOverviewRuler.setModel(fVisualAnnotationModel); }