Search in sources :

Example 1 with IOverviewRuler

use of org.eclipse.jface.text.source.IOverviewRuler 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;
}
Also used : IOverviewRuler(org.eclipse.jface.text.source.IOverviewRuler) ISharedTextColors(org.eclipse.jface.text.source.ISharedTextColors) DefaultMarkerAnnotationAccess(org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess) IAnnotationAccess(org.eclipse.jface.text.source.IAnnotationAccess) IVerticalRuler(org.eclipse.jface.text.source.IVerticalRuler) Iterator(java.util.Iterator) OverviewRuler(org.eclipse.jface.text.source.OverviewRuler) IOverviewRuler(org.eclipse.jface.text.source.IOverviewRuler) CompositeRuler(org.eclipse.jface.text.source.CompositeRuler) AnnotationPreference(org.eclipse.ui.texteditor.AnnotationPreference) ReconcilerViewer(org.talend.designer.core.ui.viewer.ReconcilerViewer)

Aggregations

Iterator (java.util.Iterator)1 CompositeRuler (org.eclipse.jface.text.source.CompositeRuler)1 IAnnotationAccess (org.eclipse.jface.text.source.IAnnotationAccess)1 IOverviewRuler (org.eclipse.jface.text.source.IOverviewRuler)1 ISharedTextColors (org.eclipse.jface.text.source.ISharedTextColors)1 IVerticalRuler (org.eclipse.jface.text.source.IVerticalRuler)1 OverviewRuler (org.eclipse.jface.text.source.OverviewRuler)1 AnnotationPreference (org.eclipse.ui.texteditor.AnnotationPreference)1 DefaultMarkerAnnotationAccess (org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess)1 ReconcilerViewer (org.talend.designer.core.ui.viewer.ReconcilerViewer)1