Search in sources :

Example 1 with IProjectionListener

use of org.eclipse.jface.text.source.projection.IProjectionListener in project mylyn.docs by eclipse.

the class MarkupEditor method createPartControl.

@Override
public void createPartControl(Composite parent) {
    super.createPartControl(parent);
    ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
    // default font returned by the token scanner
    if (sourceViewerConfiguration.getDefaultFont() != null) {
        viewer.getTextWidget().setFont(sourceViewerConfiguration.getDefaultFont());
    }
    projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors());
    projectionSupport.install();
    syncProjectionModeWithPreferences();
    viewer.addProjectionListener(new IProjectionListener() {

        public void projectionDisabled() {
            projectionAnnotationById = null;
            saveProjectionPreferences();
        }

        public void projectionEnabled() {
            saveProjectionPreferences();
            updateProjectionAnnotations();
        }
    });
    if (!outlineDirty && isFoldingEnabled()) {
        updateProjectionAnnotations();
    }
    JFaceResources.getFontRegistry().addListener(preferencesListener);
}
Also used : ProjectionSupport(org.eclipse.jface.text.source.projection.ProjectionSupport) IProjectionListener(org.eclipse.jface.text.source.projection.IProjectionListener) ProjectionViewer(org.eclipse.jface.text.source.projection.ProjectionViewer)

Aggregations

IProjectionListener (org.eclipse.jface.text.source.projection.IProjectionListener)1 ProjectionSupport (org.eclipse.jface.text.source.projection.ProjectionSupport)1 ProjectionViewer (org.eclipse.jface.text.source.projection.ProjectionViewer)1