T - the type being editedE - the Editor typepublic abstract class AbstractBeanValidationEditorDriver<T,E extends com.google.gwt.editor.client.Editor<T>> extends com.google.gwt.editor.client.impl.BaseEditorDriver<T,E> implements BeanValidationEditorDriver<T,E>
| Modifier and Type | Field and Description |
|---|---|
protected Class<?>[] |
validationGroups
validation groups to limit validation.
|
| Constructor and Description |
|---|
AbstractBeanValidationEditorDriver()
default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addFormSubmitHandler(FormSubmitHandler<T> phandler)
Adds a
FormSubmitEvent handler. |
com.google.gwt.event.shared.HandlerRegistration |
addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<T> phandler) |
com.google.gwt.editor.client.EditorVisitor |
createInitializerVisitor()
create a initializer visitor implementation.
|
void |
edit(T object)
Push the data in an object graph into the Editor given to
BeanValidationEditorDriver.initialize(E). |
void |
fireEvent(com.google.gwt.event.shared.GwtEvent<?> pevent) |
T |
flush()
Update the object being edited with the current state of the Editor.
|
CheckTimeEnum |
getCheckTime()
get the time of validation.
|
void |
initialize(E editor)
Initialize the editor driver.
|
boolean |
isCheckOnKeyUp()
get state of validation on key up (check on every key up event).
|
boolean |
isSubmitOnReturn()
get state of submit on return (form is submitted if it's valid and return/enter is pressed).
|
boolean |
isSubmitOnValueChange()
get state of submit on value change (form is submitted if it's valid and value has changed).
|
boolean |
isSubmitUnchanged()
submit unchanged forms.
|
void |
setCheckOnKeyUp(boolean pcheckOnKeyUp)
set state of validation on key up (check on every key up event), to change this state is only
possible, before the first edit call was done.
|
void |
setCheckTime(CheckTimeEnum pcheckTime)
set time of validation, to change this state is only possible, before the first edit call was
done.
|
void |
setSubmitButton(com.google.gwt.user.client.ui.Widget psubmitButton)
setter to add as submit button which is automatically .
|
void |
setSubmitOnReturn(boolean psubmitOnReturn)
set state of submit on return (form is submitted if it's valid and return/enter is pressed).
|
void |
setSubmitOnValueChange(boolean psubmitOnValueChange)
set state of submit on value change (form is submitted if it's valid and value has changed).
|
void |
setSubmitUnchanged(boolean psubmitUnchanged)
setter to change submit unchanged forms.
|
void |
setValidationGroups(Class<?>... pgroups)
set validation groups.
|
boolean |
tryToSubmitFrom()
try to submit form, if validation is ok, a
FormSubmitEvent is thrown. |
boolean |
tryToSubmitFrom(boolean pdirty)
try to submit with dirty as parameter.
|
boolean |
validate()
start bean validation.
|
protected Set<javax.validation.ConstraintViolation<?>> |
validateContent(T pobject) |
protected abstract Set<javax.validation.ConstraintViolation<T>> |
validateContent(T pobject,
AbstractGwtValidator pvalidator) |
accept, configureDelegate, createDelegate, doEdit, doFlush, doInitialize, doSetViolations, getDelegate, getEditor, getErrors, getObject, getViolationKeyMethod, hasErrors, isDirty, setConstraintViolations, toStringprotected Class<?>[] validationGroups
public AbstractBeanValidationEditorDriver()
public void edit(T object)
BeanValidationEditorDriverBeanValidationEditorDriver.initialize(E).edit in interface BeanValidationEditorDriver<T,E extends com.google.gwt.editor.client.Editor<T>>object - the object providing input datapublic com.google.gwt.editor.client.EditorVisitor createInitializerVisitor()
BeanValidationEditorDrivercreateInitializerVisitor in interface BeanValidationEditorDriver<T,E extends com.google.gwt.editor.client.Editor<T>>createInitializerVisitor in class com.google.gwt.editor.client.impl.BaseEditorDriver<T,E extends com.google.gwt.editor.client.Editor<T>>public T flush()
BeanValidationEditorDriverflush in interface com.google.gwt.editor.client.EditorDriver<T>flush in interface BeanValidationEditorDriver<T,E extends com.google.gwt.editor.client.Editor<T>>BeanValidationEditorDriver.edit(Object)public void initialize(E editor)
BeanValidationEditorDriverinitialize in interface BeanValidationEditorDriver<T,E extends com.google.gwt.editor.client.Editor<T>>editor - the Editor to populatepublic final boolean validate()
BeanValidationEditorDrivervalidate in interface BeanValidationEditorDriver<T,E extends com.google.gwt.editor.client.Editor<T>>protected abstract Set<javax.validation.ConstraintViolation<T>> validateContent(T pobject, AbstractGwtValidator pvalidator) throws IllegalArgumentException
IllegalArgumentExceptionpublic final com.google.gwt.event.shared.HandlerRegistration addFormSubmitHandler(FormSubmitHandler<T> phandler)
HasFormSubmitHandlersFormSubmitEvent handler.addFormSubmitHandler in interface HasFormSubmitHandlers<T>phandler - the handlerpublic final com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<T> phandler)
addValueChangeHandler in interface com.google.gwt.event.logical.shared.HasValueChangeHandlers<T>public void fireEvent(com.google.gwt.event.shared.GwtEvent<?> pevent)
fireEvent in interface com.google.gwt.event.shared.HasHandlerspublic final boolean tryToSubmitFrom()
BeanValidationEditorDriverFormSubmitEvent is thrown.tryToSubmitFrom in interface BeanValidationEditorDriver<T,E extends com.google.gwt.editor.client.Editor<T>>public final boolean tryToSubmitFrom(boolean pdirty)
BeanValidationEditorDrivertryToSubmitFrom in interface BeanValidationEditorDriver<T,E extends com.google.gwt.editor.client.Editor<T>>pdirty - dirty flag, if true form is handled as dirty/changedpublic final boolean isSubmitUnchanged()
BeanValidationEditorDriverisSubmitUnchanged in interface BeanValidationEditorDriver<T,E extends com.google.gwt.editor.client.Editor<T>>public final void setSubmitUnchanged(boolean psubmitUnchanged)
BeanValidationEditorDriversetSubmitUnchanged in interface BeanValidationEditorDriver<T,E extends com.google.gwt.editor.client.Editor<T>>psubmitUnchanged - the submitUnchanged to setpublic final boolean isCheckOnKeyUp()
BeanValidationEditorDriverisCheckOnKeyUp in interface BeanValidationEditorDriver<T,E extends com.google.gwt.editor.client.Editor<T>>public final void setCheckOnKeyUp(boolean pcheckOnKeyUp)
throws RuntimeException
BeanValidationEditorDriversetCheckOnKeyUp in interface BeanValidationEditorDriver<T,E extends com.google.gwt.editor.client.Editor<T>>pcheckOnKeyUp - true/falseRuntimeException - if this method is called after a edit callpublic final CheckTimeEnum getCheckTime()
BeanValidationEditorDrivergetCheckTime in interface BeanValidationEditorDriver<T,E extends com.google.gwt.editor.client.Editor<T>>public final void setCheckTime(CheckTimeEnum pcheckTime) throws RuntimeException
BeanValidationEditorDriversetCheckTime in interface BeanValidationEditorDriver<T,E extends com.google.gwt.editor.client.Editor<T>>pcheckTime - check time enumerationRuntimeException - if this method is called after a edit callpublic final boolean isSubmitOnReturn()
BeanValidationEditorDriverisSubmitOnReturn in interface BeanValidationEditorDriver<T,E extends com.google.gwt.editor.client.Editor<T>>public final void setSubmitOnReturn(boolean psubmitOnReturn)
throws RuntimeException
BeanValidationEditorDriversetSubmitOnReturn in interface BeanValidationEditorDriver<T,E extends com.google.gwt.editor.client.Editor<T>>psubmitOnReturn - true/falseRuntimeException - if this method is called after a edit callpublic boolean isSubmitOnValueChange()
BeanValidationEditorDriverisSubmitOnValueChange in interface BeanValidationEditorDriver<T,E extends com.google.gwt.editor.client.Editor<T>>public void setSubmitOnValueChange(boolean psubmitOnValueChange)
BeanValidationEditorDriversetSubmitOnValueChange in interface BeanValidationEditorDriver<T,E extends com.google.gwt.editor.client.Editor<T>>psubmitOnValueChange - true/falsepublic final void setSubmitButton(com.google.gwt.user.client.ui.Widget psubmitButton)
BeanValidationEditorDriversetSubmitButton in interface BeanValidationEditorDriver<T,E extends com.google.gwt.editor.client.Editor<T>>psubmitButton - the submitUnchanged to setpublic final void setValidationGroups(Class<?>... pgroups)
BeanValidationEditorDriversetValidationGroups in interface BeanValidationEditorDriver<T,E extends com.google.gwt.editor.client.Editor<T>>pgroups - group or list of groups targeted for validation (default to
Default)Copyright © 2015–2019. All rights reserved.