T
- the field's data typepublic abstract class AdapterField<T> extends SimpleContainer implements IsField<T>, InvalidEvent.HasInvalidHandlers, ValidEvent.HasValidHandlers, HasEditorErrors<T>, HasEditorDelegate<T>, ValueAwareEditor<T>
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
HasWidgets.ForIsWidget
IndexedPanel.ForIsWidget
DEBUG_ID_PREFIX
Constructor and Description |
---|
AdapterField(Widget widget)
Creates an adapter field that wraps the specified widget so that it can be used like a
Field . |
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addInvalidHandler(InvalidEvent.InvalidHandler handler)
Adds a
InvalidEvent.InvalidHandler handler for InvalidEvent
events. |
void |
addValidator(Validator<T> validator)
Adds a validator to be invoked when
validateValue(Object) is invoked. |
HandlerRegistration |
addValidHandler(ValidEvent.ValidHandler handler)
Adds a
ValidEvent handler for ValidEvent
events. |
HandlerRegistration |
addValueChangeHandler(ValueChangeHandler<T> valueChangeHandler) |
void |
clear()
Clears the value from the field.
|
void |
clearInvalid()
Clear any invalid styles / messages for this field.
|
void |
disable()
Disable this widget.
|
void |
enable()
Enable this widget.
|
void |
finishEditing()
Used to indicate that this field must be completed with its editing process, as it may be able to be removed from
the dom, hidden, or its current results used.
|
void |
flush() |
void |
forceInvalid(String msg)
Forces the field to be invalid using the given error message.
|
List<EditorError> |
getErrors()
Returns a list of the current errors.
|
ErrorHandler |
getErrorSupport()
Returns the field's error support instance.
|
List<Validator<T>> |
getValidators()
Returns the field's validators.
|
boolean |
isValid()
Returns whether or not the field value is currently valid.
|
boolean |
isValid(boolean preventMark)
Returns whether or not the field value is currently valid.
|
void |
markInvalid(String msg)
Marks this field as invalid.
|
void |
onPropertyChange(String... strings) |
void |
removeValidator(Validator<T> validator)
Removes a validator from this list of validators that are run when
validateValue(Object) is invoked. |
void |
reset()
Resets the current field value to the originally loaded value and clears any validation messages.
|
void |
setDelegate(EditorDelegate<T> delegate) |
void |
setErrorSupport(ErrorHandler error)
Sets the error handler used to mark and query field errors.
|
void |
showErrors(List<EditorError> errors) |
boolean |
validate()
Validates the field value.
|
boolean |
validate(boolean preventMark)
Validates the field value.
|
add, add, getWidget, isResize, setResize, setWidget, setWidget
forceLayout, isLayoutRunning, isOrWasLayoutRunning, onResize
add, addAddHandler, addBeforeAddHandler, addBeforeRemoveHandler, addContainerHandler, addRemoveHandler, findWidget, getItemByItemId, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, iterator, remove, remove, remove
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disableEvents, enableEvents, fireEvent, focus, getData, getElement, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getShadowPosition, getStateId, getTabIndex, getToolTip, hide, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, onBrowserEvent, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setPagePosition, setPixelSize, setPosition, setShadow, setShadowPosition, setSize, setStateful, setStateId, setTabIndex, setToolTip, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getValue, setValue
addBlurHandler
fireEvent
setValue
public HandlerRegistration addInvalidHandler(InvalidEvent.InvalidHandler handler)
InvalidEvent.HasInvalidHandlers
InvalidEvent.InvalidHandler
handler for InvalidEvent
events.addInvalidHandler
in interface InvalidEvent.HasInvalidHandlers
handler
- the handlerpublic void addValidator(Validator<T> validator)
validateValue(Object)
is invoked.validator
- the validator to addpublic HandlerRegistration addValidHandler(ValidEvent.ValidHandler handler)
ValidEvent.HasValidHandlers
ValidEvent
handler for ValidEvent
events.addValidHandler
in interface ValidEvent.HasValidHandlers
handler
- the handlerpublic HandlerRegistration addValueChangeHandler(ValueChangeHandler<T> valueChangeHandler)
addValueChangeHandler
in interface HasValueChangeHandlers<T>
public void clear()
clear
in interface HasWidgets
clear
in interface IsField<T>
clear
in class Container
to remove validation messages
,
to restore to original value and remove validation messages
public void clearInvalid()
clearInvalid
in interface IsField<T>
public void disable()
Component
public void enable()
Component
public void finishEditing()
IsField
finishEditing
in interface IsField<T>
public void flush()
flush
in interface ValueAwareEditor<T>
public void forceInvalid(String msg)
clearInvalid()
must
be called to clear the error. Also, no other validation logic will execute.msg
- the error textpublic List<EditorError> getErrors()
IsField
public ErrorHandler getErrorSupport()
public List<Validator<T>> getValidators()
public boolean isValid()
public boolean isValid(boolean preventMark)
IsField
public void markInvalid(String msg)
forceInvalid(String)
Calling this will also register an error in the editor, if any.msg
- the validation messagepublic void onPropertyChange(String... strings)
onPropertyChange
in interface ValueAwareEditor<T>
public void removeValidator(Validator<T> validator)
validateValue(Object)
is invoked.validator
- the validator to removepublic void reset()
public void setDelegate(EditorDelegate<T> delegate)
setDelegate
in interface HasEditorDelegate<T>
public void setErrorSupport(ErrorHandler error)
error
- the error handlerpublic void showErrors(List<EditorError> errors)
showErrors
in interface HasEditorErrors<T>
public boolean validate()
true
if valid, otherwise false
Copyright © 2015. All rights reserved.