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);
}
Aggregations