Class MultiWordSuggestOracle

java.lang.Object
com.google.gwt.user.client.ui.SuggestOracle
com.google.gwt.user.client.ui.MultiWordSuggestOracle

public class MultiWordSuggestOracle extends SuggestOracle
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

  • Constructor Details

    • MultiWordSuggestOracle

      public MultiWordSuggestOracle()
      Constructor for MultiWordSuggestOracle. This uses a space as the whitespace character.
      See Also:
    • MultiWordSuggestOracle

      public MultiWordSuggestOracle(String whitespaceChars)
      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".

      Parameters:
      whitespaceChars - the characters to treat as word separators
  • Method Details