replacementWord.setText(word);\r
}\r
\r
- public void setNoSuggestions(boolean enable) {\r
- if (enable) {\r
- replacementWord.setEnabled(true);\r
- replace.setEnabled(true);\r
- suggestions.setEnabled(true);\r
- } else {\r
- replacementWord.setEnabled(false);\r
- replace.setEnabled(false);\r
- suggestions.setEnabled(false);\r
- }\r
+ // Empty out the list\r
+ public void clearSuggestions() {\r
+ suggestions.clear();\r
}\r
\r
public void setSelectedSuggestion(int index) {\r
spellCheckDialog = new SpellCheck(checker);\r
}\r
public void spellingError(SpellCheckEvent event) {\r
+ System.out.println("**" +event.getInvalidWord());\r
errorsFound = true;\r
spellCheckDialog.setWord(event.getInvalidWord());\r
\r
List<Word> suggestions = event.getSuggestions();\r
- if (suggestions.isEmpty()) {\r
- spellCheckDialog.setNoSuggestions(true);\r
- } else {\r
- spellCheckDialog.setCurrentSuggestion(suggestions.get(0).getWord());\r
+ spellCheckDialog.clearSuggestions();\r
+ if (!suggestions.isEmpty()) {\r
+// spellCheckDialog.setCurrentSuggestion(suggestions.get(0).getWord());\r
for (int i=0; i<suggestions.size(); i++) {\r
spellCheckDialog.addSuggestion(suggestions.get(i).getWord());\r
}\r
spellCheckDialog.exec();\r
if (spellCheckDialog.cancelPressed()) {\r
abortSpellCheck = true;\r
+ event.cancel();\r
return;\r
}\r
if (spellCheckDialog.replacePressed()) {\r
clipboard.setText(spellCheckDialog.getReplacementWord()); \r
parent.pasteClicked();\r
}\r
+ event.cancel();\r
}\r
}\r
\r
dictionary = new SpellDictionaryHashMap(wordList);\r
spellChecker = new SpellChecker(dictionary);\r
\r
- // Read user settings\r
- spellChecker.getConfiguration().setBoolean(Configuration.SPELL_IGNOREDIGITWORDS, \r
- Global.getSpellSetting(Configuration.SPELL_IGNOREDIGITWORDS));\r
- spellChecker.getConfiguration().setBoolean(Configuration.SPELL_IGNOREINTERNETADDRESSES, \r
- Global.getSpellSetting(Configuration.SPELL_IGNOREINTERNETADDRESSES));\r
- spellChecker.getConfiguration().setBoolean(Configuration.SPELL_IGNOREMIXEDCASE, \r
- Global.getSpellSetting(Configuration.SPELL_IGNOREMIXEDCASE));\r
- spellChecker.getConfiguration().setBoolean(Configuration.SPELL_IGNOREUPPERCASE, \r
- Global.getSpellSetting(Configuration.SPELL_IGNOREUPPERCASE));\r
- spellChecker.getConfiguration().setBoolean(Configuration.SPELL_IGNORESENTENCECAPITALIZATION, \r
- Global.getSpellSetting(Configuration.SPELL_IGNORESENTENCECAPITALIZATION));\r
- \r
File userWordList;\r
userWordList = new File(Global.getFileManager().getSpellDirPathUser()+"user.dic");\r
\r
if (spellChecker == null) {\r
setupDictionary(); \r
}\r
+ \r
+ // Read user settings\r
+ spellChecker.getConfiguration().setBoolean(Configuration.SPELL_IGNOREDIGITWORDS, \r
+ Global.getSpellSetting(Configuration.SPELL_IGNOREDIGITWORDS));\r
+ spellChecker.getConfiguration().setBoolean(Configuration.SPELL_IGNOREINTERNETADDRESSES, \r
+ Global.getSpellSetting(Configuration.SPELL_IGNOREINTERNETADDRESSES));\r
+ spellChecker.getConfiguration().setBoolean(Configuration.SPELL_IGNOREMIXEDCASE, \r
+ Global.getSpellSetting(Configuration.SPELL_IGNOREMIXEDCASE));\r
+ spellChecker.getConfiguration().setBoolean(Configuration.SPELL_IGNOREUPPERCASE, \r
+ Global.getSpellSetting(Configuration.SPELL_IGNOREUPPERCASE));\r
+ spellChecker.getConfiguration().setBoolean(Configuration.SPELL_IGNORESENTENCECAPITALIZATION, \r
+ Global.getSpellSetting(Configuration.SPELL_IGNORESENTENCECAPITALIZATION));\r
\r
spellListener.abortSpellCheck = false;\r
spellListener.errorsFound = false;\r