Interface SpellCheckEvent


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

As far as I know, we will only require one implementation of the SpellCheckEvent (BasicSpellCheckEvent) but I have defined this interface just in case. The BasicSpellCheckEvent implementation is currently package private.

Author:
Jason Height (jheight@chariot.net.au)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final short
    Field indicating that the incorrect word should be added to the dictionary
    static final short
    Field indicating that the spell checking should be terminated
    static final short
    Field indicating that the incorrect word should be ignored
    static final short
    Field indicating that the incorrect word should be ignored forever
    static final short
    Initial case for the action
    static final short
    Field indicating that the incorrect word should be replaced
    static final short
    Field indicating that the incorrect word should be replaced always
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Set the action to add a new word into the dictionary.
    void
    Set the action to terminate processing of the spell checker.
    short
    Returns the action type the user has to handle
    Returns the currently misspelt word
    Returns the text to replace
    Returns the list of suggested Word objects
    Returns the context in which the misspelt word is used
    int
    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(String newWord, boolean replaceAll)
    Set the action to replace the currently misspelt word with the new word
  • Field Details

    • IGNORE

      static final short IGNORE
      Field indicating that the incorrect word should be ignored
      See Also:
    • IGNOREALL

      static final short IGNOREALL
      Field indicating that the incorrect word should be ignored forever
      See Also:
    • REPLACE

      static final short REPLACE
      Field indicating that the incorrect word should be replaced
      See Also:
    • REPLACEALL

      static final short REPLACEALL
      Field indicating that the incorrect word should be replaced always
      See Also:
    • ADDTODICT

      static final short ADDTODICT
      Field indicating that the incorrect word should be added to the dictionary
      See Also:
    • CANCEL

      static final short CANCEL
      Field indicating that the spell checking should be terminated
      See Also:
    • INITIAL

      static final short INITIAL
      Initial case for the action
      See Also:
  • Method Details

    • getSuggestions

      List getSuggestions()
      Returns the list of suggested Word objects
      Returns:
      A list of words phonetically close to the misspelt word
    • getInvalidWord

      String getInvalidWord()
      Returns the currently misspelt word
      Returns:
      The text misspelt
    • getWordContext

      String getWordContext()
      Returns the context in which the misspelt word is used
      Returns:
      The text containing the context
    • getWordContextPosition

      int getWordContextPosition()
      Returns the start position of the misspelt word in the context
      Returns:
      The position of the word
    • getAction

      short getAction()
      Returns the action type the user has to handle
      Returns:
      The type of action the event is carrying
    • getReplaceWord

      String getReplaceWord()
      Returns the text to replace
      Returns:
      the text of the word to replace
    • replaceWord

      void replaceWord(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 occurrences of the misspelt word without firing a SpellCheckEvent.
    • ignoreWord

      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 occurrences of the misspelt word without firing a SpellCheckEvent.
    • addToDictionary

      void addToDictionary(String newWord)
      Set the action to add a new word into the dictionary. This will also replace the currently misspelt word.
      Parameters:
      newWord - The new word to add
    • cancel

      void cancel()
      Set the action to terminate processing of the spell checker.