SPT Core API

com.sptci.epng
Class SpellChecker

java.lang.Object
  extended by echopointng.richtext.AbstractRichTextSpellChecker
      extended by com.sptci.epng.SpellChecker
All Implemented Interfaces:
com.swabunga.spell.event.SpellCheckListener, RichTextSpellChecker, EventListener

public class SpellChecker
extends AbstractRichTextSpellChecker
implements com.swabunga.spell.event.SpellCheckListener

The spell checker used by RichTextArea. Acts as a decorator around a SpellChecker from the jazzy library.

Copyright 2006 Sans Pareil Technologies, Inc.

Version:
$Id: SpellChecker.java 4553 2008-12-24 10:34:16Z rakesh $
Author:
Rakesh Vidyadharan 2007-01-05

Nested Class Summary
 
Nested classes/interfaces inherited from interface echopointng.richtext.RichTextSpellChecker
RichTextSpellChecker.SpellCheckerWord
 
Method Summary
 String[] checkWord(String word)
          Check the specified word and return null or an array of alternative words.
static SpellChecker getInstance(Locale[] locales, String directory)
          Return the instance for the specified locales.
 void spellingError(com.swabunga.spell.event.SpellCheckEvent event)
          Implementation of the SpellCheckListner interface.
 
Methods inherited from class echopointng.richtext.AbstractRichTextSpellChecker
parseWords
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static SpellChecker getInstance(Locale[] locales,
                                       String directory)
                                throws IOException
Return the instance for the specified locales.

Parameters:
locales - The locales specified by the client.
directory - The directory in which the dictionary files are stored.
Returns:
The appropriate spell checker for the locale.
Throws:
IOException - If errors are encountered while attempting to read the dictionary files.
See Also:
loadDictionary(java.util.Locale, java.lang.String)

checkWord

public String[] checkWord(String word)
Check the specified word and return null or an array of alternative words.

Specified by:
checkWord in interface RichTextSpellChecker
Returns:
Any suggested corrections for the specified word. As specified in the contract in RichTextSpellChecker, this method returns null if the word is spelt properly, or an array of words that are alternatives (empty if no alternatives are known).

spellingError

public void spellingError(com.swabunga.spell.event.SpellCheckEvent event)
Implementation of the SpellCheckListner interface. Populates the suggestions with the suggestions available in the event.

Specified by:
spellingError in interface com.swabunga.spell.event.SpellCheckListener
Parameters:
event - The spell check event.

SPT Core API