@Override protected void doSetInput(IEditorInput input) throws CoreException { ISourceViewer sourceViewer = getSourceViewer(); if (!(sourceViewer instanceof ISourceViewerExtension2)) { setPreferenceStore(createCombinedPreferenceStore(input)); internalDoSetInput(input); return; } // uninstall & unregister preference store listener getSourceViewerDecorationSupport(sourceViewer).uninstall(); ((ISourceViewerExtension2) sourceViewer).unconfigure(); setPreferenceStore(createCombinedPreferenceStore(input)); // install & register preference store listener sourceViewer.configure(getSourceViewerConfiguration()); getSourceViewerDecorationSupport(sourceViewer).install(getPreferenceStore()); internalDoSetInput(input); }
@Override protected void doSetInput(IEditorInput input) throws CoreException { ISourceViewer sourceViewer= getSourceViewer(); if (!(sourceViewer instanceof ISourceViewerExtension2)) { setPreferenceStore(createCombinedPreferenceStore(input)); internalDoSetInput(input); return; } // uninstall & unregister preference store listener getSourceViewerDecorationSupport(sourceViewer).uninstall(); ((ISourceViewerExtension2)sourceViewer).unconfigure(); setPreferenceStore(createCombinedPreferenceStore(input)); // install & register preference store listener sourceViewer.configure(getSourceViewerConfiguration()); getSourceViewerDecorationSupport(sourceViewer).install(getPreferenceStore()); internalDoSetInput(input); }
public void handleColorSettingsChanged() { // done like in TextEditor for spelling ISourceViewer viewer = getSourceViewer(); SourceViewerConfiguration configuration = getSourceViewerConfiguration(); if (viewer instanceof ISourceViewerExtension2) { ISourceViewerExtension2 viewerExtension2 = (ISourceViewerExtension2) viewer; viewerExtension2.unconfigure(); if (configuration instanceof BatchSourceViewerConfiguration) { BatchSourceViewerConfiguration gconf = (BatchSourceViewerConfiguration) configuration; gconf.updateTextScannerDefaultColorToken(); } viewer.configure(configuration); } }
public void handleColorSettingsChanged() { // done like in TextEditor for spelling ISourceViewer viewer = getSourceViewer(); SourceViewerConfiguration configuration = getSourceViewerConfiguration(); if (viewer instanceof ISourceViewerExtension2) { ISourceViewerExtension2 viewerExtension2 = (ISourceViewerExtension2) viewer; viewerExtension2.unconfigure(); if (configuration instanceof BashSourceViewerConfiguration) { BashSourceViewerConfiguration gconf = (BashSourceViewerConfiguration) configuration; gconf.updateTextScannerDefaultColorToken(); } viewer.configure(configuration); } }
public void handleColorSettingsChanged() { // done like in TextEditor for spelling ISourceViewer viewer = getSourceViewer(); SourceViewerConfiguration configuration = getSourceViewerConfiguration(); if (viewer instanceof ISourceViewerExtension2) { ISourceViewerExtension2 viewerExtension2 = (ISourceViewerExtension2) viewer; viewerExtension2.unconfigure(); if (configuration instanceof ExtendedSourceViewerConfiguration) { ExtendedSourceViewerConfiguration gconf = (ExtendedSourceViewerConfiguration) configuration; gconf.updateTextScannerDefaultColorToken(); } viewer.configure(configuration); } }
private IAnnotationModel getAnnotationModel(ISourceViewer viewer) { if (viewer instanceof ISourceViewerExtension2) { ISourceViewerExtension2 extension = (ISourceViewerExtension2) viewer; return extension.getVisualAnnotationModel(); } return viewer.getAnnotationModel(); }
private @Nullable IAnnotationModel getAnnotationModel(ISourceViewer viewer) { if (viewer instanceof ISourceViewerExtension2) { ISourceViewerExtension2 extension= (ISourceViewerExtension2) viewer; return extension.getVisualAnnotationModel(); } return viewer.getAnnotationModel(); }