Package com.google.gwt.user.client.ui
Class SuggestBox.SuggestionDisplay
java.lang.Object
com.google.gwt.user.client.ui.SuggestBox.SuggestionDisplay
- Direct Known Subclasses:
SuggestBox.DefaultSuggestionDisplay
- Enclosing class:
SuggestBox
Used to display suggestions to the user.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract SuggestOracle.SuggestionGet the currently selectedSuggestOracle.Suggestionin the display.protected abstract voidHide the list of suggestions from view.(package private) booleanDeprecated.implemented in DefaultSuggestionDisplaybooleanCheck whether or not the list of suggestions is being shown.protected abstract voidHighlight the suggestion directly below the current selection in the list.protected abstract voidHighlight the suggestion directly above the current selection in the list.protected voidonEnsureDebugId(String suggestBoxBaseID) Set the debug id of widgets used in the SuggestionDisplay.(package private) voidsetAnimationEnabledImpl(boolean enable) Deprecated.implemented in DefaultSuggestionDisplayprotected voidsetMoreSuggestions(boolean hasMoreSuggestions, int numMoreSuggestions) Accepts information about whether there were more suggestions matching than were provided toshowSuggestions(com.google.gwt.user.client.ui.SuggestBox, java.util.Collection<? extends com.google.gwt.user.client.ui.SuggestOracle.Suggestion>, boolean, boolean, com.google.gwt.user.client.ui.SuggestBox.SuggestionCallback).(package private) voidsetPopupStyleNameImpl(String style) Deprecated.implemented in DefaultSuggestionDisplayprotected abstract voidshowSuggestions(SuggestBox suggestBox, Collection<? extends SuggestOracle.Suggestion> suggestions, boolean isDisplayStringHTML, boolean isAutoSelectEnabled, SuggestBox.SuggestionCallback callback) Update the list of visible suggestions.
-
Constructor Details
-
SuggestionDisplay
public SuggestionDisplay()
-
-
Method Details
-
getCurrentSelection
Get the currently selectedSuggestOracle.Suggestionin the display.- Returns:
- the current suggestion, or null if none selected
-
hideSuggestions
protected abstract void hideSuggestions()Hide the list of suggestions from view. -
moveSelectionDown
protected abstract void moveSelectionDown()Highlight the suggestion directly below the current selection in the list. -
moveSelectionUp
protected abstract void moveSelectionUp()Highlight the suggestion directly above the current selection in the list. -
onEnsureDebugId
Set the debug id of widgets used in the SuggestionDisplay.- Parameters:
suggestBoxBaseID- the baseID of theSuggestBox- See Also:
-
setMoreSuggestions
protected void setMoreSuggestions(boolean hasMoreSuggestions, int numMoreSuggestions) Accepts information about whether there were more suggestions matching than were provided toshowSuggestions(com.google.gwt.user.client.ui.SuggestBox, java.util.Collection<? extends com.google.gwt.user.client.ui.SuggestOracle.Suggestion>, boolean, boolean, com.google.gwt.user.client.ui.SuggestBox.SuggestionCallback).- Parameters:
hasMoreSuggestions- true if more matches were availablenumMoreSuggestions- number of more matches available. If the specific number is unknown, 0 will be passed.
-
showSuggestions
protected abstract void showSuggestions(SuggestBox suggestBox, Collection<? extends SuggestOracle.Suggestion> suggestions, boolean isDisplayStringHTML, boolean isAutoSelectEnabled, SuggestBox.SuggestionCallback callback) Update the list of visible suggestions. Use care when using isDisplayStringHtml; it is an easy way to expose script-based security problems.- Parameters:
suggestBox- the suggest box where the suggestions originatedsuggestions- the suggestions to showisDisplayStringHTML- should the suggestions be displayed as HTMLisAutoSelectEnabled- if true, the first item should be selected automaticallycallback- the callback used when the user makes a suggestion
-
isAnimationEnabledImpl
Deprecated.implemented in DefaultSuggestionDisplayThis is here for legacy reasons. It is intentionally not visible. -
isSuggestionListShowing
public boolean isSuggestionListShowing()Check whether or not the list of suggestions is being shown.- Returns:
- true if the suggestions are visible, false if not
-
setAnimationEnabledImpl
Deprecated.implemented in DefaultSuggestionDisplayThis is here for legacy reasons. It is intentionally not visible.- Parameters:
enable- true to enable animation
-
setPopupStyleNameImpl
Deprecated.implemented in DefaultSuggestionDisplayThis is here for legacy reasons. It is intentionally not visible.- Parameters:
style- the style name
-