Package com.google.gwt.user.client.ui
Class AbstractSuggestBoxNewEditor.DefaultSuggestionDisplay
- java.lang.Object
-
- com.google.gwt.user.client.ui.AbstractSuggestBoxNewEditor.SuggestionDisplay
-
- com.google.gwt.user.client.ui.AbstractSuggestBoxNewEditor.DefaultSuggestionDisplay
-
- All Implemented Interfaces:
com.google.gwt.user.client.ui.HasAnimation
- Enclosing class:
- AbstractSuggestBoxNewEditor
public static class AbstractSuggestBoxNewEditor.DefaultSuggestionDisplay extends AbstractSuggestBoxNewEditor.SuggestionDisplay implements com.google.gwt.user.client.ui.HasAnimation
The default implementation of
AbstractSuggestBoxNewEditor.SuggestionDisplaydisplays suggestions in aPopupPanelbeneath theAbstractSuggestBoxNewEditor.CSS Style Rules
- .gwt-SuggestBoxPopup
- the suggestion popup
- .gwt-SuggestBoxPopup .item
- an unselected suggestion
- .gwt-SuggestBoxPopup .item-selected
- a selected suggestion
- .gwt-SuggestBoxPopup .suggestPopupTopLeft
- the top left cell
- .gwt-SuggestBoxPopup .suggestPopupTopLeftInner
- the inner element of the cell
- .gwt-SuggestBoxPopup .suggestPopupTopCenter
- the top center cell
- .gwt-SuggestBoxPopup .suggestPopupTopCenterInner
- the inner element of the cell
- .gwt-SuggestBoxPopup .suggestPopupTopRight
- the top right cell
- .gwt-SuggestBoxPopup .suggestPopupTopRightInner
- the inner element of the cell
- .gwt-SuggestBoxPopup .suggestPopupMiddleLeft
- the middle left cell
- .gwt-SuggestBoxPopup .suggestPopupMiddleLeftInner
- the inner element of the cell
- .gwt-SuggestBoxPopup .suggestPopupMiddleCenter
- the middle center cell
- .gwt-SuggestBoxPopup .suggestPopupMiddleCenterInner
- the inner element of the cell
- .gwt-SuggestBoxPopup .suggestPopupMiddleRight
- the middle right cell
- .gwt-SuggestBoxPopup .suggestPopupMiddleRightInner
- the inner element of the cell
- .gwt-SuggestBoxPopup .suggestPopupBottomLeft
- the bottom left cell
- .gwt-SuggestBoxPopup .suggestPopupBottomLeftInner
- the inner element of the cell
- .gwt-SuggestBoxPopup .suggestPopupBottomCenter
- the bottom center cell
- .gwt-SuggestBoxPopup .suggestPopupBottomCenterInner
- the inner element of the cell
- .gwt-SuggestBoxPopup .suggestPopupBottomRight
- the bottom right cell
- .gwt-SuggestBoxPopup .suggestPopupBottomRightInner
- the inner element of the cell
-
-
Constructor Summary
Constructors Constructor Description DefaultSuggestionDisplay()Construct a newAbstractSuggestBoxNewEditor.DefaultSuggestionDisplay.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.google.gwt.user.client.ui.PopupPanelcreatePopup()Create the PopupPanel that will hold the list of suggestions.protected com.google.gwt.user.client.ui.WidgetdecorateSuggestionList(com.google.gwt.user.client.ui.Widget suggestionList)Wrap the list of suggestions before adding it to the popup.protected com.google.gwt.user.client.ui.SuggestOracle.SuggestiongetCurrentSelection()Get the currently selectedSuggestOracle.Suggestionin the display.protected com.google.gwt.user.client.ui.PopupPanelgetPopupPanel()Get thePopupPanelused to display suggestions.protected com.google.gwt.user.client.ui.MenuBargetSuggestionMenu()Get theMenuBarused to display suggestions.voidhideSuggestions()Hide the list of suggestions from view.booleanisAnimationEnabled()booleanisSuggestionListHiddenWhenEmpty()Check whether or not the suggestion list is hidden when there are no suggestions to display.booleanisSuggestionListShowing()Check whether or not the list of suggestions is being shown.protected voidmoveSelectionDown()Highlight the suggestion directly below the current selection in the list.protected voidmoveSelectionUp()Highlight the suggestion directly above the current selection in the list.protected voidonEnsureDebugId(String baseID)Affected Elements. -popup = The popup that appears with suggestions. -item# = The suggested item at the specified index.voidsetAnimationEnabled(boolean enable)voidsetPopupStyleName(String style)Sets the style name of the suggestion popup.voidsetPositionRelativeTo(com.google.gwt.user.client.ui.UIObject uiObject)Sets the UI object where the suggestion display should appear next to.voidsetSuggestionListHiddenWhenEmpty(boolean hideWhenEmpty)Set whether or not the suggestion list should be hidden when there are no suggestions to display.protected 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.-
Methods inherited from class com.google.gwt.user.client.ui.AbstractSuggestBoxNewEditor.SuggestionDisplay
setMoreSuggestions
-
-
-
-
Constructor Detail
-
DefaultSuggestionDisplay
public DefaultSuggestionDisplay()
Construct a newAbstractSuggestBoxNewEditor.DefaultSuggestionDisplay.
-
-
Method Detail
-
hideSuggestions
public void hideSuggestions()
Description copied from class:AbstractSuggestBoxNewEditor.SuggestionDisplayHide the list of suggestions from view.- Specified by:
hideSuggestionsin classAbstractSuggestBoxNewEditor.SuggestionDisplay
-
isAnimationEnabled
public boolean isAnimationEnabled()
- Specified by:
isAnimationEnabledin interfacecom.google.gwt.user.client.ui.HasAnimation
-
isSuggestionListHiddenWhenEmpty
public boolean isSuggestionListHiddenWhenEmpty()
Check whether or not the suggestion list is hidden when there are no suggestions to display.- Returns:
- true if hidden when empty, false if not
-
isSuggestionListShowing
public boolean isSuggestionListShowing()
Description copied from class:AbstractSuggestBoxNewEditor.SuggestionDisplayCheck whether or not the list of suggestions is being shown.- Overrides:
isSuggestionListShowingin classAbstractSuggestBoxNewEditor.SuggestionDisplay- Returns:
- true if the suggestions are visible, false if not
-
setAnimationEnabled
public void setAnimationEnabled(boolean enable)
- Specified by:
setAnimationEnabledin interfacecom.google.gwt.user.client.ui.HasAnimation
-
setPopupStyleName
public void setPopupStyleName(String style)
Sets the style name of the suggestion popup.- Parameters:
style- the new primary style name- See Also:
UIObject.setStyleName(String)
-
setPositionRelativeTo
public void setPositionRelativeTo(com.google.gwt.user.client.ui.UIObject uiObject)
Sets the UI object where the suggestion display should appear next to.- Parameters:
uiObject- the uiObject used for positioning, or null to position relative to the suggest box
-
setSuggestionListHiddenWhenEmpty
public void setSuggestionListHiddenWhenEmpty(boolean hideWhenEmpty)
Set whether or not the suggestion list should be hidden when there are no suggestions to display. Defaults to true.- Parameters:
hideWhenEmpty- true to hide when empty, false not to
-
createPopup
protected com.google.gwt.user.client.ui.PopupPanel createPopup()
Create the PopupPanel that will hold the list of suggestions.- Returns:
- the popup panel
-
decorateSuggestionList
protected com.google.gwt.user.client.ui.Widget decorateSuggestionList(com.google.gwt.user.client.ui.Widget suggestionList)
Wrap the list of suggestions before adding it to the popup. You can override this method if you want to wrap the suggestion list in a decorator.- Parameters:
suggestionList- the widget that contains the list of suggestions- Returns:
- the suggestList, optionally inside of a wrapper
-
getCurrentSelection
protected com.google.gwt.user.client.ui.SuggestOracle.Suggestion getCurrentSelection()
Description copied from class:AbstractSuggestBoxNewEditor.SuggestionDisplayGet the currently selectedSuggestOracle.Suggestionin the display.- Specified by:
getCurrentSelectionin classAbstractSuggestBoxNewEditor.SuggestionDisplay- Returns:
- the current suggestion, or null if none selected
-
getPopupPanel
protected com.google.gwt.user.client.ui.PopupPanel getPopupPanel()
Get thePopupPanelused to display suggestions.- Returns:
- the popup panel
-
getSuggestionMenu
protected com.google.gwt.user.client.ui.MenuBar getSuggestionMenu()
Get theMenuBarused to display suggestions.- Returns:
- the suggestions menu
-
moveSelectionDown
protected void moveSelectionDown()
Description copied from class:AbstractSuggestBoxNewEditor.SuggestionDisplayHighlight the suggestion directly below the current selection in the list.- Specified by:
moveSelectionDownin classAbstractSuggestBoxNewEditor.SuggestionDisplay
-
moveSelectionUp
protected void moveSelectionUp()
Description copied from class:AbstractSuggestBoxNewEditor.SuggestionDisplayHighlight the suggestion directly above the current selection in the list.- Specified by:
moveSelectionUpin classAbstractSuggestBoxNewEditor.SuggestionDisplay
-
onEnsureDebugId
protected void onEnsureDebugId(String baseID)
Affected Elements.- -popup = The popup that appears with suggestions.
- -item# = The suggested item at the specified index.
- Overrides:
onEnsureDebugIdin classAbstractSuggestBoxNewEditor.SuggestionDisplay- Parameters:
baseID- the baseID of theAbstractSuggestBoxNewEditor- See Also:
UIObject.onEnsureDebugId(String)
-
showSuggestions
protected void showSuggestions(AbstractSuggestBoxNewEditor suggestBox, Collection<? extends com.google.gwt.user.client.ui.SuggestOracle.Suggestion> suggestions, boolean isDisplayStringHtml, boolean isAutoSelectEnabled, AbstractSuggestBoxNewEditor.SuggestionCallback callback)
Description copied from class:AbstractSuggestBoxNewEditor.SuggestionDisplayUpdate the list of visible suggestions.Use care when using isDisplayStringHtml; it is an easy way to expose script-based security problems.
- Specified by:
showSuggestionsin classAbstractSuggestBoxNewEditor.SuggestionDisplay- 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
-
-