public static class SuggestBox.DefaultSuggestionDisplay extends SuggestBox.SuggestionDisplay implements HasAnimation
The default implementation of SuggestBox.SuggestionDisplay displays
suggestions in a PopupPanel beneath the SuggestBox.
| Constructor and Description |
|---|
DefaultSuggestionDisplay()
Construct a new
SuggestBox.DefaultSuggestionDisplay. |
| Modifier and Type | Method and Description |
|---|---|
protected PopupPanel |
createPopup()
Create the PopupPanel that will hold the list of suggestions.
|
protected Widget |
decorateSuggestionList(Widget suggestionList)
Wrap the list of suggestions before adding it to the popup.
|
protected SuggestOracle.Suggestion |
getCurrentSelection()
Get the currently selected
SuggestOracle.Suggestion in the display. |
protected PopupPanel |
getPopupPanel()
Get the
PopupPanel used to display suggestions. |
protected MenuBar |
getSuggestionMenu()
Get the
MenuBar used to display suggestions. |
void |
hideSuggestions()
Hide the list of suggestions from view.
|
boolean |
isAnimationEnabled()
Returns true if animations are enabled, false if not.
|
(package private) boolean |
isAnimationEnabledImpl()
This is here for legacy reasons.
|
boolean |
isSuggestionListHiddenWhenEmpty()
Check whether or not the suggestion list is hidden when there are no
suggestions to display.
|
boolean |
isSuggestionListShowing()
Check whether or not the list of suggestions is being shown.
|
protected void |
moveSelectionDown()
Highlight the suggestion directly below the current selection in the
list.
|
protected void |
moveSelectionUp()
Highlight the suggestion directly above the current selection in the
list.
|
protected void |
onEnsureDebugId(java.lang.String baseID)
Affected Elements:
-popup = The popup that appears with suggestions.
-item# = The suggested item at the specified index.
|
void |
setAnimationEnabled(boolean enable)
Enable or disable animations.
|
(package private) void |
setAnimationEnabledImpl(boolean enable)
This is here for legacy reasons.
|
void |
setPopupStyleName(java.lang.String style)
Sets the style name of the suggestion popup.
|
(package private) void |
setPopupStyleNameImpl(java.lang.String style)
This is here for legacy reasons.
|
void |
setPositionRelativeTo(UIObject uiObject)
Sets the UI object where the suggestion display should appear next to.
|
void |
setSuggestionListHiddenWhenEmpty(boolean hideWhenEmpty)
Set whether or not the suggestion list should be hidden when there are
no suggestions to display.
|
protected void |
showSuggestions(SuggestBox suggestBox,
java.util.Collection<? extends SuggestOracle.Suggestion> suggestions,
boolean isDisplayStringHTML,
boolean isAutoSelectEnabled,
SuggestBox.SuggestionCallback callback)
Update the list of visible suggestions.
|
setMoreSuggestionspublic DefaultSuggestionDisplay()
SuggestBox.DefaultSuggestionDisplay.public void hideSuggestions()
SuggestBox.SuggestionDisplayhideSuggestions in class SuggestBox.SuggestionDisplaypublic boolean isAnimationEnabled()
HasAnimationisAnimationEnabled in interface HasAnimationpublic boolean isSuggestionListHiddenWhenEmpty()
public boolean isSuggestionListShowing()
SuggestBox.SuggestionDisplayisSuggestionListShowing in class SuggestBox.SuggestionDisplaypublic void setAnimationEnabled(boolean enable)
HasAnimationsetAnimationEnabled in interface HasAnimationenable - true to enable, false to disablepublic void setPopupStyleName(java.lang.String style)
style - the new primary style nameUIObject.setStyleName(String)public void setPositionRelativeTo(UIObject uiObject)
uiObject - the uiObject used for positioning, or null to position
relative to the suggest boxpublic void setSuggestionListHiddenWhenEmpty(boolean hideWhenEmpty)
hideWhenEmpty - true to hide when empty, false not toprotected PopupPanel createPopup()
protected Widget decorateSuggestionList(Widget suggestionList)
suggestionList - the widget that contains the list of suggestionsprotected SuggestOracle.Suggestion getCurrentSelection()
SuggestBox.SuggestionDisplaySuggestOracle.Suggestion in the display.getCurrentSelection in class SuggestBox.SuggestionDisplayprotected PopupPanel getPopupPanel()
PopupPanel used to display suggestions.protected MenuBar getSuggestionMenu()
MenuBar used to display suggestions.protected void moveSelectionDown()
SuggestBox.SuggestionDisplaymoveSelectionDown in class SuggestBox.SuggestionDisplayprotected void moveSelectionUp()
SuggestBox.SuggestionDisplaymoveSelectionUp in class SuggestBox.SuggestionDisplayprotected void onEnsureDebugId(java.lang.String baseID)
onEnsureDebugId in class SuggestBox.SuggestionDisplaybaseID - the baseID of the SuggestBoxUIObject.onEnsureDebugId(String)protected void showSuggestions(SuggestBox suggestBox, java.util.Collection<? extends SuggestOracle.Suggestion> suggestions, boolean isDisplayStringHTML, boolean isAutoSelectEnabled, SuggestBox.SuggestionCallback callback)
SuggestBox.SuggestionDisplayshowSuggestions in class SuggestBox.SuggestionDisplaysuggestBox - 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 suggestionboolean isAnimationEnabledImpl()
SuggestBox.SuggestionDisplayisAnimationEnabledImpl in class SuggestBox.SuggestionDisplayvoid setAnimationEnabledImpl(boolean enable)
SuggestBox.SuggestionDisplaysetAnimationEnabledImpl in class SuggestBox.SuggestionDisplayenable - true to enable animationvoid setPopupStyleNameImpl(java.lang.String style)
SuggestBox.SuggestionDisplaysetPopupStyleNameImpl in class SuggestBox.SuggestionDisplaystyle - the style name