java.lang.Object | ||
↳ | com.google.gwt.user.client.ui.SuggestOracle | |
↳ | com.google.gwt.user.client.ui.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 Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
MultiWordSuggestOracle.MultiWordSuggestion | Suggestion class for MultiWordSuggestOracle . |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructor for
MultiWordSuggestOracle . | |||||||||||
Constructor for
MultiWordSuggestOracle which takes in a set of
whitespace chars that filter its input. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a suggestion to the oracle.
| |||||||||||
Adds all suggestions specified.
| |||||||||||
Removes all of the suggestions from the oracle.
| |||||||||||
Should
SuggestOracle.Suggestion display strings be treated as HTML? If true, this
all suggestions' display strings will be interpreted as HTML, otherwise as
text. | |||||||||||
Generate a
SuggestOracle.Response based on a default request. | |||||||||||
Generate a
SuggestOracle.Response based on a specific SuggestOracle.Request . | |||||||||||
Sets the default suggestion collection.
| |||||||||||
A convenience method to set default suggestions using plain text strings.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates the suggestion based on the given replacement and display strings.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.SuggestOracle
| |||||||||||
From class
java.lang.Object
|
Constructor for MultiWordSuggestOracle
. This uses a space as
the whitespace character.
Constructor for 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 separators |
---|
Adds a suggestion to the oracle. Each suggestion must be plain text.
suggestion | the suggestion |
---|
Adds all suggestions specified. Each suggestion must be plain text.
collection | the collection |
---|
Removes all of the suggestions from the oracle.
Should SuggestOracle.Suggestion
display strings be treated as HTML? If true, this
all suggestions' display strings will be interpreted as HTML, otherwise as
text.
Generate a SuggestOracle.Response
based on a default request. The request query
must be null as it represents the results the oracle should return based on
no query string.
After the SuggestOracle.Response
is created, it is passed into
onSuggestionsReady(com.google.gwt.user.client.ui.SuggestOracle.Request, com.google.gwt.user.client.ui.SuggestOracle.Response)
.
request | the request |
---|---|
callback | the callback to use for the response |
Generate a SuggestOracle.Response
based on a specific SuggestOracle.Request
. After the
SuggestOracle.Response
is created, it is passed into
onSuggestionsReady(com.google.gwt.user.client.ui.SuggestOracle.Request, com.google.gwt.user.client.ui.SuggestOracle.Response)
.
request | the request |
---|---|
callback | the callback to use for the response |
Sets the default suggestion collection.
suggestionList | the default list of suggestions |
---|
A convenience method to set default suggestions using plain text strings. Note to use this method each default suggestion must be plain text.
suggestionList | the default list of suggestions |
---|
Creates the suggestion based on the given replacement and display strings.
replacementString | the string to enter into the SuggestBox's text box if the suggestion is chosen |
---|---|
displayString | the display string |