Package com.google.gwt.user.client.ui
Class AbstractSuggestBoxNewEditor.SuggestionDisplay
java.lang.Object
com.google.gwt.user.client.ui.AbstractSuggestBoxNewEditor.SuggestionDisplay
- Direct Known Subclasses:
AbstractSuggestBoxNewEditor.DefaultSuggestionDisplay
- Enclosing class:
- AbstractSuggestBoxNewEditor
Used to display suggestions to the user.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract com.google.gwt.user.client.ui.SuggestOracle.SuggestionGet the currently selectedSuggestOracle.Suggestionin the display.protected abstract voidHide the list of suggestions from view.booleanCheck 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.protected voidsetMoreSuggestions(boolean hasMoreSuggestions, int numMoreSuggestions) Accepts information about whether there were more suggestions matching than were provided toshowSuggestions(com.google.gwt.user.client.ui.AbstractSuggestBoxNewEditor, java.util.Collection<? extends com.google.gwt.user.client.ui.SuggestOracle.Suggestion>, boolean, boolean, com.google.gwt.user.client.ui.AbstractSuggestBoxNewEditor.SuggestionCallback).protected abstract voidshowSuggestions(AbstractSuggestBoxNewEditor suggestBox, Collection<? extends com.google.gwt.user.client.ui.SuggestOracle.Suggestion> suggestions, boolean isDisplayStringHtml, boolean isAutoSelectEnabled, AbstractSuggestBoxNewEditor.SuggestionCallback callback) Update the list of visible suggestions.
-
Constructor Details
-
SuggestionDisplay
public SuggestionDisplay()
-
-
Method Details
-
getCurrentSelection
protected abstract com.google.gwt.user.client.ui.SuggestOracle.Suggestion 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 theAbstractSuggestBoxNewEditor- See Also:
-
UIObject.onEnsureDebugId(String)
-
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.AbstractSuggestBoxNewEditor, java.util.Collection<? extends com.google.gwt.user.client.ui.SuggestOracle.Suggestion>, boolean, boolean, com.google.gwt.user.client.ui.AbstractSuggestBoxNewEditor.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(AbstractSuggestBoxNewEditor suggestBox, Collection<? extends com.google.gwt.user.client.ui.SuggestOracle.Suggestion> suggestions, boolean isDisplayStringHtml, boolean isAutoSelectEnabled, AbstractSuggestBoxNewEditor.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
-
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
-