|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.SuggestOracle
com.google.gwt.user.client.ui.MultiWordSuggestOracle
public final class MultiWordSuggestOracle
The default SuggestOracle
. The default
oracle returns potential suggestions based on breaking the query into
separate words and looking for matches. It also modifies the returned text to
show which prefix matched the query term. The matching is case insensitive.
All suggestions are sorted before being passed into a response.
Example Table
All Suggestions | Query string | Matching Suggestions |
John Smith, Joe Brown, Jane Doe, Jane Smith, Bob Jones | Jo | John Smith, Joe Brown, Bob Jones |
John Smith, Joe Brown, Jane Doe, Jane Smith, Bob Jones | Smith | John Smith, Jane Smith |
Georgia, New York, California | g | Georgia |
Nested Class Summary | |
---|---|
static class |
MultiWordSuggestOracle.MultiWordSuggestion
Suggestion class for MultiWordSuggestOracle . |
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.SuggestOracle |
---|
SuggestOracle.Callback, SuggestOracle.Request, SuggestOracle.Response, SuggestOracle.Suggestion |
Constructor Summary | |
---|---|
MultiWordSuggestOracle()
Constructor for MultiWordSuggestOracle . |
|
MultiWordSuggestOracle(java.lang.String whitespaceChars)
Constructor for MultiWordSuggestOracle which takes in a set
of whitespace chars that filter its input. |
Method Summary | |
---|---|
void |
add(java.lang.String suggestion)
Adds a suggestion to the oracle. |
void |
addAll(java.util.Collection collection)
Adds all suggestions specified. |
void |
clear()
Removes all of the suggestions from the oracle. |
boolean |
isDisplayStringHTML()
Should SuggestOracle.Suggestion display strings be treated as HTML? If true, this
all suggestions' display strings will be interpreted as HTML, otherwise as
text. |
void |
requestSuggestions(SuggestOracle.Request request,
SuggestOracle.Callback callback)
Generate a SuggestOracle.Response based on a specific SuggestOracle.Request . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultiWordSuggestOracle()
MultiWordSuggestOracle
. This uses a space as
the whitespace character.
MultiWordSuggestOracle(String)
public MultiWordSuggestOracle(java.lang.String whitespaceChars)
MultiWordSuggestOracle
which takes in a set
of whitespace chars that filter its input.
Example: If ".,"
is passed in as whitespace, then the string
"foo.bar" would match the queries "foo", "bar", "foo.bar", "foo...bar", and
"foo, bar". If the empty string is used, then all characters are used in
matching. For example, the query "bar" would match "bar", but not "foo
bar".
whitespaceChars
- the characters to treat as word separatorsMethod Detail |
---|
public void add(java.lang.String suggestion)
suggestion
- the suggestionpublic void addAll(java.util.Collection collection)
collection
- the collectionpublic void clear()
public boolean isDisplayStringHTML()
SuggestOracle
SuggestOracle.Suggestion
display strings be treated as HTML? If true, this
all suggestions' display strings will be interpreted as HTML, otherwise as
text.
isDisplayStringHTML
in class SuggestOracle
public void requestSuggestions(SuggestOracle.Request request, SuggestOracle.Callback callback)
SuggestOracle
SuggestOracle.Response
based on a specific SuggestOracle.Request
. After the
SuggestOracle.Response
is created, it is passed into
SuggestOracle.Callback.onSuggestionsReady(com.google.gwt.user.client.ui.SuggestOracle.Request, com.google.gwt.user.client.ui.SuggestOracle.Response)
.
requestSuggestions
in class SuggestOracle
request
- the requestcallback
- the callback to use for the response
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |