Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.plugin.spellcheck
Class SpellChecker

java.lang.Object
  extended by net.java.sip.communicator.plugin.spellcheck.SpellChecker
All Implemented Interfaces:
ChatListener

 class SpellChecker
extends Object
implements ChatListener

Model for spell checking capabilities. This allows for the on-demand retrieval of dictionaries in other languages which are cached with the user's configurations.

Author:
Damian Johnson, Lyubomir Marinov

Constructor Summary
SpellChecker()
           
 
Method Summary
 void chatClosed(Chat chat)
          Notifies this instance that a Chat has been closed.
 void chatCreated(Chat chat)
          Notifies this instance that a new Chat has been created.
(package private)  Parameters.Locale getLocale()
          Provides the locale of the dictionary currently being used by the spell checker.
(package private)  List<String> getPersonalWords()
          Provides the user's list of words to be ignored by the spell checker.
(package private)  boolean isEnabled()
           
(package private)  boolean isLocaleAvailable(Parameters.Locale locale)
          Determines if locale's dictionary is locally available or not.
(package private)  void removeLocale(Parameters.Locale locale)
          Removes the dictionary from the system, and sets the default locale dictionary as the current dictionary
(package private)  void setEnabled(boolean enabled)
           
(package private)  void setLocale(Parameters.Locale locale)
          Resets spell checker to use a different locale's dictionary.
(package private)  void setPersonalWords(List<String> words)
          Writes custom dictionary and updates spell checker to utilize new listing.
(package private)  void start(org.osgi.framework.BundleContext bc)
          Associates spell checking capabilities with all chats.
(package private)  void stop()
          Removes the spell checking capabilities from all chats.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpellChecker

SpellChecker()
Method Detail

start

void start(org.osgi.framework.BundleContext bc)
     throws Exception
Associates spell checking capabilities with all chats. This doesn't do anything if this is already running.

Parameters:
bc - execution context of the bundle
Throws:
Exception

stop

void stop()
Removes the spell checking capabilities from all chats. This doesn't do anything if this isn't running.


chatClosed

public void chatClosed(Chat chat)
Notifies this instance that a Chat has been closed.

Specified by:
chatClosed in interface ChatListener
Parameters:
chat - the Chat which has been closed

chatCreated

public void chatCreated(Chat chat)
Notifies this instance that a new Chat has been created. Attaches listeners to the new chat.

Specified by:
chatCreated in interface ChatListener
Parameters:
chat - the new Chat which has been created

getPersonalWords

List<String> getPersonalWords()
Provides the user's list of words to be ignored by the spell checker.

Returns:
user's word list

setPersonalWords

void setPersonalWords(List<String> words)
Writes custom dictionary and updates spell checker to utilize new listing.

Parameters:
words - words to be ignored by the spell checker

getLocale

Parameters.Locale getLocale()
Provides the locale of the dictionary currently being used by the spell checker.

Returns:
locale of current dictionary

setLocale

void setLocale(Parameters.Locale locale)
         throws Exception
Resets spell checker to use a different locale's dictionary. This uses the local copy of the dictionary if available, otherwise it's downloaded and saved for future use.

Parameters:
locale - locale of dictionary to be used
Throws:
Exception - problem occurring in utilizing locale's dictionary

removeLocale

void removeLocale(Parameters.Locale locale)
            throws Exception
Removes the dictionary from the system, and sets the default locale dictionary as the current dictionary

Parameters:
locale - locale to be removed
Throws:
Exception

isLocaleAvailable

boolean isLocaleAvailable(Parameters.Locale locale)
Determines if locale's dictionary is locally available or not.

Parameters:
locale - locale to be checked
Returns:
true if local resources for dictionary are available and accessible, false otherwise

isEnabled

boolean isEnabled()

setEnabled

void setEnabled(boolean enabled)

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.