Java 类org.eclipse.jface.text.source.ISourceViewerExtension2 实例源码

项目:typescript.java    文件:JavaScriptLightWeightEditor.java   
@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);
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaEditor.java   
@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);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaEditor.java   
@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);
}
项目:eclipse-batch-editor    文件:BatchEditor.java   
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);
    }
}
项目:eclipse-bash-editor    文件:BashEditor.java   
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);
    }
}
项目:egradle    文件:AbstractGroovyBasedEditor.java   
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);
    }
}
项目:APICloud-Studio    文件:CommonAnnotationHover.java   
private IAnnotationModel getAnnotationModel(ISourceViewer viewer)
{
    if (viewer instanceof ISourceViewerExtension2)
    {
        ISourceViewerExtension2 extension = (ISourceViewerExtension2) viewer;
        return extension.getVisualAnnotationModel();
    }
    return viewer.getAnnotationModel();
}
项目:rustyeclipse    文件:RustTextHover.java   
private @Nullable IAnnotationModel getAnnotationModel(ISourceViewer viewer) {
    if (viewer instanceof ISourceViewerExtension2) {
        ISourceViewerExtension2 extension= (ISourceViewerExtension2) viewer;
        return extension.getVisualAnnotationModel();
    }
    return viewer.getAnnotationModel();
}