Class SuggestBox.SuggestionDisplay

java.lang.Object
com.google.gwt.user.client.ui.SuggestBox.SuggestionDisplay
Direct Known Subclasses:
SuggestBox.DefaultSuggestionDisplay
Enclosing class:
SuggestBox

public abstract static class SuggestBox.SuggestionDisplay extends Object
Used to display suggestions to the user.
  • Constructor Details

    • SuggestionDisplay

      public SuggestionDisplay()
  • Method Details

    • getCurrentSelection

      protected abstract SuggestOracle.Suggestion getCurrentSelection()
      Get the currently selected SuggestOracle.Suggestion in 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

      protected void onEnsureDebugId(String suggestBoxBaseID)
      Set the debug id of widgets used in the SuggestionDisplay.
      Parameters:
      suggestBoxBaseID - the baseID of the SuggestBox
      See Also:
    • setMoreSuggestions

      protected void setMoreSuggestions(boolean hasMoreSuggestions, int numMoreSuggestions)
      Parameters:
      hasMoreSuggestions - true if more matches were available
      numMoreSuggestions - 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 originated
      suggestions - the suggestions to show
      isDisplayStringHTML - should the suggestions be displayed as HTML
      isAutoSelectEnabled - if true, the first item should be selected automatically
      callback - the callback used when the user makes a suggestion
    • isAnimationEnabledImpl

      @Deprecated boolean isAnimationEnabledImpl()
      Deprecated.
      implemented in DefaultSuggestionDisplay
      This 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 void setAnimationEnabledImpl(boolean enable)
      Deprecated.
      implemented in DefaultSuggestionDisplay
      This is here for legacy reasons. It is intentionally not visible.
      Parameters:
      enable - true to enable animation
    • setPopupStyleNameImpl

      @Deprecated void setPopupStyleNameImpl(String style)
      Deprecated.
      implemented in DefaultSuggestionDisplay
      This is here for legacy reasons. It is intentionally not visible.
      Parameters:
      style - the style name