Search in sources :

Example 6 with SpellingEngineDescriptor

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

the class SpellingConfigurationBlock method canPerformOk.

@Override
public boolean canPerformOk() {
    SpellingEngineDescriptor desc = EditorsUI.getSpellingService().getActiveSpellingEngineDescriptor(fStore);
    // $NON-NLS-1$
    String id = desc != null ? desc.getId() : "";
    final ISpellingPreferenceBlock block = fProviderPreferences.get(id);
    if (block == null)
        return true;
    final Boolean[] result = new Boolean[] { Boolean.TRUE };
    ISafeRunnable runnable = new ISafeRunnable() {

        @Override
        public void run() throws Exception {
            result[0] = Boolean.valueOf(block.canPerformOk());
        }

        @Override
        public void handleException(Throwable x) {
        }
    };
    SafeRunner.run(runnable);
    return result[0].booleanValue();
}
Also used : ISafeRunnable(org.eclipse.core.runtime.ISafeRunnable) SpellingEngineDescriptor(org.eclipse.ui.texteditor.spelling.SpellingEngineDescriptor) ISpellingPreferenceBlock(org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock)

Aggregations

SpellingEngineDescriptor (org.eclipse.ui.texteditor.spelling.SpellingEngineDescriptor)6 ISafeRunnable (org.eclipse.core.runtime.ISafeRunnable)4 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)2 ISpellingPreferenceBlock (org.eclipse.ui.texteditor.spelling.ISpellingPreferenceBlock)2 ArrayList (java.util.ArrayList)1 CoreException (org.eclipse.core.runtime.CoreException)1 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)1 IStatus (org.eclipse.core.runtime.IStatus)1 Status (org.eclipse.core.runtime.Status)1 MessageDialog (org.eclipse.jface.dialogs.MessageDialog)1 ComboViewer (org.eclipse.jface.viewers.ComboViewer)1 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)1 IStructuredContentProvider (org.eclipse.jface.viewers.IStructuredContentProvider)1 LabelProvider (org.eclipse.jface.viewers.LabelProvider)1 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)1 Viewer (org.eclipse.jface.viewers.Viewer)1 Image (org.eclipse.swt.graphics.Image)1 Control (org.eclipse.swt.widgets.Control)1 Shell (org.eclipse.swt.widgets.Shell)1