com.xpn.xwiki.gwt.api.client.widgets
Class WordListSuggestOracle

java.lang.Object
  extended by com.google.gwt.user.client.ui.SuggestOracle
      extended by com.xpn.xwiki.gwt.api.client.widgets.WordListSuggestOracle

public class WordListSuggestOracle
extends com.google.gwt.user.client.ui.SuggestOracle

SuggestOracle to suggest a list of words with respect to a given list of separators. The SuggestOracle used for a single word suggestion is set through setWordOracle(com.google.gwt.user.client.ui.SuggestOracle) and the separators through setSeparators(String). Whether this oracle generates unique suggestions with respect to the already typed list, can be configured through WordListSuggestOracle#isSuggestUnique().


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.SuggestOracle
com.google.gwt.user.client.ui.SuggestOracle.Callback, com.google.gwt.user.client.ui.SuggestOracle.Request, com.google.gwt.user.client.ui.SuggestOracle.Response, com.google.gwt.user.client.ui.SuggestOracle.Suggestion
 
Field Summary
protected  java.lang.String separators
          multiple words separator
protected  boolean suggestUnique
          whether this oracle omits words that already are in the typed list or not
protected  com.google.gwt.user.client.ui.SuggestOracle wordOracle
          oracle to use for suggesting a single word
 
Constructor Summary
WordListSuggestOracle()
          Default constructor: builds an oracle with an empty SuggestOracle and the space as a separator.
WordListSuggestOracle(com.google.gwt.user.client.ui.SuggestOracle wordOracle)
          Builds an oracle with the specified SuggestOracle and the space as a default separator.
WordListSuggestOracle(com.google.gwt.user.client.ui.SuggestOracle wordOracle, java.lang.String separators)
          Builds an wordOracle with the specified SuggestOracle and separators.
WordListSuggestOracle(com.google.gwt.user.client.ui.SuggestOracle wordOracle, java.lang.String separators, boolean suggestUnique)
          Builds an wordOracle with the specified SuggestOracle, separators and specifying weather it suggests words that are already in the list or not.
 
Method Summary
 java.lang.String getSeparators()
           
 boolean getSuggestUnique()
           
 com.google.gwt.user.client.ui.SuggestOracle getWordOracle()
           
 boolean isDisplayStringHTML()
           
protected  java.util.Set parseQueryString(java.lang.String queryString)
          Parses the passed query string into a list of tokens, based on the instance separators.
 void requestSuggestions(com.google.gwt.user.client.ui.SuggestOracle.Request request, com.google.gwt.user.client.ui.SuggestOracle.Callback callback)
          Returns a list of suggestions for the last word in the list.
 void setSeparators(java.lang.String separators)
           
 void setSuggestUnique(boolean suggestUnique)
           
 void setWordOracle(com.google.gwt.user.client.ui.SuggestOracle wordOracle)
           
 
Methods inherited from class com.google.gwt.user.client.ui.SuggestOracle
requestDefaultSuggestions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wordOracle

protected com.google.gwt.user.client.ui.SuggestOracle wordOracle
oracle to use for suggesting a single word


separators

protected java.lang.String separators
multiple words separator


suggestUnique

protected boolean suggestUnique
whether this oracle omits words that already are in the typed list or not

Constructor Detail

WordListSuggestOracle

public WordListSuggestOracle()
Default constructor: builds an oracle with an empty SuggestOracle and the space as a separator. By default, this oracle generates suggestions that duplicate existing words in the list.


WordListSuggestOracle

public WordListSuggestOracle(com.google.gwt.user.client.ui.SuggestOracle wordOracle)
Builds an oracle with the specified SuggestOracle and the space as a default separator. By default, this oracle generates suggestions that duplicate existing words in the list.

Parameters:
wordOracle - the oracle to be used for predicting a single word.

WordListSuggestOracle

public WordListSuggestOracle(com.google.gwt.user.client.ui.SuggestOracle wordOracle,
                             java.lang.String separators)
Builds an wordOracle with the specified SuggestOracle and separators. By default, this oracle generates suggestions that duplicate existing words in the list.

Parameters:
wordOracle - the wordOracle to be used for predicting a single word
separators - the separators between the words in the word list

WordListSuggestOracle

public WordListSuggestOracle(com.google.gwt.user.client.ui.SuggestOracle wordOracle,
                             java.lang.String separators,
                             boolean suggestUnique)
Builds an wordOracle with the specified SuggestOracle, separators and specifying weather it suggests words that are already in the list or not.

Parameters:
wordOracle - the wordOracle to be used for predicting a single word
separators - the separators between the words in the word list
Method Detail

requestSuggestions

public void requestSuggestions(com.google.gwt.user.client.ui.SuggestOracle.Request request,
                               com.google.gwt.user.client.ui.SuggestOracle.Callback callback)
Returns a list of suggestions for the last word in the list.

Specified by:
requestSuggestions in class com.google.gwt.user.client.ui.SuggestOracle
Parameters:
request -
callback -

parseQueryString

protected java.util.Set parseQueryString(java.lang.String queryString)
Parses the passed query string into a list of tokens, based on the instance separators.

Parameters:
queryString - the string to parse
Returns:
the list of words, excluding empty words and duplicates

getSeparators

public java.lang.String getSeparators()

setSeparators

public void setSeparators(java.lang.String separators)

isDisplayStringHTML

public boolean isDisplayStringHTML()
Overrides:
isDisplayStringHTML in class com.google.gwt.user.client.ui.SuggestOracle

getWordOracle

public com.google.gwt.user.client.ui.SuggestOracle getWordOracle()

setWordOracle

public void setWordOracle(com.google.gwt.user.client.ui.SuggestOracle wordOracle)

getSuggestUnique

public boolean getSuggestUnique()

setSuggestUnique

public void setSuggestUnique(boolean suggestUnique)


Copyright © 2004-2009 XWiki. All Rights Reserved.