Search in sources :

Example 1 with SpellingReconcileStrategy

use of org.eclipse.ui.texteditor.spelling.SpellingReconcileStrategy in project eclipse.platform.text by eclipse.

the class TextSourceViewerConfiguration method getReconciler.

/**
 * Returns the reconciler ready to be used with the given source viewer.
 * <p>
 * This implementation currently returns a {@link MonoReconciler} which
 * is responsible for spell checking. In the future a different reconciler
 * taking over more responsibilities might be returned.</p>
 *
 * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getReconciler(org.eclipse.jface.text.source.ISourceViewer)
 * @since 3.3
 */
@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;
    IReconcilingStrategy strategy = new SpellingReconcileStrategy(sourceViewer, spellingService);
    MonoReconciler reconciler = new MonoReconciler(strategy, false);
    reconciler.setDelay(500);
    return reconciler;
}
Also used : IReconcilingStrategy(org.eclipse.jface.text.reconciler.IReconcilingStrategy) SpellingReconcileStrategy(org.eclipse.ui.texteditor.spelling.SpellingReconcileStrategy) MonoReconciler(org.eclipse.jface.text.reconciler.MonoReconciler) SpellingService(org.eclipse.ui.texteditor.spelling.SpellingService)

Aggregations

IReconcilingStrategy (org.eclipse.jface.text.reconciler.IReconcilingStrategy)1 MonoReconciler (org.eclipse.jface.text.reconciler.MonoReconciler)1 SpellingReconcileStrategy (org.eclipse.ui.texteditor.spelling.SpellingReconcileStrategy)1 SpellingService (org.eclipse.ui.texteditor.spelling.SpellingService)1