Java 类org.eclipse.ui.texteditor.spelling.SpellingService 实例源码

项目:texlipse    文件:TexSourceViewerConfiguration.java   
/**
 * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getReconciler(org.eclipse.jface.text.source.ISourceViewer)
 */
@Override
public IReconciler getReconciler(ISourceViewer sourceViewer) {
    if (fPreferenceStore == null || !fPreferenceStore.getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED))
        return null;
    if (!TexlipsePlugin.getDefault().getPreferenceStore().getBoolean(TexlipseProperties.ECLIPSE_BUILDIN_SPELLCHECKER))
        return null;
    //Set TeXlipse spelling Engine as default
    PreferenceStore store = new PreferenceStore();
    store.setValue(SpellingService.PREFERENCE_SPELLING_ENGINE, 
            "org.eclipse.texlipse.LaTeXSpellEngine");
    store.setValue(SpellingService.PREFERENCE_SPELLING_ENABLED, 
    true);
    SpellingService spellingService = new SpellingService(store);
    if (spellingService.getActiveSpellingEngineDescriptor(store) == null)
        return null;
    IReconcilingStrategy strategy= new TeXSpellingReconcileStrategy(sourceViewer, spellingService);

    MonoReconciler reconciler= new MonoReconciler(strategy, true);
    reconciler.setDelay(500);
    reconciler.setProgressMonitor(new NullProgressMonitor());
    return reconciler;
}
项目:Eclipse-Postfix-Code-Completion    文件:PropertiesFileSourceViewerConfiguration.java   
@Override
public IReconciler getReconciler(ISourceViewer sourceViewer) {
    if (!EditorsUI.getPreferenceStore().getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED))
        return null;

    IReconcilingStrategy strategy= new SpellingReconcileStrategy(sourceViewer, EditorsUI.getSpellingService()) {
        @Override
        protected IContentType getContentType() {
            return PROPERTIES_CONTENT_TYPE;
        }
    };

    MonoReconciler reconciler= new MonoReconciler(strategy, false);
    reconciler.setDelay(500);
    return reconciler;
}
项目:Eclipse-Postfix-Code-Completion    文件:SpellCheckEngine.java   
public final void propertyChange(final PropertyChangeEvent event) {
    if (event.getProperty().equals(PreferenceConstants.SPELLING_LOCALE)) {
        resetSpellChecker();
        return;
    }

    if (event.getProperty().equals(PreferenceConstants.SPELLING_USER_DICTIONARY)) {
        resetUserDictionary();
        return;
    }

    if (event.getProperty().equals(PreferenceConstants.SPELLING_USER_DICTIONARY_ENCODING)) {
        resetUserDictionary();
        return;
    }

    if (event.getProperty().equals(SpellingService.PREFERENCE_SPELLING_ENABLED) && !EditorsUI.getPreferenceStore().getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED)) {
        if (this == fgEngine)
            SpellCheckEngine.shutdownInstance();
        else
            shutdown();
    }
}
项目:editorconfig-eclipse    文件:EditorConfigSourceViewerConfiguration.java   
@Override
public IReconciler getReconciler(ISourceViewer sourceViewer) {
    if (!EditorsUI.getPreferenceStore().getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED))
        return null;

    IReconcilingStrategy strategy = new SpellingReconcileStrategy(sourceViewer, EditorsUI.getSpellingService()) {
        @Override
        protected IContentType getContentType() {
            return EditorConfigTextTools.EDITORCONFIG_CONTENT_TYPE;
        }
    };

    MonoReconciler reconciler = new MonoReconciler(strategy, false);
    reconciler.setDelay(500);
    return reconciler;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:PropertiesFileSourceViewerConfiguration.java   
@Override
public IReconciler getReconciler(ISourceViewer sourceViewer) {
    if (!EditorsUI.getPreferenceStore().getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED))
        return null;

    IReconcilingStrategy strategy= new SpellingReconcileStrategy(sourceViewer, EditorsUI.getSpellingService()) {
        @Override
        protected IContentType getContentType() {
            return PROPERTIES_CONTENT_TYPE;
        }
    };

    MonoReconciler reconciler= new MonoReconciler(strategy, false);
    reconciler.setDelay(500);
    return reconciler;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:SpellCheckEngine.java   
public final void propertyChange(final PropertyChangeEvent event) {
    if (event.getProperty().equals(PreferenceConstants.SPELLING_LOCALE)) {
        resetSpellChecker();
        return;
    }

    if (event.getProperty().equals(PreferenceConstants.SPELLING_USER_DICTIONARY)) {
        resetUserDictionary();
        return;
    }

    if (event.getProperty().equals(PreferenceConstants.SPELLING_USER_DICTIONARY_ENCODING)) {
        resetUserDictionary();
        return;
    }

    if (event.getProperty().equals(SpellingService.PREFERENCE_SPELLING_ENABLED) && !EditorsUI.getPreferenceStore().getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED)) {
        if (this == fgEngine)
            SpellCheckEngine.shutdownInstance();
        else
            shutdown();
    }
}
项目:Pydev    文件:PyEditConfigurationWithoutEditor.java   
@Override
public IReconciler getReconciler(ISourceViewer sourceViewer) {
    if (fPreferenceStore == null || !fPreferenceStore.getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED)) {
        return null;
    }

    SpellingService spellingService = EditorsUI.getSpellingService();
    if (spellingService.getActiveSpellingEngineDescriptor(fPreferenceStore) == null) {
        return null;
    }

    //Overridden (just) to return a PyReconciler!
    IReconcilingStrategy strategy = new PyReconciler(sourceViewer, spellingService);

    MonoReconciler reconciler = new MonoReconciler(strategy, false);
    reconciler.setIsIncrementalReconciler(false);
    reconciler.setProgressMonitor(new NullProgressMonitor());
    reconciler.setDelay(500);
    return reconciler;
}
项目:eclipse.spellchecker    文件:SpellCheckEngine.java   
public final void propertyChange(final PropertyChangeEvent event) {
    if (event.getProperty().equals(PreferenceConstants.SPELLING_LOCALE)) {
        resetSpellChecker();
        return;
    }

    if (event.getProperty().equals(PreferenceConstants.SPELLING_USER_DICTIONARY)) {
        resetUserDictionary();
        return;
    }

    if (event.getProperty().equals(PreferenceConstants.SPELLING_USER_DICTIONARY_ENCODING)) {
        resetUserDictionary();
        return;
    }

    if (event.getProperty().equals(SpellingService.PREFERENCE_SPELLING_ENABLED) && !EditorsUI.getPreferenceStore().getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED)) {
        if (this == fgEngine)
            SpellCheckEngine.shutdownInstance();
        else
            shutdown();
    }
}
项目:DarwinSPL    文件:DwprofileSourceViewerConfiguration.java   
/**
 * <p>
 * Creates a new editor configuration.
 * </p>
 * 
 * @param resourceProvider the provider for the resource (usually this is the
 * editor)
 * @param colorManager the color manager to use
 */
public DwprofileSourceViewerConfiguration(de.darwinspl.preferences.resource.dwprofile.IDwprofileResourceProvider resourceProvider, de.darwinspl.preferences.resource.dwprofile.ui.IDwprofileAnnotationModelProvider annotationModelProvider, de.darwinspl.preferences.resource.dwprofile.ui.DwprofileColorManager colorManager) {
    super(de.darwinspl.preferences.resource.dwprofile.ui.DwprofileUIPlugin.getDefault().getPreferenceStore());
    this.fPreferenceStore.setDefault(SpellingService.PREFERENCE_SPELLING_ENABLED, true);
    this.fPreferenceStore.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH, 4);
    this.fPreferenceStore.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINK_KEY_MODIFIER, Action.findModifierString(SWT.MOD1));
    this.resourceProvider = resourceProvider;
    this.annotationModelProvider = annotationModelProvider;
    this.colorManager = colorManager;
}
项目:DarwinSPL    文件:HyexpressionSourceViewerConfiguration.java   
/**
 * <p>
 * Creates a new editor configuration.
 * </p>
 * 
 * @param resourceProvider the provider for the resource (usually this is the
 * editor)
 * @param colorManager the color manager to use
 */
public HyexpressionSourceViewerConfiguration(eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionResourceProvider resourceProvider, eu.hyvar.feature.expression.resource.hyexpression.ui.IHyexpressionAnnotationModelProvider annotationModelProvider, eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionColorManager colorManager) {
    super(eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionUIPlugin.getDefault().getPreferenceStore());
    this.fPreferenceStore.setDefault(SpellingService.PREFERENCE_SPELLING_ENABLED, true);
    this.fPreferenceStore.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH, 4);
    this.fPreferenceStore.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINK_KEY_MODIFIER, Action.findModifierString(SWT.MOD1));
    this.resourceProvider = resourceProvider;
    this.annotationModelProvider = annotationModelProvider;
    this.colorManager = colorManager;
}
项目:DarwinSPL    文件:HyvalidityformulaSourceViewerConfiguration.java   
/**
 * <p>
 * Creates a new editor configuration.
 * </p>
 * 
 * @param resourceProvider the provider for the resource (usually this is the
 * editor)
 * @param colorManager the color manager to use
 */
public HyvalidityformulaSourceViewerConfiguration(eu.hyvar.context.contextValidity.resource.hyvalidityformula.IHyvalidityformulaResourceProvider resourceProvider, eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.IHyvalidityformulaAnnotationModelProvider annotationModelProvider, eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaColorManager colorManager) {
    super(eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaUIPlugin.getDefault().getPreferenceStore());
    this.fPreferenceStore.setDefault(SpellingService.PREFERENCE_SPELLING_ENABLED, true);
    this.fPreferenceStore.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH, 4);
    this.fPreferenceStore.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINK_KEY_MODIFIER, Action.findModifierString(SWT.MOD1));
    this.resourceProvider = resourceProvider;
    this.annotationModelProvider = annotationModelProvider;
    this.colorManager = colorManager;
}
项目:DarwinSPL    文件:HydatavalueSourceViewerConfiguration.java   
/**
 * <p>
 * Creates a new editor configuration.
 * </p>
 * 
 * @param resourceProvider the provider for the resource (usually this is the
 * editor)
 * @param colorManager the color manager to use
 */
public HydatavalueSourceViewerConfiguration(eu.hyvar.dataValues.resource.hydatavalue.IHydatavalueResourceProvider resourceProvider, eu.hyvar.dataValues.resource.hydatavalue.ui.IHydatavalueAnnotationModelProvider annotationModelProvider, eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueColorManager colorManager) {
    super(eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueUIPlugin.getDefault().getPreferenceStore());
    this.fPreferenceStore.setDefault(SpellingService.PREFERENCE_SPELLING_ENABLED, true);
    this.fPreferenceStore.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH, 4);
    this.fPreferenceStore.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINK_KEY_MODIFIER, Action.findModifierString(SWT.MOD1));
    this.resourceProvider = resourceProvider;
    this.annotationModelProvider = annotationModelProvider;
    this.colorManager = colorManager;
}
项目:DarwinSPL    文件:HymappingSourceViewerConfiguration.java   
/**
 * <p>
 * Creates a new editor configuration.
 * </p>
 * 
 * @param resourceProvider the provider for the resource (usually this is the
 * editor)
 * @param colorManager the color manager to use
 */
public HymappingSourceViewerConfiguration(eu.hyvar.feature.mapping.resource.hymapping.IHymappingResourceProvider resourceProvider, eu.hyvar.feature.mapping.resource.hymapping.ui.IHymappingAnnotationModelProvider annotationModelProvider, eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingColorManager colorManager) {
    super(eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingUIPlugin.getDefault().getPreferenceStore());
    this.fPreferenceStore.setDefault(SpellingService.PREFERENCE_SPELLING_ENABLED, true);
    this.fPreferenceStore.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH, 4);
    this.fPreferenceStore.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINK_KEY_MODIFIER, Action.findModifierString(SWT.MOD1));
    this.resourceProvider = resourceProvider;
    this.annotationModelProvider = annotationModelProvider;
    this.colorManager = colorManager;
}
项目:DarwinSPL    文件:HyconstraintsSourceViewerConfiguration.java   
/**
 * <p>
 * Creates a new editor configuration.
 * </p>
 * 
 * @param resourceProvider the provider for the resource (usually this is the
 * editor)
 * @param colorManager the color manager to use
 */
public HyconstraintsSourceViewerConfiguration(eu.hyvar.feature.constraint.resource.hyconstraints.IHyconstraintsResourceProvider resourceProvider, eu.hyvar.feature.constraint.resource.hyconstraints.ui.IHyconstraintsAnnotationModelProvider annotationModelProvider, eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsColorManager colorManager) {
    super(eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsUIPlugin.getDefault().getPreferenceStore());
    this.fPreferenceStore.setDefault(SpellingService.PREFERENCE_SPELLING_ENABLED, true);
    this.fPreferenceStore.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH, 4);
    this.fPreferenceStore.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINK_KEY_MODIFIER, Action.findModifierString(SWT.MOD1));
    this.resourceProvider = resourceProvider;
    this.annotationModelProvider = annotationModelProvider;
    this.colorManager = colorManager;
}
项目:DarwinSPL    文件:HymanifestSourceViewerConfiguration.java   
/**
 * <p>
 * Creates a new editor configuration.
 * </p>
 * 
 * @param resourceProvider the provider for the resource (usually this is the
 * editor)
 * @param colorManager the color manager to use
 */
public HymanifestSourceViewerConfiguration(eu.hyvar.mspl.manifest.resource.hymanifest.IHymanifestResourceProvider resourceProvider, eu.hyvar.mspl.manifest.resource.hymanifest.ui.IHymanifestAnnotationModelProvider annotationModelProvider, eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestColorManager colorManager) {
    super(eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestUIPlugin.getDefault().getPreferenceStore());
    this.fPreferenceStore.setDefault(SpellingService.PREFERENCE_SPELLING_ENABLED, true);
    this.fPreferenceStore.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH, 4);
    this.fPreferenceStore.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_HYPERLINK_KEY_MODIFIER, Action.findModifierString(SWT.MOD1));
    this.resourceProvider = resourceProvider;
    this.annotationModelProvider = annotationModelProvider;
    this.colorManager = colorManager;
}
项目:texlipse    文件:TeXSpellingReconcileStrategy.java   
/**
 * Creates a new comment reconcile strategy.
 *
 * @param viewer the source viewer
 * @param spellingService the spelling service to use
 */
public TeXSpellingReconcileStrategy(ISourceViewer viewer, SpellingService spellingService) {
    Assert.isNotNull(viewer);
    Assert.isNotNull(spellingService);
    fViewer= viewer;
    fSpellingService= spellingService;
    fSpellingContext= new SpellingContext();
    fSpellingContext.setContentType(getContentType());

}
项目:fluentmark    文件:MkReconcilingStrategy.java   
public IReconcilingStrategy[] getReconcilingStrategies() {
    if (store.getBoolean(Prefs.SPELLING_ENABLED)) {
        SpellingService service = new SpellingService(store);
        if (service.getActiveSpellingEngineDescriptor(store) != null) {
            IReconcilingStrategy spellStrategy = new SpellingReconcileStrategy(viewer, service);
            return new IReconcilingStrategy[] { spellStrategy };
        }
    }
    return new IReconcilingStrategy[] { new NullReconcilingStrategy() };
}
项目:APICloud-Studio    文件:CommonSourceViewerConfiguration.java   
@Override
public IReconciler getReconciler(ISourceViewer sourceViewer)
{
    if (fTextEditor != null && fTextEditor.isEditable())
    {
        IReconcilingStrategy reconcilingStrategy = new CommonReconcilingStrategy(fTextEditor);
        if (EditorsUI.getPreferenceStore().getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED))
        {
            SpellingService spellingService = EditorsUI.getSpellingService();
            Collection<String> spellingContentTypes = getSpellingContentTypes(sourceViewer);
            if (spellingService.getActiveSpellingEngineDescriptor(fPreferenceStore) != null
                    && !spellingContentTypes.isEmpty())
            {
                reconcilingStrategy = new CompositeReconcilingStrategy(reconcilingStrategy,
                        new MultiRegionSpellingReconcileStrategy(sourceViewer, spellingService,
                                getConfiguredDocumentPartitioning(sourceViewer), spellingContentTypes));
            }
        }
        CommonReconciler reconciler = new CommonReconciler(reconcilingStrategy);
        reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
        reconciler.setIsIncrementalReconciler(false);
        reconciler.setIsAllowedToModifyDocument(false);
        reconciler.setProgressMonitor(new NullProgressMonitor());
        reconciler.setDelay(500);
        return fReconciler = reconciler;
    }
    return null;
}
项目:APICloud-Studio    文件:SpellingPreferencePage.java   
private void updateStatus()
{
    boolean spellingEnabled = EditorsUI.getPreferenceStore()
            .getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED);
    if (globalPreferencesLink != null)
    {
        String spellingEnabledMessage = Messages.SpellingPreferencePage_EnabledMessage;
        String spellingDisabledMessage = Messages.SpellingPreferencePage_DisabledMessage;
        globalPreferencesLink.setText(spellingEnabled ? spellingEnabledMessage : spellingDisabledMessage);
    }
    if (tableViewer != null)
    {
        tableViewer.getControl().setEnabled(spellingEnabled);
    }
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaReconciler.java   
@Override
public void install(ITextViewer textViewer) {
    super.install(textViewer);

    fPartListener= new PartListener();
    IWorkbenchPartSite site= fTextEditor.getSite();
    IWorkbenchWindow window= site.getWorkbenchWindow();
    window.getPartService().addPartListener(fPartListener);

    fActivationListener= new ActivationListener(textViewer.getTextWidget());
    Shell shell= window.getShell();
    shell.addShellListener(fActivationListener);

    fJavaElementChangedListener= new ElementChangedListener();
    JavaCore.addElementChangedListener(fJavaElementChangedListener);

    fResourceChangeListener= new ResourceChangeListener();
    IWorkspace workspace= JavaPlugin.getWorkspace();
    workspace.addResourceChangeListener(fResourceChangeListener);

    fPropertyChangeListener= new IPropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent event) {
            if (SpellingService.PREFERENCE_SPELLING_ENABLED.equals(event.getProperty()) || SpellingService.PREFERENCE_SPELLING_ENGINE.equals(event.getProperty()))
                forceReconciling();
        }
    };
    JavaPlugin.getDefault().getCombinedPreferenceStore().addPropertyChangeListener(fPropertyChangeListener);

    fReconciledElement= EditorUtility.getEditorInputJavaElement(fTextEditor, false);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaReconciler.java   
@Override
public void install(ITextViewer textViewer) {
    super.install(textViewer);

    fPartListener= new PartListener();
    IWorkbenchPartSite site= fTextEditor.getSite();
    IWorkbenchWindow window= site.getWorkbenchWindow();
    window.getPartService().addPartListener(fPartListener);

    fActivationListener= new ActivationListener(textViewer.getTextWidget());
    Shell shell= window.getShell();
    shell.addShellListener(fActivationListener);

    fJavaElementChangedListener= new ElementChangedListener();
    JavaCore.addElementChangedListener(fJavaElementChangedListener);

    fResourceChangeListener= new ResourceChangeListener();
    IWorkspace workspace= JavaPlugin.getWorkspace();
    workspace.addResourceChangeListener(fResourceChangeListener);

    fPropertyChangeListener= new IPropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent event) {
            if (SpellingService.PREFERENCE_SPELLING_ENABLED.equals(event.getProperty()) || SpellingService.PREFERENCE_SPELLING_ENGINE.equals(event.getProperty()))
                forceReconciling();
        }
    };
    JavaPlugin.getDefault().getCombinedPreferenceStore().addPropertyChangeListener(fPropertyChangeListener);

    fReconciledElement= EditorUtility.getEditorInputJavaElement(fTextEditor, false);
}
项目:Pydev    文件:PyReconciler.java   
/**
 * Creates a new comment reconcile strategy.
 * 
 * @param viewer the source viewer
 * @param spellingService the spelling service to use
 */
public PyReconciler(ISourceViewer viewer, SpellingService spellingService) {
    Assert.isNotNull(viewer);
    Assert.isNotNull(spellingService);
    fViewer = viewer;
    fSpellingService = spellingService;
    fSpellingContext = new SpellingContext();
    fSpellingContext.setContentType(getContentType());
}
项目:DarwinSPL    文件:DwprofileSourceViewerConfiguration.java   
public IReconciler getReconciler(final ISourceViewer sourceViewer) {
    if (fPreferenceStore == null || !fPreferenceStore.getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED)) {
        return null;
    }

    SpellingService spellingService = EditorsUI.getSpellingService();
    if (spellingService.getActiveSpellingEngineDescriptor(fPreferenceStore) == null) {
        return null;
    }

    IReconcilingStrategy strategy = new SpellingReconcileStrategy(sourceViewer, spellingService) {

        @Override
        protected ISpellingProblemCollector createSpellingProblemCollector() {
            final ISpellingProblemCollector collector = super.createSpellingProblemCollector();

            return new ISpellingProblemCollector() {

                public void accept(SpellingProblem problem) {
                    int offset = problem.getOffset();
                    int length = problem.getLength();
                    if (sourceViewer == null) {
                        return;
                    }
                    IDocument document = sourceViewer.getDocument();
                    if (document == null) {
                        return;
                    }
                    String text;
                    try {
                        text = document.get(offset, length);
                    } catch (BadLocationException e) {
                        return;
                    }
                    if (new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileIgnoredWordsFilter().ignoreWord(text)) {
                        return;
                    }
                    collector.accept(problem);
                }

                public void beginCollecting() {
                    collector.beginCollecting();
                }

                public void endCollecting() {
                    collector.endCollecting();
                }
            };
        }
    };

    MonoReconciler reconciler = new MonoReconciler(strategy, false);
    reconciler.setDelay(500);
    return reconciler;
}
项目:DarwinSPL    文件:HyexpressionSourceViewerConfiguration.java   
public IReconciler getReconciler(final ISourceViewer sourceViewer) {
    if (fPreferenceStore == null || !fPreferenceStore.getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED)) {
        return null;
    }

    SpellingService spellingService = EditorsUI.getSpellingService();
    if (spellingService.getActiveSpellingEngineDescriptor(fPreferenceStore) == null) {
        return null;
    }

    IReconcilingStrategy strategy = new SpellingReconcileStrategy(sourceViewer, spellingService) {

        @Override
        protected ISpellingProblemCollector createSpellingProblemCollector() {
            final ISpellingProblemCollector collector = super.createSpellingProblemCollector();

            return new ISpellingProblemCollector() {

                public void accept(SpellingProblem problem) {
                    int offset = problem.getOffset();
                    int length = problem.getLength();
                    if (sourceViewer == null) {
                        return;
                    }
                    IDocument document = sourceViewer.getDocument();
                    if (document == null) {
                        return;
                    }
                    String text;
                    try {
                        text = document.get(offset, length);
                    } catch (BadLocationException e) {
                        return;
                    }
                    if (new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionIgnoredWordsFilter().ignoreWord(text)) {
                        return;
                    }
                    collector.accept(problem);
                }

                public void beginCollecting() {
                    collector.beginCollecting();
                }

                public void endCollecting() {
                    collector.endCollecting();
                }
            };
        }
    };

    MonoReconciler reconciler = new MonoReconciler(strategy, false);
    reconciler.setDelay(500);
    return reconciler;
}
项目:DarwinSPL    文件:HyvalidityformulaSourceViewerConfiguration.java   
public IReconciler getReconciler(final ISourceViewer sourceViewer) {
    if (fPreferenceStore == null || !fPreferenceStore.getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED)) {
        return null;
    }

    SpellingService spellingService = EditorsUI.getSpellingService();
    if (spellingService.getActiveSpellingEngineDescriptor(fPreferenceStore) == null) {
        return null;
    }

    IReconcilingStrategy strategy = new SpellingReconcileStrategy(sourceViewer, spellingService) {

        @Override
        protected ISpellingProblemCollector createSpellingProblemCollector() {
            final ISpellingProblemCollector collector = super.createSpellingProblemCollector();

            return new ISpellingProblemCollector() {

                public void accept(SpellingProblem problem) {
                    int offset = problem.getOffset();
                    int length = problem.getLength();
                    if (sourceViewer == null) {
                        return;
                    }
                    IDocument document = sourceViewer.getDocument();
                    if (document == null) {
                        return;
                    }
                    String text;
                    try {
                        text = document.get(offset, length);
                    } catch (BadLocationException e) {
                        return;
                    }
                    if (new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaIgnoredWordsFilter().ignoreWord(text)) {
                        return;
                    }
                    collector.accept(problem);
                }

                public void beginCollecting() {
                    collector.beginCollecting();
                }

                public void endCollecting() {
                    collector.endCollecting();
                }
            };
        }
    };

    MonoReconciler reconciler = new MonoReconciler(strategy, false);
    reconciler.setDelay(500);
    return reconciler;
}
项目:DarwinSPL    文件:HydatavalueSourceViewerConfiguration.java   
public IReconciler getReconciler(final ISourceViewer sourceViewer) {
    if (fPreferenceStore == null || !fPreferenceStore.getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED)) {
        return null;
    }

    SpellingService spellingService = EditorsUI.getSpellingService();
    if (spellingService.getActiveSpellingEngineDescriptor(fPreferenceStore) == null) {
        return null;
    }

    IReconcilingStrategy strategy = new SpellingReconcileStrategy(sourceViewer, spellingService) {

        @Override
        protected ISpellingProblemCollector createSpellingProblemCollector() {
            final ISpellingProblemCollector collector = super.createSpellingProblemCollector();

            return new ISpellingProblemCollector() {

                public void accept(SpellingProblem problem) {
                    int offset = problem.getOffset();
                    int length = problem.getLength();
                    if (sourceViewer == null) {
                        return;
                    }
                    IDocument document = sourceViewer.getDocument();
                    if (document == null) {
                        return;
                    }
                    String text;
                    try {
                        text = document.get(offset, length);
                    } catch (BadLocationException e) {
                        return;
                    }
                    if (new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueIgnoredWordsFilter().ignoreWord(text)) {
                        return;
                    }
                    collector.accept(problem);
                }

                public void beginCollecting() {
                    collector.beginCollecting();
                }

                public void endCollecting() {
                    collector.endCollecting();
                }
            };
        }
    };

    MonoReconciler reconciler = new MonoReconciler(strategy, false);
    reconciler.setDelay(500);
    return reconciler;
}
项目:DarwinSPL    文件:HymappingSourceViewerConfiguration.java   
public IReconciler getReconciler(final ISourceViewer sourceViewer) {
    if (fPreferenceStore == null || !fPreferenceStore.getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED)) {
        return null;
    }

    SpellingService spellingService = EditorsUI.getSpellingService();
    if (spellingService.getActiveSpellingEngineDescriptor(fPreferenceStore) == null) {
        return null;
    }

    IReconcilingStrategy strategy = new SpellingReconcileStrategy(sourceViewer, spellingService) {

        @Override
        protected ISpellingProblemCollector createSpellingProblemCollector() {
            final ISpellingProblemCollector collector = super.createSpellingProblemCollector();

            return new ISpellingProblemCollector() {

                public void accept(SpellingProblem problem) {
                    int offset = problem.getOffset();
                    int length = problem.getLength();
                    if (sourceViewer == null) {
                        return;
                    }
                    IDocument document = sourceViewer.getDocument();
                    if (document == null) {
                        return;
                    }
                    String text;
                    try {
                        text = document.get(offset, length);
                    } catch (BadLocationException e) {
                        return;
                    }
                    if (new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingIgnoredWordsFilter().ignoreWord(text)) {
                        return;
                    }
                    collector.accept(problem);
                }

                public void beginCollecting() {
                    collector.beginCollecting();
                }

                public void endCollecting() {
                    collector.endCollecting();
                }
            };
        }
    };

    MonoReconciler reconciler = new MonoReconciler(strategy, false);
    reconciler.setDelay(500);
    return reconciler;
}
项目:DarwinSPL    文件:HyconstraintsSourceViewerConfiguration.java   
public IReconciler getReconciler(final ISourceViewer sourceViewer) {
    if (fPreferenceStore == null || !fPreferenceStore.getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED)) {
        return null;
    }

    SpellingService spellingService = EditorsUI.getSpellingService();
    if (spellingService.getActiveSpellingEngineDescriptor(fPreferenceStore) == null) {
        return null;
    }

    IReconcilingStrategy strategy = new SpellingReconcileStrategy(sourceViewer, spellingService) {

        @Override
        protected ISpellingProblemCollector createSpellingProblemCollector() {
            final ISpellingProblemCollector collector = super.createSpellingProblemCollector();

            return new ISpellingProblemCollector() {

                public void accept(SpellingProblem problem) {
                    int offset = problem.getOffset();
                    int length = problem.getLength();
                    if (sourceViewer == null) {
                        return;
                    }
                    IDocument document = sourceViewer.getDocument();
                    if (document == null) {
                        return;
                    }
                    String text;
                    try {
                        text = document.get(offset, length);
                    } catch (BadLocationException e) {
                        return;
                    }
                    if (new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsIgnoredWordsFilter().ignoreWord(text)) {
                        return;
                    }
                    collector.accept(problem);
                }

                public void beginCollecting() {
                    collector.beginCollecting();
                }

                public void endCollecting() {
                    collector.endCollecting();
                }
            };
        }
    };

    MonoReconciler reconciler = new MonoReconciler(strategy, false);
    reconciler.setDelay(500);
    return reconciler;
}
项目:DarwinSPL    文件:HymanifestSourceViewerConfiguration.java   
public IReconciler getReconciler(final ISourceViewer sourceViewer) {
    if (fPreferenceStore == null || !fPreferenceStore.getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED)) {
        return null;
    }

    SpellingService spellingService = EditorsUI.getSpellingService();
    if (spellingService.getActiveSpellingEngineDescriptor(fPreferenceStore) == null) {
        return null;
    }

    IReconcilingStrategy strategy = new SpellingReconcileStrategy(sourceViewer, spellingService) {

        @Override
        protected ISpellingProblemCollector createSpellingProblemCollector() {
            final ISpellingProblemCollector collector = super.createSpellingProblemCollector();

            return new ISpellingProblemCollector() {

                public void accept(SpellingProblem problem) {
                    int offset = problem.getOffset();
                    int length = problem.getLength();
                    if (sourceViewer == null) {
                        return;
                    }
                    IDocument document = sourceViewer.getDocument();
                    if (document == null) {
                        return;
                    }
                    String text;
                    try {
                        text = document.get(offset, length);
                    } catch (BadLocationException e) {
                        return;
                    }
                    if (new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestIgnoredWordsFilter().ignoreWord(text)) {
                        return;
                    }
                    collector.accept(problem);
                }

                public void beginCollecting() {
                    collector.beginCollecting();
                }

                public void endCollecting() {
                    collector.endCollecting();
                }
            };
        }
    };

    MonoReconciler reconciler = new MonoReconciler(strategy, false);
    reconciler.setDelay(500);
    return reconciler;
}
项目:bts    文件:XtextSpellingReconcileStrategy.java   
protected boolean isSpellingEnabled() {
    return spellingProblemCollector != null && EditorsUI.getPreferenceStore().getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED);
}
项目:gwt-eclipse-plugin    文件:GWTJavaSpellingReconcileStrategy.java   
public static SpellingService getSpellingService() {
  if (spellingService == null) {
    spellingService = new GWTSpellingService();
  }
  return spellingService;
}
项目:APICloud-Studio    文件:MultiRegionSpellingReconcileStrategy.java   
/**
 * @param viewer
 * @param spellingService
 */
public MultiRegionSpellingReconcileStrategy(ISourceViewer viewer, SpellingService spellingService, String documentPartitioning, Collection<String> contentTypes) {
    super(viewer, spellingService);
    this.documentPartitioning = documentPartitioning;
    this.contentTypes = contentTypes;
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaSpellingReconcileStrategy.java   
private boolean isSpellingEnabled() {
    return EditorsUI.getPreferenceStore().getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED);
}
项目:Eclipse-Postfix-Code-Completion    文件:DisableSpellCheckingProposal.java   
public final void apply(final IDocument document) {
    IPreferenceStore store= EditorsUI.getPreferenceStore();
    store.setValue(SpellingService.PREFERENCE_SPELLING_ENABLED, false);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaSpellingReconcileStrategy.java   
private boolean isSpellingEnabled() {
    return EditorsUI.getPreferenceStore().getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED);
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:DisableSpellCheckingProposal.java   
public final void apply(final IDocument document) {
    IPreferenceStore store= EditorsUI.getPreferenceStore();
    store.setValue(SpellingService.PREFERENCE_SPELLING_ENABLED, false);
}
项目:eclipse.spellchecker    文件:DisableSpellCheckingProposal.java   
public final void apply(final IDocument document) {
    IPreferenceStore store= EditorsUI.getPreferenceStore();
    store.setValue(SpellingService.PREFERENCE_SPELLING_ENABLED, false);
}