Class 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 Detail

      • limit

        protected int limit
      • selectsFirstItem

        protected boolean selectsFirstItem
      • oracle

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

        protected String currentText
      • callback

        protected final com.google.gwt.user.client.ui.SuggestOracle.Callback callback
    • Method Detail

      • 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
      • 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>
      • 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
      • 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
      • 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
      • 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