Class AbstractSuggestBoxNewEditor

java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Composite
com.google.gwt.user.client.ui.AbstractSuggestBoxNewEditor
All Implemented Interfaces:
com.google.gwt.event.dom.client.HasAllKeyHandlers, com.google.gwt.event.dom.client.HasKeyDownHandlers, com.google.gwt.event.dom.client.HasKeyPressHandlers, com.google.gwt.event.dom.client.HasKeyUpHandlers, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.logical.shared.HasSelectionHandlers<com.google.gwt.user.client.ui.SuggestOracle.Suggestion>, com.google.gwt.event.logical.shared.HasValueChangeHandlers<String>, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.TakesValue<String>, com.google.gwt.user.client.ui.Focusable, com.google.gwt.user.client.ui.HasAnimation, com.google.gwt.user.client.ui.HasEnabled, com.google.gwt.user.client.ui.HasText, com.google.gwt.user.client.ui.HasValue<String>, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.IsRenderable, com.google.gwt.user.client.ui.IsWidget
Direct Known Subclasses:
SuggestBoxNewEditor

public abstract class AbstractSuggestBoxNewEditor extends com.google.gwt.user.client.ui.Composite implements com.google.gwt.user.client.ui.HasText, com.google.gwt.user.client.ui.Focusable, com.google.gwt.user.client.ui.HasAnimation, com.google.gwt.user.client.ui.HasEnabled, com.google.gwt.event.dom.client.HasAllKeyHandlers, com.google.gwt.user.client.ui.HasValue<String>, com.google.gwt.event.logical.shared.HasSelectionHandlers<com.google.gwt.user.client.ui.SuggestOracle.Suggestion>
Abstract suggest box implementation based on googles implementation, as binding between new and old world.
  • Field Details

    • STYLENAME_DEFAULT

      protected static final String STYLENAME_DEFAULT
      See Also:
    • limit

      protected int limit
    • selectsFirstItem

      protected boolean selectsFirstItem
    • oracle

      protected com.google.gwt.user.client.ui.SuggestOracle oracle
    • currentText

      protected String currentText
    • display

    • callback

      protected final com.google.gwt.user.client.ui.SuggestOracle.Callback callback
  • Constructor Details

  • Method Details

    • getBoxAsFoucsWidget

      protected abstract com.google.gwt.user.client.ui.FocusWidget getBoxAsFoucsWidget()
    • addKeyDownHandler

      public com.google.gwt.event.shared.HandlerRegistration addKeyDownHandler(com.google.gwt.event.dom.client.KeyDownHandler handler)
      Specified by:
      addKeyDownHandler in interface com.google.gwt.event.dom.client.HasKeyDownHandlers
    • addKeyPressHandler

      public com.google.gwt.event.shared.HandlerRegistration addKeyPressHandler(com.google.gwt.event.dom.client.KeyPressHandler handler)
      Specified by:
      addKeyPressHandler in interface com.google.gwt.event.dom.client.HasKeyPressHandlers
    • addKeyUpHandler

      public com.google.gwt.event.shared.HandlerRegistration addKeyUpHandler(com.google.gwt.event.dom.client.KeyUpHandler handler)
      Specified by:
      addKeyUpHandler in interface com.google.gwt.event.dom.client.HasKeyUpHandlers
    • addSelectionHandler

      public com.google.gwt.event.shared.HandlerRegistration addSelectionHandler(com.google.gwt.event.logical.shared.SelectionHandler<com.google.gwt.user.client.ui.SuggestOracle.Suggestion> handler)
      Specified by:
      addSelectionHandler in interface com.google.gwt.event.logical.shared.HasSelectionHandlers<com.google.gwt.user.client.ui.SuggestOracle.Suggestion>
    • addValueChangeHandler

      public com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<String> handler)
      Specified by:
      addValueChangeHandler in interface com.google.gwt.event.logical.shared.HasValueChangeHandlers<String>
    • getLimit

      public int getLimit()
      Gets the limit for the number of suggestions that should be displayed for this box. It is up to the current SuggestOracle to enforce this limit.
      Returns:
      the limit for the number of suggestions
    • getSuggestionDisplay

      public AbstractSuggestBoxNewEditor.SuggestionDisplay getSuggestionDisplay()
      Get the AbstractSuggestBoxNewEditor.SuggestionDisplay used to display suggestions.
      Returns:
      the AbstractSuggestBoxNewEditor.SuggestionDisplay
    • getSuggestOracle

      public com.google.gwt.user.client.ui.SuggestOracle getSuggestOracle()
      Gets the suggest box's SuggestOracle.
      Returns:
      the SuggestOracle
    • getTabIndex

      public abstract int getTabIndex()
      Specified by:
      getTabIndex in interface com.google.gwt.user.client.ui.Focusable
    • getText

      public abstract String getText()
      Specified by:
      getText in interface com.google.gwt.user.client.ui.HasText
    • getValue

      public abstract String getValue()
      Specified by:
      getValue in interface com.google.gwt.user.client.ui.HasValue<String>
      Specified by:
      getValue in interface com.google.gwt.user.client.TakesValue<String>
    • hideSuggestionList

      @Deprecated public void hideSuggestionList()
      Hide current suggestions in the AbstractSuggestBoxNewEditor.DefaultSuggestionDisplay. Note that this method is a no-op unless the AbstractSuggestBoxNewEditor.DefaultSuggestionDisplay is used.
    • isAnimationEnabled

      @Deprecated public boolean isAnimationEnabled()
      Check whether or not the AbstractSuggestBoxNewEditor.DefaultSuggestionDisplay has animations enabled. Note that this method only has a meaningful return value when the AbstractSuggestBoxNewEditor.DefaultSuggestionDisplay is used.
      Specified by:
      isAnimationEnabled in interface com.google.gwt.user.client.ui.HasAnimation
    • isAutoSelectEnabled

      public boolean isAutoSelectEnabled()
      Returns whether or not the first suggestion will be automatically selected. This behavior is on by default.
      Returns:
      true if the first suggestion will be automatically selected
    • isSuggestionListShowing

      public boolean isSuggestionListShowing()
      Returns:
      true if the list of suggestions is currently showing, false if not
    • refreshSuggestionList

      public void refreshSuggestionList()
      Refreshes the current list of suggestions.
    • setAccessKey

      public abstract void setAccessKey(char key)
      Specified by:
      setAccessKey in interface com.google.gwt.user.client.ui.Focusable
    • setAnimationEnabled

      @Deprecated public void setAnimationEnabled(boolean enable)
      Enable or disable animations in the AbstractSuggestBoxNewEditor.DefaultSuggestionDisplay. Note that this method is a no-op unless the AbstractSuggestBoxNewEditor.DefaultSuggestionDisplay is used.
      Specified by:
      setAnimationEnabled in interface com.google.gwt.user.client.ui.HasAnimation
    • setAutoSelectEnabled

      public void setAutoSelectEnabled(boolean selectsFirstItem)
      Turns on or off the behavior that automatically selects the first suggested item. This behavior is on by default.
      Parameters:
      selectsFirstItem - Whether or not to automatically select the first suggestion
    • setEnabled

      public void setEnabled(boolean enabled)
      Sets whether this widget is enabled.
      Specified by:
      setEnabled in interface com.google.gwt.user.client.ui.HasEnabled
      Parameters:
      enabled - true to enable the widget, false to disable it
    • setFocus

      public abstract void setFocus(boolean focused)
      Specified by:
      setFocus in interface com.google.gwt.user.client.ui.Focusable
    • setLimit

      public void setLimit(int limit)
      Sets the limit to the number of suggestions the oracle should provide. It is up to the oracle to enforce this limit.
      Parameters:
      limit - the limit to the number of suggestions provided
    • setPopupStyleName

      @Deprecated public void setPopupStyleName(String style)
      Sets the style name of the suggestion popup in the AbstractSuggestBoxNewEditor.DefaultSuggestionDisplay. Note that this method is a no-op unless the AbstractSuggestBoxNewEditor.DefaultSuggestionDisplay is used.
      Parameters:
      style - the new primary style name
      See Also:
      • UIObject.setStyleName(String)
    • showSuggestionList

      public void showSuggestionList()
      Show the current list of suggestions.
    • onEnsureDebugId

      protected void onEnsureDebugId(String baseID)
      Overrides:
      onEnsureDebugId in class com.google.gwt.user.client.ui.UIObject
    • addEventsToTextBox

      protected void addEventsToTextBox()
    • addEventsToTextBox

      protected abstract void addEventsToTextBox(com.google.gwt.event.shared.EventHandler events)
    • setOracle

      protected void setOracle(com.google.gwt.user.client.ui.SuggestOracle oracle)
      Sets the suggestion oracle used to create suggestions.
      Parameters:
      oracle - the oracle