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 Classes Modifier and Type Class Description static classAbstractSuggestBoxNewEditor.DefaultSuggestionDisplayThe default implementation ofAbstractSuggestBoxNewEditor.SuggestionDisplaydisplays suggestions in aPopupPanelbeneath theAbstractSuggestBoxNewEditor.static interfaceAbstractSuggestBoxNewEditor.SuggestionCallbackThe callback used when a user selects aSuggestOracle.Suggestion.static classAbstractSuggestBoxNewEditor.SuggestionDisplayUsed to display suggestions to the user.
-
Field Summary
Fields Modifier and Type Field Description protected com.google.gwt.user.client.ui.SuggestOracle.Callbackcallbackprotected StringcurrentTextprotected AbstractSuggestBoxNewEditor.SuggestionDisplaydisplayprotected intlimitprotected com.google.gwt.user.client.ui.SuggestOracleoracleprotected booleanselectsFirstItemprotected static StringSTYLENAME_DEFAULT
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractSuggestBoxNewEditor(AbstractSuggestBoxNewEditor.SuggestionDisplay display)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidaddEventsToTextBox()protected 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.FocusWidgetgetBoxAsFoucsWidget()intgetLimit()Gets the limit for the number of suggestions that should be displayed for this box.AbstractSuggestBoxNewEditor.SuggestionDisplaygetSuggestionDisplay()Get theAbstractSuggestBoxNewEditor.SuggestionDisplayused to display suggestions.com.google.gwt.user.client.ui.SuggestOraclegetSuggestOracle()Gets the suggest box'sSuggestOracle.abstract intgetTabIndex()abstract StringgetText()abstract StringgetValue()voidhideSuggestionList()Deprecated.booleanisAnimationEnabled()Deprecated.booleanisAutoSelectEnabled()Returns whether or not the first suggestion will be automatically selected.booleanisSuggestionListShowing()Check if theAbstractSuggestBoxNewEditor.SuggestionDisplayis showing.protected voidonEnsureDebugId(String baseID)voidrefreshSuggestionList()Refreshes 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.voidshowSuggestionList()Show 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, setWidget
-
Methods 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, unsinkEvents
-
Methods 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, toString
-
-
-
-
Field Detail
-
STYLENAME_DEFAULT
protected static final String STYLENAME_DEFAULT
- See Also:
- Constant Field Values
-
limit
protected int limit
-
selectsFirstItem
protected boolean selectsFirstItem
-
oracle
protected com.google.gwt.user.client.ui.SuggestOracle oracle
-
currentText
protected String currentText
-
display
protected final AbstractSuggestBoxNewEditor.SuggestionDisplay display
-
callback
protected final com.google.gwt.user.client.ui.SuggestOracle.Callback callback
-
-
Constructor Detail
-
AbstractSuggestBoxNewEditor
protected AbstractSuggestBoxNewEditor(AbstractSuggestBoxNewEditor.SuggestionDisplay display)
-
-
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:
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
-
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:
addSelectionHandlerin interfacecom.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:
addValueChangeHandlerin interfacecom.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 currentSuggestOracleto enforce this limit.- Returns:
- the limit for the number of suggestions
-
getSuggestionDisplay
public AbstractSuggestBoxNewEditor.SuggestionDisplay 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
public abstract String getText()
- Specified by:
getTextin interfacecom.google.gwt.user.client.ui.HasText
-
getValue
public abstract String getValue()
-
hideSuggestionList
@Deprecated public void hideSuggestionList()
Deprecated.Hide current suggestions in theAbstractSuggestBoxNewEditor.DefaultSuggestionDisplay. Note that this method is a no-op unless theAbstractSuggestBoxNewEditor.DefaultSuggestionDisplayis used.
-
isAnimationEnabled
@Deprecated public boolean 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 public void setAnimationEnabled(boolean enable)
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 public void setPopupStyleName(String style)
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
protected void onEnsureDebugId(String baseID)
- Overrides:
onEnsureDebugIdin classcom.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
-
-