Java 类org.eclipse.jface.text.reconciler.IReconcilingStrategy 实例源码

项目: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;
}
项目: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;
}
项目: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;
}
项目:ec4e    文件:EditorConfigReconciler.java   
private static IReconcilingStrategy create(IPreferenceStore preferenceStore, IResource resource) {
    if (EditorConfigConstants.EDITORCONFIG.equals(resource.getName())) {
        // it's an .editorconfig file, add validation
        CompositeReconcilingStrategy strategy = new CompositeReconcilingStrategy();
        strategy.setReconcilingStrategies(new IReconcilingStrategy[] { new ValidateEditorConfigStrategy(resource),
                new ValidateAppliedOptionsStrategy(preferenceStore, resource), new EditorConfigFoldingStrategy() });
        return strategy;
    }
    return new ValidateAppliedOptionsStrategy(preferenceStore, resource);
}
项目: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() };
}
项目:fluentmark    文件:CompositeReconcilingStrategy.java   
@Override
public void setDocument(IDocument document) {
    if (strategies == null) return;

    for (IReconcilingStrategy strategy : strategies) {
        strategy.setDocument(document);
    }
}
项目:fluentmark    文件:CompositeReconcilingStrategy.java   
@Override
public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion) {
    if (strategies == null) return;

    for (IReconcilingStrategy strategy : strategies) {
        strategy.reconcile(dirtyRegion, subRegion);
    }
}
项目:fluentmark    文件:CompositeReconcilingStrategy.java   
@Override
public void reconcile(IRegion partition) {
    if (strategies == null) return;

    for (IReconcilingStrategy strategy : strategies) {
        strategy.reconcile(partition);
    }
}
项目:fluentmark    文件:CompositeReconcilingStrategy.java   
@Override
public void setProgressMonitor(IProgressMonitor monitor) {
    if (strategies == null) return;

    for (IReconcilingStrategy strategy : strategies) {
        if (strategy instanceof IReconcilingStrategyExtension) {
            IReconcilingStrategyExtension extension = (IReconcilingStrategyExtension) strategy;
            extension.setProgressMonitor(monitor);
        }
    }
}
项目:fluentmark    文件:CompositeReconcilingStrategy.java   
@Override
public void initialReconcile() {
    if (strategies == null) return;

    for (IReconcilingStrategy strategy : strategies) {
        if (strategy instanceof IReconcilingStrategyExtension) {
            IReconcilingStrategyExtension extension = (IReconcilingStrategyExtension) strategy;
            extension.initialReconcile();
        }
    }
}
项目:typescript.java    文件:TypeScriptDocumentRegionProcessor.java   
protected IReconcilingStrategy getTypeScriptFoldingStrategy() {
    if ("org.eclipse.wst.jsdt.core.jsSource".equals(contentType)) {
        return super.getFoldingStrategy();
    }
    if (foldingStrategy == null) {
        ITextViewer viewer = getTextViewer();
        if (viewer instanceof ProjectionViewer) {
            foldingStrategy = new TypeScriptFoldingStrategy();
            foldingStrategy.setViewer((ProjectionViewer) viewer);
            foldingStrategy.setDocument(getDocument());
        }
    }
    return foldingStrategy;
}
项目:typescript.java    文件:TypeScriptDocumentRegionProcessor.java   
protected IReconcilingStrategy getCodeLensStrategy() {
    if (!TypeScriptUIPlugin.getDefault().getPreferenceStore()
            .getBoolean(TypeScriptUIPreferenceConstants.EDITOR_ACTIVATE_CODELENS)) {
        return null;
    }
    if (codeLensStrategy == null && getDocument() != null) {
        if (getTextViewer() instanceof ISourceViewer) {
            ISourceViewer viewer = (ISourceViewer) getTextViewer();
            codeLensStrategy = new TypeScriptCodeLensStrategy(viewer);
            codeLensStrategy.setDocument(getDocument());
            codeLensStrategy.setProgressMonitor(new NullProgressMonitor());
        }
    }
    return codeLensStrategy;
}
项目:gwt-eclipse-plugin    文件:UiBinderStructuredRegionProcessor.java   
@Override
protected IReconcilingStrategy getSpellcheckStrategy() {
  if (spellcheckStrategy == null) {
    String contentTypeId = getContentType(getDocument());
    if (contentTypeId != null) {
      if (getTextViewer() instanceof ISourceViewer) {
        ISourceViewer viewer = (ISourceViewer) getTextViewer();
        spellcheckStrategy = new UiBinderSpellcheckStrategy(viewer,
            contentTypeId);
        spellcheckStrategy.setDocument(getDocument());
      }
    }
  }
  return spellcheckStrategy;
}
项目:gwt-eclipse-plugin    文件:GWTSourceViewerConfiguration.java   
@Override
public IReconciler getReconciler(ISourceViewer sourceViewer) {
  JavaReconciler reconciler = (JavaReconciler) super.getReconciler(sourceViewer);
  if (reconciler != null) {
    try {
      JavaCompositeReconcilingStrategy strategy = (JavaCompositeReconcilingStrategy) reconciler.getReconcilingStrategy(IDocument.DEFAULT_CONTENT_TYPE);
      IReconcilingStrategy[] strategies = strategy.getReconcilingStrategies();
      IReconcilingStrategy[] newStrategies = new IReconcilingStrategy[strategies.length];
      for (int i = 0; i < strategies.length; i++) {
        if (strategies[i] instanceof JavaSpellingReconcileStrategy) {
          // Replace the default Java reconcile strategy with our own, which
          // will suppress spell checking within JSNI blocks
          newStrategies[i] = new GWTJavaSpellingReconcileStrategy(
              sourceViewer, getEditor());
        } else {
          newStrategies[i] = strategies[i];
        }
      }
      strategy.setReconcilingStrategies(newStrategies);
    } catch (Exception e) {
      // We're being defensive to ensure that we always return a reconciler
      GWTPluginLog.logError(e);
    }
    return reconciler;
  }

  return null;
}
项目:APICloud-Studio    文件:CompositeReconcilingStrategy.java   
public void dispose()
{
    for (IReconcilingStrategy strategy : fStrategies)
    {
        if (strategy instanceof IDisposableReconcilingStrategy)
        {
            ((IDisposableReconcilingStrategy) strategy).dispose();
        }
    }
}
项目:APICloud-Studio    文件:CompositeReconcilingStrategy.java   
public void setDocument(IDocument document)
{
    for (IReconcilingStrategy strategy : fStrategies)
    {
        strategy.setDocument(document);
    }
}
项目:APICloud-Studio    文件:CompositeReconcilingStrategy.java   
public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion)
{
    for (IReconcilingStrategy strategy : fStrategies)
    {
        strategy.reconcile(dirtyRegion, subRegion);
    }
}
项目:APICloud-Studio    文件:CompositeReconcilingStrategy.java   
public void reconcile(IRegion partition)
{
    for (IReconcilingStrategy strategy : fStrategies)
    {
        strategy.reconcile(partition);
    }
}
项目:APICloud-Studio    文件:CompositeReconcilingStrategy.java   
public void setProgressMonitor(IProgressMonitor monitor)
{
    for (IReconcilingStrategy strategy : fStrategies)
    {
        if (strategy instanceof IReconcilingStrategyExtension)
        {
            IReconcilingStrategyExtension extension = (IReconcilingStrategyExtension) strategy;
            extension.setProgressMonitor(monitor);
        }
    }
}
项目:APICloud-Studio    文件:CompositeReconcilingStrategy.java   
public void initialReconcile()
{
    for (IReconcilingStrategy strategy : fStrategies)
    {
        if (strategy instanceof IReconcilingStrategyExtension)
        {
            IReconcilingStrategyExtension extension = (IReconcilingStrategyExtension) strategy;
            extension.initialReconcile();
        }
    }
}
项目:APICloud-Studio    文件:CompositeReconcilingStrategy.java   
public void fullReconcile()
{
    for (IReconcilingStrategy strategy : fStrategies)
    {
        if (strategy instanceof IBatchReconcilingStrategy)
        {
            IBatchReconcilingStrategy extension = (IBatchReconcilingStrategy) strategy;
            extension.fullReconcile();
        }
    }
}
项目:APICloud-Studio    文件:CommonReconciler.java   
/**
 * 
 */
public CommonReconciler(IReconcilingStrategy defaultStrategy)
{
    super();
    this.defaultStrategy = defaultStrategy;
    setReconcilingStrategy(defaultStrategy, String.valueOf(System.currentTimeMillis()));
}
项目:APICloud-Studio    文件:CommonReconciler.java   
/**
 * @param strategy
 * @param contentTypes
 */
public void setReconcilingStrategy(IReconcilingStrategy strategy, Collection<String> contentTypes)
{
    for (String contentType : contentTypes)
    {
        setReconcilingStrategy(strategy, contentType);
    }
}
项目:APICloud-Studio    文件:CommonReconciler.java   
@Override
public IReconcilingStrategy getReconcilingStrategy(String contentType)
{
    IReconcilingStrategy strategy = super.getReconcilingStrategy(contentType);
    if (strategy != null)
    {
        return strategy;
    }
    return defaultStrategy;
}
项目:APICloud-Studio    文件:CommonReconciler.java   
@Override
protected void initialProcess()
{
    for (IReconcilingStrategy s : reconcilingStrategies)
    {
        if (s instanceof IReconcilingStrategyExtension)
        {
            ((IReconcilingStrategyExtension) s).initialReconcile();
        }
    }
    fInitialProcessDone = true;
}
项目: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;
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaCompositeReconcilingStrategy.java   
/**
 * Creates a new Java reconciling strategy.
 *
 * @param viewer the source viewer
 * @param editor the editor of the strategy's reconciler
 * @param documentPartitioning the document partitioning this strategy uses for configuration
 */
public JavaCompositeReconcilingStrategy(ISourceViewer viewer, ITextEditor editor, String documentPartitioning) {
    fEditor= editor;
    fJavaStrategy= new JavaReconcilingStrategy(editor);
    setReconcilingStrategies(new IReconcilingStrategy[] {
        fJavaStrategy,
        new JavaSpellingReconcileStrategy(viewer, editor)
    });
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaCompositeReconcilingStrategy.java   
/**
 * Creates a new Java reconciling strategy.
 *
 * @param viewer the source viewer
 * @param editor the editor of the strategy's reconciler
 * @param documentPartitioning the document partitioning this strategy uses for configuration
 */
public JavaCompositeReconcilingStrategy(ISourceViewer viewer, ITextEditor editor, String documentPartitioning) {
    fEditor= editor;
    fJavaStrategy= new JavaReconcilingStrategy(editor);
    setReconcilingStrategies(new IReconcilingStrategy[] {
        fJavaStrategy,
        new JavaSpellingReconcileStrategy(viewer, editor)
    });
}
项目:ec4e    文件:ValidateAppliedOptionsStrategy.java   
@Override
public IReconcilingStrategy getReconcilingStrategy(String contentType) {
    return null;
}
项目:ec4e    文件:ValidateEditorConfigStrategy.java   
@Override
public IReconcilingStrategy getReconcilingStrategy(String contentType) {
    return null;
}
项目:ec4e    文件:CompositeReconcilingStrategy.java   
@Override
public IReconcilingStrategy getReconcilingStrategy(String contentType) {
    return null;
}
项目:ec4e    文件:EditorConfigFoldingStrategy.java   
@Override
public IReconcilingStrategy getReconcilingStrategy(String contentType) {
    return null;
}
项目: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;
}