@Override protected CompositeRuler createCompositeRuler() { annotationAccess = new AnnotationMarkerAccess(); IAnnotationModel annotationModel = getDocumentProvider().getAnnotationModel(getEditorInput()); AnnotationRulerColumn annotationRulerCol = new AnnotationRulerColumn(annotationModel, 16, annotationAccess); annotationRulerCol.addAnnotationType(AlternativeAnnotation.ALTERNATIVE_TYPE); CompositeRuler compositeRuler = new CompositeRuler(); compositeRuler.setModel(annotationModel); compositeRuler.addDecorator(0, annotationRulerCol); return compositeRuler; }
/* * @see org.eclipse.jface.text.source.AnnotationRulerColumn#setModel(org.eclipse.jface.text.source.IAnnotationModel) */ public void setModel(IAnnotationModel model) { if (model instanceof IAnnotationModelExtension) { IAnnotationModelExtension extension = (IAnnotationModelExtension) model; model = extension.getAnnotationModel(ProjectionSupport.PROJECTION); } super.setModel(model); }
@SuppressWarnings("unchecked") protected IVerticalRuler createCompositeRuler() { CompositeRuler ruler = new CompositeRuler(); ruler.addDecorator(0, new AnnotationRulerColumn(VERTICAL_RULER_WIDTH, getAnnotationAccess())); for (Iterator iter = ruler.getDecoratorIterator(); iter.hasNext(); ) { IVerticalRulerColumn col = (IVerticalRulerColumn) iter.next(); if (col instanceof AnnotationRulerColumn) { AnnotationRulerColumn column = (AnnotationRulerColumn) col; for (Iterator iter2 = fAnnotationPreferences.getAnnotationPreferences().iterator(); iter2.hasNext(); ) { AnnotationPreference preference = (AnnotationPreference) iter2.next(); column.addAnnotationType(preference.getAnnotationType()); } column.addAnnotationType(Annotation.TYPE_UNKNOWN); break; } } return ruler; }