1 package com
.swabunga
.spell
.event
;
5 /** This event is fired off by the SpellChecker and is passed to the
6 * registered SpellCheckListeners
7 * <p>AFAIK we will only require one implementation of the SpellCheckEvent
8 * (BasicSpellCheckEvent) but I have defnied this interface just in case. The
9 * BasicSpellCheckEvent implementation is currently package private.
12 * @author Jason Height (jheight@chariot.net.au)
14 public interface SpellCheckEvent
{
15 /** Field indicating that the incorrect word should be ignored*/
16 public static final short IGNORE
= 0;
17 /** Field indicating that the incorrect word should be ignored forever*/
18 public static final short IGNOREALL
= 1;
19 /** Field indicating that the incorrect word should be replaced*/
20 public static final short REPLACE
= 2;
21 /** Field indicating that the incorrect word should be replaced always*/
22 public static final short REPLACEALL
= 3;
23 /** Field indicating that the incorrect word should be added to the dictionary*/
24 public static final short ADDTODICT
= 4;
25 /** Field indicating that the spell checking should be terminated*/
26 public static final short CANCEL
= 5;
27 /** Initial case for the action */
28 public static final short INITIAL
= -1;
30 /** Returns the list of suggested Word objects*/
31 public List
getSuggestions();
33 /** Returns the currently misspelt word*/
34 public String
getInvalidWord();
36 /** Returns the context in which the misspelt word is used*/
37 public String
getWordContext();
39 /** Returns the start position of the misspelt word in the context*/
40 public int getWordContextPosition();
42 public short getAction();
44 public String
getReplaceWord();
46 /** Set the action to replace the currently misspelt word with the new word
47 * @param String newWord The word to replace the currently misspelt word
48 * @param boolean replaceAll If set to true, the SpellChecker will replace all
49 * further occurances of the misspelt word without firing a SpellCheckEvent.
51 public void replaceWord(String newWord
, boolean replaceAll
);
53 /** Set the action it ignore the currently misspelt word.
54 * @param boolean ignoreAll If set to true, the SpellChecker will replace all
55 * further occurances of the misspelt word without firing a SpellCheckEvent.
57 public void ignoreWord(boolean ignoreAll
);
59 /** Set the action to add a new word into the dictionary. This will also replace the
60 * currently misspelt word.
62 public void addToDictionary(String newWord
);
64 /** Set the action to terminate processing of the spellchecker.