@Override public synchronized final ISpellChecker getSpellChecker() throws IllegalStateException { if (fGlobalDictionaries == null) throw new IllegalStateException("spell checker has been shut down"); //$NON-NLS-1$ IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore(); Locale locale= getCurrentLocale(store); if (fUserDictionary == null && "".equals(locale.toString())) //$NON-NLS-1$ return null; if (fChecker != null && fChecker.getLocale().equals(locale)) return fChecker; resetSpellChecker(); fChecker= new DefaultSpellChecker(store, locale); resetUserDictionary(); for (Iterator<ISpellDictionary> iterator= fGlobalDictionaries.iterator(); iterator.hasNext();) { ISpellDictionary dictionary= iterator.next(); fChecker.addDictionary(dictionary); } ISpellDictionary dictionary= findDictionary(fChecker.getLocale()); if (dictionary != null) fChecker.addDictionary(dictionary); return fChecker; }
if (!isCorrect(word)) { boolean isMixed= isMixedCase(word, true); boolean isUpper= isUpperCase(word); boolean isDigits= isDigits(word); boolean isURL= isUrl(word); fireEvent(new SpellEvent(this, word, iterator.getBegin(), iterator.getEnd(), starts, false)); problemCount++; fireEvent(new SpellEvent(this, word, iterator.getBegin(), iterator.getEnd(), true, true)); problemCount++;
if (!isCorrect(word)) { boolean isMixed= isMixedCase(word, true); boolean isUpper= isUpperCase(word); boolean isDigits= isDigits(word); boolean isURL= isUrl(word);
public final synchronized ISpellChecker getSpellChecker() throws IllegalStateException { if (fGlobalDictionaries == null) throw new IllegalStateException("spell checker has been shut down"); //$NON-NLS-1$ IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore(); Locale locale= getCurrentLocale(store); if (fUserDictionary == null && "".equals(locale.toString())) //$NON-NLS-1$ return null; if (fChecker != null && fChecker.getLocale().equals(locale)) return fChecker; resetSpellChecker(); fChecker= new DefaultSpellChecker(store, locale); resetUserDictionary(); for (Iterator iterator= fGlobalDictionaries.iterator(); iterator.hasNext();) { ISpellDictionary dictionary= (ISpellDictionary)iterator.next(); fChecker.addDictionary(dictionary); } ISpellDictionary dictionary= findDictionary(fChecker.getLocale()); if (dictionary != null) fChecker.addDictionary(dictionary); return fChecker; }
if (!isCorrect(word)) { boolean isMixed= isMixedCase(word, true); boolean isUpper= isUpperCase(word); boolean isDigits= isDigits(word); boolean isURL= isUrl(word);
@Override public synchronized final ISpellChecker getSpellChecker() throws IllegalStateException { if (fGlobalDictionaries == null) throw new IllegalStateException("spell checker has been shut down"); //$NON-NLS-1$ IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore(); Locale locale= getCurrentLocale(store); if (fUserDictionary == null && "".equals(locale.toString())) //$NON-NLS-1$ return null; if (fChecker != null && fChecker.getLocale().equals(locale)) return fChecker; resetSpellChecker(); fChecker= new DefaultSpellChecker(store, locale); resetUserDictionary(); for (Iterator<ISpellDictionary> iterator= fGlobalDictionaries.iterator(); iterator.hasNext();) { ISpellDictionary dictionary= iterator.next(); fChecker.addDictionary(dictionary); } ISpellDictionary dictionary= findDictionary(fChecker.getLocale()); if (dictionary != null) fChecker.addDictionary(dictionary); return fChecker; }