/** * Creates a spelling engine based on the value of the * <code>PREFERENCE_SPELLING_ENGINE</code> preference in the given * preferences. * * @param preferences the preferences * @return the created spelling engine or <code>null</code> if none * could be created * @throws CoreException if the creation failed * @see SpellingService#PREFERENCE_SPELLING_ENGINE */ private ISpellingEngine createEngine(IPreferenceStore preferences) throws CoreException { SpellingEngineDescriptor descriptor= getActiveSpellingEngineDescriptor(preferences); if (descriptor != null) return descriptor.createEngine(); return null; }
@Override public void reconcile(IRegion region) { if (getAnnotationModel() == null || fSpellingProblemCollector == null) return; fRegions[0]= region; fSpellingService.check(fDocument, fRegions, fSpellingContext, fSpellingProblemCollector, fProgressMonitor); }
/** * Returns all spelling engine descriptors from extensions to the * spelling engine extension point. * * @return all spelling engine descriptors */ public SpellingEngineDescriptor[] getSpellingEngineDescriptors() { SpellingEngineRegistry registry= getSpellingEngineRegistry(); if (registry == null) return new SpellingEngineDescriptor[0]; return registry.getDescriptors(); }
if (fPreferences.getBoolean(PREFERENCE_SPELLING_ENABLED)) try { final ISpellingEngine engine= createEngine(fPreferences); if (engine != null) { ISafeRunnable runnable= new ISafeRunnable() {
private Map<String, SpellingEngineDescriptor> createListModel() { SpellingEngineDescriptor[] descs= EditorsUI.getSpellingService().getSpellingEngineDescriptors(); Map<String, SpellingEngineDescriptor> map= new HashMap<>(); for (int i= 0; i < descs.length; i++) { map.put(descs[i].getId(), descs[i]); } return map; }
/** * Returns the spelling service. * * @return the spelling service * @since 3.1 */ public SpellingService getSpellingService() { if (fSpellingService == null) fSpellingService= new SpellingService(getPreferenceStore()); return fSpellingService; }
if (fPreferences.getBoolean(PREFERENCE_SPELLING_ENABLED)) try { final ISpellingEngine engine= createEngine(fPreferences); if (engine != null) { ISafeRunnable runnable= new ISafeRunnable() {
private Map createListModel() { SpellingEngineDescriptor[] descs= EditorsUI.getSpellingService().getSpellingEngineDescriptors(); Map map= new HashMap(); for (int i= 0; i < descs.length; i++) { map.put(descs[i].getId(), descs[i]); } return map; }
/** * Returns the spelling service. * * @return the spelling service * @since 3.1 */ public SpellingService getSpellingService() { if (fSpellingService == null) fSpellingService= new SpellingService(getPreferenceStore()); return fSpellingService; }
/** * Creates a spelling engine based on the value of the * <code>PREFERENCE_SPELLING_ENGINE</code> preference in the given * preferences. * * @param preferences the preferences * @return the created spelling engine or <code>null</code> if none * could be created * @throws CoreException if the creation failed * @see SpellingService#PREFERENCE_SPELLING_ENGINE */ private ISpellingEngine createEngine(IPreferenceStore preferences) throws CoreException { SpellingEngineDescriptor descriptor= getActiveSpellingEngineDescriptor(preferences); if (descriptor != null) return descriptor.createEngine(); return null; }
public void reconcile(IRegion region) { if (getAnnotationModel() == null || fSpellingProblemCollector == null) return; fSpellingService.check(fDocument, fSpellingContext, fSpellingProblemCollector, fProgressMonitor); }
/** * Returns all spelling engine descriptors from extensions to the * spelling engine extension point. * * @return all spelling engine descriptors */ public SpellingEngineDescriptor[] getSpellingEngineDescriptors() { SpellingEngineRegistry registry= getSpellingEngineRegistry(); if (registry == null) return new SpellingEngineDescriptor[0]; return registry.getDescriptors(); }
if (fPreferences.getBoolean(PREFERENCE_SPELLING_ENABLED)) try { final ISpellingEngine engine= createEngine(fPreferences); if (engine != null) { ISafeRunnable runnable= new ISafeRunnable() {
composite.setLayout(layout); if (EditorsUI.getSpellingService().getSpellingEngineDescriptors().length == 0) { Label label= new Label(composite, SWT.NONE); label.setText(TextEditorMessages.SpellingConfigurationBlock_error_not_installed);
/** * Creates a spelling engine based on the value of the * <code>PREFERENCE_SPELLING_ENGINE</code> preference in the given * preferences. * * @param preferences the preferences * @return the created spelling engine or <code>null</code> if none * could be created * @throws CoreException if the creation failed * @see SpellingService#PREFERENCE_SPELLING_ENGINE */ private ISpellingEngine createEngine(IPreferenceStore preferences) throws CoreException { SpellingEngineDescriptor descriptor= getActiveSpellingEngineDescriptor(preferences); if (descriptor != null) return descriptor.createEngine(); return null; }
@Override public void reconcile(IRegion region) { if (getAnnotationModel() == null || fSpellingProblemCollector == null) return; fRegions[0]= region; fSpellingService.check(fDocument, fRegions, fSpellingContext, fSpellingProblemCollector, fProgressMonitor); }
/** * Returns all spelling engine descriptors from extensions to the * spelling engine extension point. * * @return all spelling engine descriptors */ public SpellingEngineDescriptor[] getSpellingEngineDescriptors() { SpellingEngineRegistry registry= getSpellingEngineRegistry(); if (registry == null) return new SpellingEngineDescriptor[0]; return registry.getDescriptors(); }
composite.setLayout(layout); if (EditorsUI.getSpellingService().getSpellingEngineDescriptors().length == 0) { Label label= new Label(composite, SWT.NONE); label.setText(TextEditorMessages.SpellingConfigurationBlock_error_not_installed);
public boolean canPerformOk() { SpellingEngineDescriptor desc= EditorsUI.getSpellingService().getActiveSpellingEngineDescriptor(fStore); String id= desc != null ? desc.getId() : ""; //$NON-NLS-1$ final ISpellingPreferenceBlock block= (ISpellingPreferenceBlock) fProviderPreferences.get(id); if (block == null) return true; final Boolean[] result= new Boolean[] { Boolean.TRUE }; ISafeRunnable runnable= new ISafeRunnable() { public void run() throws Exception { result[0]= Boolean.valueOf(block.canPerformOk()); } public void handleException(Throwable x) { } }; SafeRunner.run(runnable); return result[0].booleanValue(); }
/** * Checks the given document. Reports all found spelling problems to the * collector. The spelling engine is chosen based on the settings * from the given preferences. * * @param document the document to check * @param context the context * @param collector the problem collector * @param monitor the progress monitor, can be <code>null</code> */ public void check(IDocument document, SpellingContext context, ISpellingProblemCollector collector, IProgressMonitor monitor) { check(document, new IRegion[] { new Region(0, document.getLength()) }, context, collector, monitor); }