net.rim.blackberry.api.spellcheck
Class AbstractSpellCheckUIListener

java.lang.Object
  extended by net.rim.blackberry.api.spellcheck.AbstractSpellCheckUIListener
All Implemented Interfaces:
SpellCheckUIListener

public abstract class AbstractSpellCheckUIListener
extends Object
implements SpellCheckUIListener

An empty implementation of SpellCheckUIListener.

For convenience, applications can extend this class and override only the methods defined in SpellCheckUIListener that are desired.

Since:
BlackBerry API 4.5.0

Field Summary
 
Fields inherited from interface net.rim.blackberry.api.spellcheck.SpellCheckUIListener
ACTION_ADD_TO_DICTIONARY, ACTION_CANCEL, ACTION_CHANGED, ACTION_IGNORE_ALL, ACTION_IGNORE_ONCE, ACTION_OPEN_UI, LEARNING_ACCEPT, LEARNING_REJECT, REASON_HOLSTERED, REASON_LOCKED, REASON_UNKNOWN, REASON_USER_CANCELLED
 
Constructor Summary
protected AbstractSpellCheckUIListener()
          Creates a new AbstractSpellCheckUIListener object.
 
Method Summary
 boolean generatedSpellingCandidates(SpellCheckUI ui, Field field, int offset, int len, StringBuffer suggestions)
          The implementation of this method does nothing and returns false.
 boolean generatingSpellingCandidates(SpellCheckUI ui, Field field, int offset, int len, StringBuffer suggestions)
          The implementation of this method does nothing and returns false.
 int misspelledWordFound(SpellCheckUI ui, Field field, int offset, int len)
          The implementation of this method does nothing and returns ACTION_OPEN_UI.
 int repeatedWordsFound(SpellCheckUI ui, Field field, int offset, int len)
          The implementation of this method does nothing and returns ACTION_OPEN_UI.
 void spellCheckCompleted(SpellCheckUI ui, Field field, int status, int reason)
          The implementation of this method does nothing.
 boolean spellCheckStarted(SpellCheckUI ui, Field field)
          The implementation of this method does nothing and returns true.
 int wordCorrectionLearned(SpellCheckUI ui, StringBuffer word, StringBuffer correction)
          The implementation of this method does nothing and returns LEARNING_ACCEPT.
 int wordIgnored(SpellCheckUI ui, StringBuffer word, boolean ignoreAll)
          The implementation of this method does nothing and returns -1.
 int wordLearned(SpellCheckUI ui, StringBuffer word)
          The implementation of this method does nothing and returns LEARNING_ACCEPT.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

AbstractSpellCheckUIListener

protected AbstractSpellCheckUIListener()
Creates a new AbstractSpellCheckUIListener object.

The implementation of this method does nothing.

Since:
BlackBerry API 4.5.0


Method Detail

spellCheckStarted

public boolean spellCheckStarted(SpellCheckUI ui,
                                 Field field)
The implementation of this method does nothing and returns true.

Specified by:
spellCheckStarted in interface SpellCheckUIListener
Parameters:
ui - the SpellCheckUI that caused this method invocation.
field - the field about to be spell checked.
Returns:
unconditionally returns true to indicate that spell checking should proceed.
Since:
BlackBerry API 4.5.0

spellCheckCompleted

public void spellCheckCompleted(SpellCheckUI ui,
                                Field field,
                                int status,
                                int reason)
The implementation of this method does nothing.

Specified by:
spellCheckCompleted in interface SpellCheckUIListener
Parameters:
ui - the SpellCheckUI that caused this method invocation.
field - the field that was spell checked. If the field is null then all fields for a particular SpellCheckUI spell check session has been processed.
status - the result of the spell checking of the field.
reason - the reason for abnormal completion when spell checking the field.
See Also:
SpellCheckUIListener.REASON_UNKNOWN, SpellCheckUIListener.REASON_USER_CANCELLED, SpellCheckUIListener.REASON_HOLSTERED, SpellCheckUIListener.REASON_LOCKED
Since:
BlackBerry API 4.5.0

misspelledWordFound

public int misspelledWordFound(SpellCheckUI ui,
                               Field field,
                               int offset,
                               int len)
The implementation of this method does nothing and returns ACTION_OPEN_UI.

Specified by:
misspelledWordFound in interface SpellCheckUIListener
Parameters:
ui - the SpellCheckUI that caused this method invocation.
field - the field whose text contains the the misspelled word.
offset - the offset of the misspelled word in the field.
len - the length of the misspelled word.
Returns:
SpellCheckUIListener.ACTION_OPEN_UI to indicate that the user should be presented with the built-in user interface for handling this event.
Since:
BlackBerry API 4.5.0

repeatedWordsFound

public int repeatedWordsFound(SpellCheckUI ui,
                              Field field,
                              int offset,
                              int len)
The implementation of this method does nothing and returns ACTION_OPEN_UI.

Specified by:
repeatedWordsFound in interface SpellCheckUIListener
Parameters:
ui - the SpellCheckUI that caused this method invocation.
field - the field whose text contains the the repeated word.
offset - the offset of the first character of the first of the two repeated words in the field.
len - the length of the text containing the two repeated words.
Returns:
SpellCheckUIListener.ACTION_OPEN_UI to indicate that the user should be presented with the built-in user interface for handling this event.
Since:
BlackBerry API 4.5.0

generatingSpellingCandidates

public boolean generatingSpellingCandidates(SpellCheckUI ui,
                                            Field field,
                                            int offset,
                                            int len,
                                            StringBuffer suggestions)
The implementation of this method does nothing and returns false.

Specified by:
generatingSpellingCandidates in interface SpellCheckUIListener
Parameters:
ui - the SpellCheckUI that caused this method invocation.
field - the field whose text contains the the misspelled word.
offset - the offset of the misspelled word in the field.
len - the length of the misspelled word.
suggestions - container for storing spelling suggestions provided by this method; the first suggestion must be appended without prepending the null character but subsequent spelling suggestions must be separated from the previous suggestions with the null character.
Returns:
false to indicate that the method did not modify the provided list of suggestions.
Since:
BlackBerry API 4.5.0

generatedSpellingCandidates

public boolean generatedSpellingCandidates(SpellCheckUI ui,
                                           Field field,
                                           int offset,
                                           int len,
                                           StringBuffer suggestions)
The implementation of this method does nothing and returns false.

Specified by:
generatedSpellingCandidates in interface SpellCheckUIListener
Parameters:
ui - the SpellCheckUI that caused this method invocation.
field - the field whose text contains the the misspelled word.
offset - the offset of the misspelled word in the field.
len - the length of the misspelled word.
suggestions - the list of suggestions about to be presented to the user, separated by the null character.
Returns:
false to indicate that the method did not modify the provided list of suggestions.
Since:
BlackBerry API 4.5.0

wordIgnored

public int wordIgnored(SpellCheckUI ui,
                       StringBuffer word,
                       boolean ignoreAll)
The implementation of this method does nothing and returns -1.

Specified by:
wordIgnored in interface SpellCheckUIListener
Parameters:
ui - the SpellCheckUI that caused this method invocation.
word - the misspelled word
Returns:
-1 since the return value is ignored.
Since:
BlackBerry API 4.5.0

wordLearned

public int wordLearned(SpellCheckUI ui,
                       StringBuffer word)
The implementation of this method does nothing and returns LEARNING_ACCEPT.

Specified by:
wordLearned in interface SpellCheckUIListener
Parameters:
ui - the SpellCheckUI that caused this method invocation.
word - the learned word
Returns:
SpellCheckUIListener.LEARNING_ACCEPT to indicate that the specified word learning should be accepted.
Since:
BlackBerry API 4.5.0

wordCorrectionLearned

public int wordCorrectionLearned(SpellCheckUI ui,
                                 StringBuffer word,
                                 StringBuffer correction)
The implementation of this method does nothing and returns LEARNING_ACCEPT.

Specified by:
wordCorrectionLearned in interface SpellCheckUIListener
Parameters:
ui - the SpellCheckUI that caused this method invocation.
word - the misspelled word
correction - the learned correction to the misspelled word
Returns:
SpellCheckUIListener.LEARNING_ACCEPT to indicate that the specified correction should be accepted.
Since:
BlackBerry API 4.5.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal