public class SuggestBox extends SuggestBox implements HasId, HasResponsiveness, HasPlaceholder, HasAutoComplete, HasSize<InputSize>, HasEditorErrors<String>, HasErrorHandler, HasValidators<String>, HasBlankValidator<String>
SuggestBox.Styles.DROPDOWN_MENU. Styling of the suggestions items need
a bit of css in order to be pleasing to the eye.
.dropdown-menu .item {
padding: 5px;
}
.dropdown-menu .item-selected {
background-color: #eee;
}
SuggestBox.DefaultSuggestionDisplay, SuggestBox.SuggestionCallback, SuggestBox.SuggestionDisplayUIObject.DebugIdImpl, UIObject.DebugIdImplEnabledEditor.Ignore, Editor.PathDEBUG_ID_PREFIXPLACEHOLDERAUTO_COMPLETE, OFF, ON| Constructor and Description |
|---|
SuggestBox()
Constructor for
SuggestBox. |
SuggestBox(SuggestOracle oracle)
Constructor for
SuggestBox. |
SuggestBox(SuggestOracle oracle,
ValueBoxBase<String> box)
Constructor for
SuggestBox. |
SuggestBox(SuggestOracle oracle,
ValueBoxBase<String> box,
SuggestBox.SuggestionDisplay suggestDisplay)
Constructor for
SuggestBox. |
| Modifier and Type | Method and Description |
|---|---|
HandlerRegistration |
addValidationChangedHandler(ValidationChangedEvent.ValidationChangedHandler handler)
Adds a validation changed handler.
|
void |
addValidator(Validator<String> validator)
Adds the validator.
|
boolean |
getAllowBlank() |
String |
getAutoComplete()
Get the auto complete attribute from the widget
|
ErrorHandler |
getErrorHandler()
Gets the error handler.
|
ErrorHandlerType |
getErrorHandlerType()
Gets the error handler type.
|
String |
getId()
Gets the ID of the widget
|
String |
getPlaceholder() |
InputSize |
getSize()
Get the size of the widget
|
boolean |
getValidateOnBlur()
Gets the validate on blur.
|
boolean |
isEnabled() |
protected void |
onAttach() |
boolean |
removeValidator(Validator<String> validator)
Removes the validator.
|
void |
reset()
Reset the form element to blank and clear error messages.
|
void |
setAllowBlank(boolean allowBlank) |
void |
setAutoComplete(boolean autoComplete)
Sets the auto complete property on the widget
|
void |
setEnabled(boolean enabled) |
void |
setErrorHandler(ErrorHandler handler)
Sets the error handler.
|
void |
setErrorHandlerType(ErrorHandlerType type)
Sets the error handler type.
|
void |
setHiddenOn(DeviceSize deviceSize)
Sets the devices that the element is hidden on
|
void |
setId(String id)
Sets the ID on the widget
|
void |
setPlaceholder(String placeHolder) |
void |
setSize(InputSize size)
Set the size of the widget
|
void |
setValidateOnBlur(boolean validateOnBlur)
Sets the validate on blur.
|
void |
setValidators(Validator<String>... validators)
The validators used to validate this object.
|
void |
setVisibleOn(DeviceSize deviceSize)
Sets the devices that the element is visible on
|
void |
showErrors(List<EditorError> errors) |
boolean |
validate()
Validate the field's value using the supplied validators.
|
boolean |
validate(boolean show)
Validate the field's value using the supplied validators.
|
addChangeListener, addClickListener, addEventHandler, addFocusListener, addKeyboardListener, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addSelectionHandler, addValueChangeHandler, asEditor, getLimit, getSuggestionDisplay, getSuggestOracle, getTabIndex, getText, getTextBox, getValue, getValueBox, hideSuggestionList, isAnimationEnabled, isAutoSelectEnabled, isSuggestionListShowing, onEnsureDebugId, refreshSuggestionList, removeChangeListener, removeClickListener, removeEventHandler, removeFocusListener, removeKeyboardListener, setAccessKey, setAnimationEnabled, setAutoSelectEnabled, setFocus, setLimit, setPopupStyleName, setTabIndex, setText, setValue, setValue, showSuggestionList, wrapclaimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidgetaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, 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, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfireEventpublic SuggestBox()
SuggestBox. Creates a MultiWordSuggestOracle and TextBox to use
with this SuggestBox.public SuggestBox(SuggestOracle oracle)
oracle - the oracle for this SuggestBoxpublic SuggestBox(SuggestOracle oracle, ValueBoxBase<String> box)
SuggestBox. The text box will be removed from it's current location and wrapped
by the SuggestBox.oracle - supplies suggestions based upon the current contents of the text widgetbox - the text widgetpublic SuggestBox(SuggestOracle oracle, ValueBoxBase<String> box, SuggestBox.SuggestionDisplay suggestDisplay)
SuggestBox. The text box will be removed from it's current location and wrapped
by the SuggestBox.oracle - supplies suggestions based upon the current contents of the text widgetbox - the text widgetsuggestDisplay - the class used to display suggestionspublic HandlerRegistration addValidationChangedHandler(ValidationChangedEvent.ValidationChangedHandler handler)
addValidationChangedHandler in interface ValidationChangedEvent.HasValidationChangedHandlershandler - the handlerpublic void addValidator(Validator<String> validator)
addValidator in interface HasValidators<String>validator - the validatorpublic boolean getAllowBlank()
getAllowBlank in interface HasBlankValidator<String>public String getAutoComplete()
getAutoComplete in interface HasAutoCompletepublic ErrorHandler getErrorHandler()
getErrorHandler in interface HasErrorHandlerpublic ErrorHandlerType getErrorHandlerType()
getErrorHandlerType in interface HasErrorHandlerpublic String getPlaceholder()
getPlaceholder in interface HasPlaceholderpublic boolean getValidateOnBlur()
HasValidatorsgetValidateOnBlur in interface HasValidators<String>public boolean isEnabled()
isEnabled in interface HasEnabledisEnabled in class SuggestBoxpublic boolean removeValidator(Validator<String> validator)
removeValidator in interface HasValidators<String>validator - the validatorpublic void reset()
HasValidatorsreset in interface HasValidators<String>public void setAllowBlank(boolean allowBlank)
setAllowBlank in interface HasBlankValidator<String>allowBlank - the new allow blankpublic void setAutoComplete(boolean autoComplete)
setAutoComplete in interface HasAutoCompleteautoComplete - auto complete setting for the widgetpublic void setEnabled(boolean enabled)
setEnabled in interface HasEnabledsetEnabled in class SuggestBoxpublic void setErrorHandler(ErrorHandler handler)
setErrorHandler in interface HasErrorHandlerhandler - the new error handlerpublic void setErrorHandlerType(ErrorHandlerType type)
setErrorHandlerType in interface HasErrorHandlertype - the new error handler typepublic void setHiddenOn(DeviceSize deviceSize)
setHiddenOn in interface HasResponsivenessdeviceSize - device sizesDeviceSizepublic void setPlaceholder(String placeHolder)
setPlaceholder in interface HasPlaceholderpublic void setValidateOnBlur(boolean validateOnBlur)
HasValidatorssetValidateOnBlur in interface HasValidators<String>validateOnBlur - the new validate on blurpublic void setValidators(Validator<String>... validators)
HasValidatorssetValidators in interface HasValidators<String>validators - the new validatorspublic void setVisibleOn(DeviceSize deviceSize)
setVisibleOn in interface HasResponsivenessdeviceSize - device sizeDeviceSizepublic void showErrors(List<EditorError> errors)
showErrors in interface HasEditorErrors<String>public boolean validate()
validate in interface HasValidators<String>public boolean validate(boolean show)
validate in interface HasValidators<String>show - the error to the user.Copyright © 2017. All rights reserved.