use of org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess in project tdi-studio-se by Talend.
the class TalendJavaSourceViewer method initializeViewer.
private static ReconcilerViewer initializeViewer(Composite composite, int styles, boolean checkCode, IDocument document, int visibleOffset) {
IAnnotationAccess annotationAccess = new DefaultMarkerAnnotationAccess();
ISharedTextColors sharedColors = JavaPlugin.getDefault().getJavaTextTools().getColorManager();
IOverviewRuler overviewRuler = null;
IVerticalRuler verticalRuler = null;
if (checkCode) {
overviewRuler = new OverviewRuler(annotationAccess, 12, sharedColors);
Iterator e = EditorsPlugin.getDefault().getMarkerAnnotationPreferences().getAnnotationPreferences().iterator();
while (e.hasNext()) {
AnnotationPreference preference = (AnnotationPreference) e.next();
if (preference.contributesToHeader()) {
overviewRuler.addHeaderAnnotationType(preference.getAnnotationType());
}
}
}
verticalRuler = new CompositeRuler(12);
ReconcilerViewer viewer = new TalendJavaSourceViewer(composite, verticalRuler, overviewRuler, checkCode, styles, annotationAccess, sharedColors, checkCode, document);
if (visibleOffset != -1) {
viewer.setVisibleRegion(visibleOffset, 0);
}
return viewer;
}
Aggregations