public class ValueBoxBase<T> extends ValueBoxBase<T> implements HasId, HasReadOnly, HasResponsiveness, HasPlaceholder, HasAutoComplete, HasSize<InputSize>, HasEditorErrors<T>, HasErrorHandler, HasValidators<T>, HasBlankValidator<T>
ValueBoxBase.TextAlignment
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
Editor.Ignore, Editor.Path
HasDirection.Direction
DEBUG_ID_PREFIX
PLACEHOLDER
AUTO_COMPLETE, OFF, ON
Modifier | Constructor and Description |
---|---|
protected |
ValueBoxBase(Element elem,
Renderer<T> renderer,
Parser<T> parser)
Creates a value box that wraps the given browser element handle.
|
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addValidationChangedHandler(ValidationChangedEvent.ValidationChangedHandler handler)
Adds a validation changed handler.
|
void |
addValidator(Validator<T> 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 |
removeValidator(Validator<T> 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 |
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 |
setMaxLength(int maxLength) |
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<T>... validators)
The validators used to validate this object.
|
void |
setValue(T value,
boolean fireEvents) |
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.
|
addChangeHandler, addValueChangeHandler, asEditor, cancelKey, getCursorPos, getDirection, getDirectionEstimator, getImpl, getName, getSelectedText, getSelectionLength, getText, getValue, getValueOrThrow, isReadOnly, onBrowserEvent, onLoad, removeChangeListener, selectAll, setAlignment, setCursorPos, setDirection, setDirectionEstimator, setDirectionEstimator, setKey, setName, setReadOnly, setSelectionRange, setText, setValue
addBlurHandler, addClickHandler, addClickListener, addDoubleClickHandler, addDragEndHandler, addDragEnterHandler, addDragHandler, addDragLeaveHandler, addDragOverHandler, addDragStartHandler, addDropHandler, addFocusHandler, addFocusListener, addGestureChangeHandler, addGestureEndHandler, addGestureStartHandler, addKeyboardListener, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addMouseDownHandler, addMouseListener, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addMouseWheelListener, addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler, getFocusImpl, getTabIndex, isEnabled, onAttach, removeClickListener, removeFocusListener, removeKeyboardListener, removeMouseListener, removeMouseWheelListener, setAccessKey, setEnabled, setFocus, setTabIndex
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onDetach, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isReadOnly, setReadOnly
fireEvent
addKeyUpHandler
public void setMaxLength(int maxLength)
public void setPlaceholder(String placeHolder)
setPlaceholder
in interface HasPlaceholder
public String getPlaceholder()
getPlaceholder
in interface HasPlaceholder
public void setAutoComplete(boolean autoComplete)
HasAutoComplete
setAutoComplete
in interface HasAutoComplete
autoComplete
- auto complete setting for the widgetpublic String getAutoComplete()
HasAutoComplete
getAutoComplete
in interface HasAutoComplete
public void setId(String id)
HasId
public void setVisibleOn(DeviceSize deviceSize)
HasResponsiveness
setVisibleOn
in interface HasResponsiveness
deviceSize
- device sizeDeviceSize
public void setHiddenOn(DeviceSize deviceSize)
HasResponsiveness
setHiddenOn
in interface HasResponsiveness
deviceSize
- device sizesDeviceSize
public void setSize(InputSize size)
HasSize
public InputSize getSize()
HasSize
public void showErrors(List<EditorError> errors)
showErrors
in interface HasEditorErrors<T>
public ErrorHandler getErrorHandler()
getErrorHandler
in interface HasErrorHandler
public void setErrorHandler(ErrorHandler handler)
setErrorHandler
in interface HasErrorHandler
handler
- the new error handlerpublic ErrorHandlerType getErrorHandlerType()
getErrorHandlerType
in interface HasErrorHandler
public void setErrorHandlerType(ErrorHandlerType type)
setErrorHandlerType
in interface HasErrorHandler
type
- the new error handler typepublic void setAllowBlank(boolean allowBlank)
setAllowBlank
in interface HasBlankValidator<T>
allowBlank
- the new allow blankpublic boolean getAllowBlank()
getAllowBlank
in interface HasBlankValidator<T>
public void addValidator(Validator<T> validator)
HasValidators
addValidator
in interface HasValidators<T>
validator
- the validatorpublic boolean removeValidator(Validator<T> validator)
removeValidator
in interface HasValidators<T>
validator
- the validatorpublic boolean getValidateOnBlur()
HasValidators
getValidateOnBlur
in interface HasValidators<T>
public void setValidateOnBlur(boolean validateOnBlur)
HasValidators
setValidateOnBlur
in interface HasValidators<T>
validateOnBlur
- the new validate on blurpublic void setValidators(Validator<T>... validators)
HasValidators
setValidators
in interface HasValidators<T>
validators
- the new validatorspublic boolean validate()
HasValidators
validate
in interface HasValidators<T>
public boolean validate(boolean show)
HasValidators
validate
in interface HasValidators<T>
show
- the error to the user.public void reset()
HasValidators
reset
in interface HasValidators<T>
public HandlerRegistration addValidationChangedHandler(ValidationChangedEvent.ValidationChangedHandler handler)
ValidationChangedEvent.HasValidationChangedHandlers
addValidationChangedHandler
in interface ValidationChangedEvent.HasValidationChangedHandlers
handler
- the handlerCopyright © 2017. All rights reserved.