public abstract class AbstractValueWidget<V> extends MaterialWidget implements com.google.gwt.user.client.ui.HasValue<V>, com.google.gwt.editor.client.LeafValueEditor<V>, com.google.gwt.editor.client.HasEditorErrors<V>, HasErrorHandler, HasError, HasValidators<V>
MaterialWidget.Feature
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
com.google.gwt.editor.client.Editor.Ignore, com.google.gwt.editor.client.Editor.Path
$this
Constructor and Description |
---|
AbstractValueWidget(com.google.gwt.dom.client.Element element) |
AbstractValueWidget(com.google.gwt.dom.client.Element element,
String... initialClass) |
Modifier and Type | Method and Description |
---|---|
com.google.gwt.event.shared.HandlerRegistration |
addValidationChangedHandler(ValidationChangedEvent.ValidationChangedHandler handler)
Adds a validation changed handler.
|
void |
addValidator(Validator<V> validator)
Adds the validator.
|
com.google.gwt.event.shared.HandlerRegistration |
addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<V> handler) |
void |
clearErrorOrSuccess()
Clear the error or success states.
|
protected BlankValidator<V> |
createBlankValidator()
Hook for custom blank validators.
|
ErrorHandler |
getErrorHandler()
Gets the error handler.
|
protected ErrorHandlerMixin<V> |
getErrorHandlerMixin() |
ErrorHandlerType |
getErrorHandlerType()
Gets the error handler type.
|
protected ErrorMixin<AbstractValueWidget,?> |
getErrorMixin() |
protected ValidatorMixin<AbstractValueWidget<V>,V> |
getValidatorMixin() |
boolean |
isAllowBlank()
Will this widget allow blank values upon validation.
|
boolean |
isValidateOnBlur()
Gets the validate on blur.
|
boolean |
removeValidator(Validator<V> validator)
Removes the validator.
|
void |
reset()
Reset the form element to blank and clear error messages.
|
void |
setAllowBlank(boolean allowBlank)
Enable or disable the default blank validator.
|
void |
setError(String error)
Errors occur when an app fails to complete what is expected, such as:
- The app does not understand user input
- The system or app fails
- A user intends to run incompatible operations concurrently
|
void |
setErrorHandler(ErrorHandler errorHandler)
Sets the error handler.
|
void |
setErrorHandlerType(ErrorHandlerType errorHandlerType)
Sets the error handler type.
|
void |
setHelperText(String helperText)
Apply a widgets help text.
|
void |
setSuccess(String success)
Set the success message marking a widget as success.
|
protected void |
setupBlurValidation() |
void |
setValidateOnBlur(boolean validateOnBlur)
Sets the validate on blur.
|
void |
setValidators(Validator<V>... validators)
The validators used to validate this object.
|
void |
setValue(V value) |
void |
setValue(V value,
boolean fireEvents) |
void |
setValue(V value,
boolean fireEvents,
boolean reload) |
void |
showErrors(List<com.google.gwt.editor.client.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.
|
$this, add, add, addAttachHandler, addBlurHandler, addClickHandler, addDoubleClickHandler, addDragEndHandler, addDragEnterHandler, addDragLeaveHandler, addDragMoveHandler, addDragOverHandler, addDragStartHandler, addDropActivateHandler, addDropDeactivateHandler, addDropHandler, addFocusHandler, addGestureChangeHandler, addGestureEndHandler, addGestureStartHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addMouseDownHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addOrientationChangeHandler, addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler, body, clearActiveClass, enableFeature, getBackfaceVisibility, getBackgroundColor, getBorder, getBorderBottom, getBorderLeft, getBorderMixin, getBorderRadius, getBorderRight, getBorderTop, getCenterOn, getCenterOnMixin, getChildren, getChildrenList, getCircleMixin, getColorsMixin, getDataAttribute, getDepth, getDimensionMixin, getEnabledMixin, getFlexboxMixin, getFloat, getFloatMixin, getFocusableMixin, getFontSize, getFontSizeMixin, getFontWeight, getFontWeightMixin, getGridMixin, getHandlerRegistry, getHideOn, getHideOnMixin, getHoverableMixin, getId, getIdMixin, getInitialClasses, getLayoutPosition, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpacity, getOrientation, getOrientationMixin, getPerspective, getPerspectiveOrigin, getScrollspy, getScrollspyMixin, getSeparatorMixin, getShadow, getShadowMixin, getShowOn, getShowOnMixin, getTabIndex, getTextAlign, getTextAlignMixin, getTextColor, getTooltip, getTooltipDelayMs, getTooltipHTML, getTooltipMixin, getTooltipPosition, getTransform, getTransformMixin, getTransformOrigin, getTransformStyle, getTruncateMixin, getVerticalAlign, getVerticalAlignMixin, getWaves, getWavesMixin, getWidth, insert, insert, isCircle, isDetectOrientation, isEnabled, isFeatureEnabled, isHoverable, isSeparator, isTruncate, onLoad, onUnload, registerHandler, removeHandler, setAccessKey, setBackfaceVisibility, setBackgroundColor, setBorder, setBorderBottom, setBorderLeft, setBorderRadius, setBorderRight, setBorderTop, setBottom, setCenterOn, setCircle, setClass, setDataAttribute, setDepth, setDetectOrientation, setDisplay, setEnabled, setFlex, setFlexAlignContent, setFlexAlignItems, setFlexAlignSelf, setFlexBasis, setFlexDirection, setFlexGrow, setFlexJustifyContent, setFlexOrder, setFlexShrink, setFlexWrap, setFloat, setFocus, setFontSize, setFontSize, setFontWeight, setGrid, setGwtDisplay, setHideOn, setHoverable, setId, setInitialClasses, setLayoutPosition, setLeft, setLineHeight, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setOffset, setOpacity, setOrientation, setOverflow, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPerspective, setPerspectiveOrigin, setRight, setScrollspy, setSeparator, setShadow, setShowOn, setStyle, setTabIndex, setTextAlign, setTextColor, setTooltip, setTooltipDelayMs, setTooltipHTML, setTooltipPosition, setTop, setTransform, setTransformOrigin, setTransformStyle, setTransition, setTruncate, setVerticalAlign, setVisibility, setWaves, stopTouchStartEvent, window
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, iterator, remove, remove
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, 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
setVisible
forEach, spliterator
public AbstractValueWidget(com.google.gwt.dom.client.Element element)
public AbstractValueWidget(com.google.gwt.dom.client.Element element, String... initialClass)
public void setValue(V value, boolean fireEvents)
setValue
in interface com.google.gwt.user.client.ui.HasValue<V>
public void setError(String error)
HasError
public void setSuccess(String success)
HasError
setSuccess
in interface HasError
public void setHelperText(String helperText)
HasError
setHelperText
in interface HasError
public void clearErrorOrSuccess()
HasError
clearErrorOrSuccess
in interface HasError
public void showErrors(List<com.google.gwt.editor.client.EditorError> errors)
showErrors
in interface com.google.gwt.editor.client.HasEditorErrors<V>
public ErrorHandler getErrorHandler()
HasErrorHandler
getErrorHandler
in interface HasErrorHandler
public void setErrorHandler(ErrorHandler errorHandler)
HasErrorHandler
setErrorHandler
in interface HasErrorHandler
errorHandler
- the new error handlerpublic ErrorHandlerType getErrorHandlerType()
HasErrorHandler
getErrorHandlerType
in interface HasErrorHandler
public void setErrorHandlerType(ErrorHandlerType errorHandlerType)
HasErrorHandler
setErrorHandlerType
in interface HasErrorHandler
errorHandlerType
- the new error handler typepublic void addValidator(Validator<V> validator)
HasValidators
addValidator
in interface HasValidators<V>
validator
- the validatorpublic boolean isValidateOnBlur()
HasValidators
isValidateOnBlur
in interface HasValidators<V>
public boolean removeValidator(Validator<V> validator)
HasValidators
removeValidator
in interface HasValidators<V>
validator
- the validatorpublic void reset()
HasValidators
reset
in interface HasValidators<V>
public void setValidateOnBlur(boolean validateOnBlur)
HasValidators
setValidateOnBlur
in interface HasValidators<V>
validateOnBlur
- the new validate on blurpublic void setValidators(Validator<V>... validators)
HasValidators
setValidators
in interface HasValidators<V>
validators
- the new validatorspublic boolean validate()
HasValidators
validate
in interface HasValidators<V>
validate
in class MaterialWidget
public boolean validate(boolean show)
HasValidators
validate
in interface HasValidators<V>
show
- the error to the user.public void setAllowBlank(boolean allowBlank)
public boolean isAllowBlank()
protected BlankValidator<V> createBlankValidator()
protected void setupBlurValidation()
public com.google.gwt.event.shared.HandlerRegistration addValidationChangedHandler(ValidationChangedEvent.ValidationChangedHandler handler)
ValidationChangedEvent.HasValidationChangedHandlers
addValidationChangedHandler
in interface ValidationChangedEvent.HasValidationChangedHandlers
handler
- the handlerpublic com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<V> handler)
addValueChangeHandler
in interface com.google.gwt.event.logical.shared.HasValueChangeHandlers<V>
protected ValidatorMixin<AbstractValueWidget<V>,V> getValidatorMixin()
protected ErrorMixin<AbstractValueWidget,?> getErrorMixin()
protected ErrorHandlerMixin<V> getErrorHandlerMixin()
Copyright © 2018. All rights reserved.