com.swabunga.spell.event
Interface SpellCheckEvent


public interface SpellCheckEvent

This event is fired off by the SpellChecker and is passed to the registered SpellCheckListeners

AFAIK we will only require one implementation of the SpellCheckEvent (BasicSpellCheckEvent) but I have defnied this interface just in case. The BasicSpellCheckEvent implementation is currently package private.

Author:
Jason Height ([email protected])

Field Summary
static short ADDTODICT
          Field indicating that the incorrect word should be added to the dictionary
static short CANCEL
          Field indicating that the spell checking should be terminated
static short IGNORE
          Field indicating that the incorrect word should be ignored
static short IGNOREALL
          Field indicating that the incorrect word should be ignored forever
static short INITIAL
          Initial case for the action
static short REPLACE
          Field indicating that the incorrect word should be replaced
static short REPLACEALL
          Field indicating that the incorrect word should be replaced always
 
Method Summary
 void addToDictionary(java.lang.String newWord)
          Set the action to add a new word into the dictionary.
 void cancel()
          Set the action to terminate processing of the spellchecker.
 short getAction()
           
 java.lang.String getInvalidWord()
          Returns the currently misspelt word
 java.lang.String getReplaceWord()
           
 java.util.List getSuggestions()
          Returns the list of suggested Word objects
 java.lang.String getWordContext()
          Returns the context in which the misspelt word is used
 int getWordContextPosition()
          Returns the start position of the misspelt word in the context
 void ignoreWord(boolean ignoreAll)
          Set the action it ignore the currently misspelt word.
 void replaceWord(java.lang.String newWord, boolean replaceAll)
          Set the action to replace the currently misspelt word with the new word
 

Field Detail

IGNORE

public static final short IGNORE
Field indicating that the incorrect word should be ignored

See Also:
Constant Field Values

IGNOREALL

public static final short IGNOREALL
Field indicating that the incorrect word should be ignored forever

See Also:
Constant Field Values

REPLACE

public static final short REPLACE
Field indicating that the incorrect word should be replaced

See Also:
Constant Field Values

REPLACEALL

public static final short REPLACEALL
Field indicating that the incorrect word should be replaced always

See Also:
Constant Field Values

ADDTODICT

public static final short ADDTODICT
Field indicating that the incorrect word should be added to the dictionary

See Also:
Constant Field Values

CANCEL

public static final short CANCEL
Field indicating that the spell checking should be terminated

See Also:
Constant Field Values

INITIAL

public static final short INITIAL
Initial case for the action

See Also:
Constant Field Values
Method Detail

getSuggestions

public java.util.List getSuggestions()
Returns the list of suggested Word objects


getInvalidWord

public java.lang.String getInvalidWord()
Returns the currently misspelt word


getWordContext

public java.lang.String getWordContext()
Returns the context in which the misspelt word is used


getWordContextPosition

public int getWordContextPosition()
Returns the start position of the misspelt word in the context


getAction

public short getAction()

getReplaceWord

public java.lang.String getReplaceWord()

replaceWord

public void replaceWord(java.lang.String newWord,
                        boolean replaceAll)
Set the action to replace the currently misspelt word with the new word

Parameters:
newWord - The word to replace the currently misspelt word
replaceAll - If set to true, the SpellChecker will replace all further occurances of the misspelt word without firing a SpellCheckEvent.

ignoreWord

public void ignoreWord(boolean ignoreAll)
Set the action it ignore the currently misspelt word.

Parameters:
ignoreAll - If set to true, the SpellChecker will replace all further occurances of the misspelt word without firing a SpellCheckEvent.

addToDictionary

public void addToDictionary(java.lang.String newWord)
Set the action to add a new word into the dictionary. This will also replace the currently misspelt word.


cancel

public void cancel()
Set the action to terminate processing of the spellchecker.