Java Code Examples for org.eclipse.ui.editors.text.EditorsUI#getSpellingService()

The following examples show how to use org.eclipse.ui.editors.text.EditorsUI#getSpellingService() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PropertiesFileSourceViewerConfiguration.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
@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;
}
 
Example 2
Source File: EditorConfigSourceViewerConfiguration.java    From editorconfig-eclipse with Apache License 2.0 6 votes vote down vote up
@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;
}
 
Example 3
Source File: PyEditConfigurationWithoutEditor.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
@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;
}
 
Example 4
Source File: CommonSourceViewerConfiguration.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
@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;
}
 
Example 5
Source File: XtextSpellingReconcileStrategy.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
protected XtextSpellingReconcileStrategy(ISourceViewer viewer) {
	super(viewer, EditorsUI.getSpellingService());
	spellingContext.setContentType(getContentType());
}
 
Example 6
Source File: SourceCodeSpellingReconcileStrategy.java    From xds-ide with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Creates a new comment reconcile strategy.
 *
 * @param viewer the source viewer
 * @param editor the text editor to operate on
 */
public SourceCodeSpellingReconcileStrategy(ISourceViewer viewer) {
    super(viewer, EditorsUI.getSpellingService());
}
 
Example 7
Source File: JavaSpellingReconcileStrategy.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Creates a new comment reconcile strategy.
 *
 * @param viewer the source viewer
 * @param editor the text editor to operate on
 */
public JavaSpellingReconcileStrategy(ISourceViewer viewer, ITextEditor editor) {
	super(viewer, EditorsUI.getSpellingService());
	fEditor= editor;
}