Package com.google.gwt.user.client.ui
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe default implementation ofAbstractSuggestBoxNewEditor.SuggestionDisplaydisplays suggestions in aPopupPanelbeneath theAbstractSuggestBoxNewEditor.static interfaceThe callback used when a user selects aSuggestOracle.Suggestion.static classUsed to display suggestions to the user.Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.google.gwt.user.client.ui.SuggestOracle.Callbackprotected Stringprotected final AbstractSuggestBoxNewEditor.SuggestionDisplayprotected intprotected com.google.gwt.user.client.ui.SuggestOracleprotected booleanprotected static final StringFields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected abstract voidaddEventsToTextBox(com.google.gwt.event.shared.EventHandler events) com.google.gwt.event.shared.HandlerRegistrationaddKeyDownHandler(com.google.gwt.event.dom.client.KeyDownHandler handler) com.google.gwt.event.shared.HandlerRegistrationaddKeyPressHandler(com.google.gwt.event.dom.client.KeyPressHandler handler) com.google.gwt.event.shared.HandlerRegistrationaddKeyUpHandler(com.google.gwt.event.dom.client.KeyUpHandler handler) com.google.gwt.event.shared.HandlerRegistrationaddSelectionHandler(com.google.gwt.event.logical.shared.SelectionHandler<com.google.gwt.user.client.ui.SuggestOracle.Suggestion> handler) com.google.gwt.event.shared.HandlerRegistrationaddValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<String> handler) protected abstract com.google.gwt.user.client.ui.FocusWidgetintgetLimit()Gets the limit for the number of suggestions that should be displayed for this box.Get theAbstractSuggestBoxNewEditor.SuggestionDisplayused to display suggestions.com.google.gwt.user.client.ui.SuggestOracleGets the suggest box'sSuggestOracle.abstract intabstract StringgetText()abstract StringgetValue()voidDeprecated.booleanDeprecated.booleanReturns whether or not the first suggestion will be automatically selected.booleanCheck if theAbstractSuggestBoxNewEditor.SuggestionDisplayis showing.protected voidonEnsureDebugId(String baseID) voidRefreshes the current list of suggestions.abstract voidsetAccessKey(char key) voidsetAnimationEnabled(boolean enable) Deprecated.voidsetAutoSelectEnabled(boolean selectsFirstItem) Turns on or off the behavior that automatically selects the first suggested item.voidsetEnabled(boolean enabled) Sets whether this widget is enabled.abstract voidsetFocus(boolean focused) voidsetLimit(int limit) Sets the limit to the number of suggestions the oracle should provide.protected voidsetOracle(com.google.gwt.user.client.ui.SuggestOracle oracle) Sets the suggestion oracle used to create suggestions.voidsetPopupStyleName(String style) Deprecated.voidShow the current list of suggestions.Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidgetMethods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsMethods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.gwt.user.client.ui.Focusable
setTabIndexMethods inherited from interface com.google.gwt.user.client.ui.HasEnabled
isEnabledMethods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEventMethods inherited from interface com.google.gwt.user.client.ui.HasText
setTextMethods inherited from interface com.google.gwt.user.client.ui.HasValue
setValue, setValue
-
Field Details
-
STYLENAME_DEFAULT
- See Also:
-
limit
protected int limit -
selectsFirstItem
protected boolean selectsFirstItem -
oracle
protected com.google.gwt.user.client.ui.SuggestOracle oracle -
currentText
-
display
-
callback
protected final com.google.gwt.user.client.ui.SuggestOracle.Callback callback
-
-
Constructor Details
-
AbstractSuggestBoxNewEditor
-
-
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:
addKeyDownHandlerin interfacecom.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:
addKeyPressHandlerin interfacecom.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:
addKeyUpHandlerin interfacecom.google.gwt.event.dom.client.HasKeyUpHandlers
-
getLimit
public int getLimit()Gets the limit for the number of suggestions that should be displayed for this box. It is up to the currentSuggestOracleto enforce this limit.- Returns:
- the limit for the number of suggestions
-
getSuggestionDisplay
Get theAbstractSuggestBoxNewEditor.SuggestionDisplayused to display suggestions.- Returns:
- the
AbstractSuggestBoxNewEditor.SuggestionDisplay
-
getSuggestOracle
public com.google.gwt.user.client.ui.SuggestOracle getSuggestOracle()Gets the suggest box'sSuggestOracle.- Returns:
- the
SuggestOracle
-
getTabIndex
public abstract int getTabIndex()- Specified by:
getTabIndexin interfacecom.google.gwt.user.client.ui.Focusable
-
getText
- Specified by:
getTextin interfacecom.google.gwt.user.client.ui.HasText
-
getValue
-
hideSuggestionList
Deprecated.Hide current suggestions in theAbstractSuggestBoxNewEditor.DefaultSuggestionDisplay. Note that this method is a no-op unless theAbstractSuggestBoxNewEditor.DefaultSuggestionDisplayis used. -
isAnimationEnabled
Deprecated.Check whether or not theAbstractSuggestBoxNewEditor.DefaultSuggestionDisplayhas animations enabled. Note that this method only has a meaningful return value when theAbstractSuggestBoxNewEditor.DefaultSuggestionDisplayis used.- Specified by:
isAnimationEnabledin interfacecom.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()Check if theAbstractSuggestBoxNewEditor.SuggestionDisplayis showing.- 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:
setAccessKeyin interfacecom.google.gwt.user.client.ui.Focusable
-
setAnimationEnabled
Deprecated.Enable or disable animations in theAbstractSuggestBoxNewEditor.DefaultSuggestionDisplay. Note that this method is a no-op unless theAbstractSuggestBoxNewEditor.DefaultSuggestionDisplayis used.- Specified by:
setAnimationEnabledin interfacecom.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:
setEnabledin interfacecom.google.gwt.user.client.ui.HasEnabled- Parameters:
enabled-trueto enable the widget,falseto disable it
-
setFocus
public abstract void setFocus(boolean focused) - Specified by:
setFocusin interfacecom.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.Sets the style name of the suggestion popup in theAbstractSuggestBoxNewEditor.DefaultSuggestionDisplay. Note that this method is a no-op unless theAbstractSuggestBoxNewEditor.DefaultSuggestionDisplayis used.- Parameters:
style- the new primary style name- See Also:
-
UIObject.setStyleName(String)
-
showSuggestionList
public void showSuggestionList()Show the current list of suggestions. -
onEnsureDebugId
- Overrides:
onEnsureDebugIdin classcom.google.gwt.user.client.ui.UIObject
-
addEventsToTextBox
protected void addEventsToTextBox() -
setOracle
protected void setOracle(com.google.gwt.user.client.ui.SuggestOracle oracle) Sets the suggestion oracle used to create suggestions.- Parameters:
oracle- the oracle
-
AbstractSuggestBoxNewEditor.DefaultSuggestionDisplay.hideSuggestions()instead