public void spellingError(SpellCheckEvent event) { errors.add(event.getInvalidWord()); } });
public void spellingError(SpellCheckEvent event) { @SuppressWarnings("unchecked") List<Word> suggestions = (List<Word>) event.getSuggestions(); if (suggestions.size() > 0) { Iterator<Word> suggestedWord = suggestions.iterator(); if (suggestedWord.hasNext()) { String orig = event.getInvalidWord(); String sugg = suggestedWord.next().getWord(); if (_correctionType == SpellCorrectionType.Add) event.replaceWord(sugg + " ( " + orig + " ) ", false); else if (_correctionType == SpellCorrectionType.Replace) event.replaceWord(sugg, false); } } }
String word = event.getInvalidWord(); switch (event.getAction()) { case SpellCheckEvent.INITIAL: break; break; case SpellCheckEvent.REPLACE: tokenizer.replaceWord(event.getReplaceWord()); break; case SpellCheckEvent.REPLACEALL: String replaceAllWord = event.getReplaceWord(); if (!autoReplaceWords.containsKey(word)) { autoReplaceWords.put(word, replaceAllWord); break; case SpellCheckEvent.ADDTODICT: String addWord = event.getReplaceWord(); if (!addWord.equals(word)) tokenizer.replaceWord(addWord);
@Override public void spellingError(SpellCheckEvent arg0) { int pos = arg0.getWordContextPosition(); try { dh.addHighlight(pos,pos+arg0.getInvalidWord().length(),underline); } catch (BadLocationException e1) { e1.printStackTrace(); } } });
public void spellingError(SpellCheckEvent event) { errors.add(event.getInvalidWord()); } });
@Override public void spellingError(SpellCheckEvent event) { errors.add(event.getInvalidWord()); } });
public void spellingError(SpellCheckEvent event) { errors.add(event.getInvalidWord()); } });