Interface BeanValidationEditorDriver<T,E extends org.gwtproject.editor.client.Editor<? super T>>
-
- Type Parameters:
T- the type being editedE- the Editor for the type
- All Superinterfaces:
org.gwtproject.editor.client.EditorDriver<T>,HasFormSubmitHandlers<T>,com.google.gwt.event.shared.HasHandlers,com.google.gwt.event.logical.shared.HasValueChangeHandlers<T>
- All Known Implementing Classes:
AbstractBeanValidationEditorDriver
public interface BeanValidationEditorDriver<T,E extends org.gwtproject.editor.client.Editor<? super T>> extends org.gwtproject.editor.client.EditorDriver<T>, HasFormSubmitHandlers<T>, com.google.gwt.event.logical.shared.HasValueChangeHandlers<T>
Automates editing of simple bean-like objects. TheEditorDelegateprovided from this driver has a no-op implementation ofEditorDelegate.subscribe().interface MyDriver extends AbstractBeanValidationEditorDriver<MyObject, MyObjectEditor> { } MyDriver instance = GWT.create(MyDriver.class); { MyObjectEditor editor = new MyObjectEditor(); instance.initialize(editor); // Do stuff instance.edit(myObjectInstance); // Do more stuff instance.flush(); }Note that this interface is intended to be implemented by generated code and is subject to API expansion in the future.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description org.gwtproject.editor.client.EditorVisitorcreateInitializerVisitor()create a initializer visitor implementation.voidedit(T object)Push the data in an object graph into the Editor given toinitialize(E).Tflush()Update the object being edited with the current state of the Editor.CheckTimeEnumgetCheckTime()get the time of validation.voidinitialize(E editor)Initialize the editor driver.booleanisCheckOnKeyUp()Deprecated.As of release 0.8.2, replaced by getCheckTime()booleanisSubmitOnReturn()get state of submit on return (form is submitted if it's valid and return/enter is pressed).booleanisSubmitOnValueChange()get state of submit on value change (form is submitted if it's valid and value has changed).booleanisSubmitUnchanged()submit unchanged forms.voidsetCheckOnKeyUp(boolean pcheckOnKeyUp)Deprecated.As of release 0.8.2, replaced by setCheckTime()voidsetCheckTime(CheckTimeEnum pcheckTime)set time of validation, to change this state is only possible, before the first edit call was done.voidsetSubmitButton(com.google.gwt.user.client.ui.Widget psubmitButton)setter to add as submit button which is automatically .voidsetSubmitOnReturn(boolean psubmitOnReturn)set state of submit on return (form is submitted if it's valid and return/enter is pressed).voidsetSubmitOnValueChange(boolean psubmitOnValueChange)set state of submit on value change (form is submitted if it's valid and value has changed).voidsetSubmitUnchanged(boolean psubmitUnchanged)setter to change submit unchanged forms.voidsetValidationGroups(Class<?>... pgroups)set validation groups.booleantryToSubmitFrom()try to submit form, if validation is ok, aFormSubmitEventis thrown.booleantryToSubmitFrom(boolean pdirty)try to submit with dirty as parameter.booleanvalidate()start bean validation.-
Methods inherited from interface org.gwtproject.editor.client.EditorDriver
accept, getErrors, hasErrors, isDirty, setConstraintViolations
-
Methods inherited from interface de.knightsoftnet.validators.client.event.HasFormSubmitHandlers
addFormSubmitHandler
-
-
-
-
Method Detail
-
edit
void edit(T object)
Push the data in an object graph into the Editor given toinitialize(E).- Parameters:
object- the object providing input data- Throws:
IllegalStateException- ifinitialize(E)has not been called
-
flush
T flush()
Update the object being edited with the current state of the Editor.- Specified by:
flushin interfaceorg.gwtproject.editor.client.EditorDriver<T>- Returns:
- the object passed into
edit(Object) - Throws:
IllegalStateException- ifedit(Object)has not been called
-
initialize
void initialize(E editor)
Initialize the editor driver.- Parameters:
editor- the Editor to populate
-
validate
boolean validate()
start bean validation.- Returns:
- true if created bean is valid
-
tryToSubmitFrom
boolean tryToSubmitFrom()
try to submit form, if validation is ok, aFormSubmitEventis thrown.- Returns:
- true if submit is done, otherwise false
-
tryToSubmitFrom
boolean tryToSubmitFrom(boolean pdirty)
try to submit with dirty as parameter.- Parameters:
pdirty- dirty flag, if true form is handled as dirty/changed- Returns:
- true if submit is done
-
isSubmitUnchanged
boolean isSubmitUnchanged()
submit unchanged forms.- Returns:
- true if unchanged forms can be submitted
-
setSubmitUnchanged
void setSubmitUnchanged(boolean psubmitUnchanged)
setter to change submit unchanged forms.- Parameters:
psubmitUnchanged- the submitUnchanged to set
-
isCheckOnKeyUp
@Deprecated boolean isCheckOnKeyUp()
Deprecated.As of release 0.8.2, replaced by getCheckTime()get state of validation on key up (check on every key up event).- Returns:
- true if it's active
-
setCheckOnKeyUp
@Deprecated void setCheckOnKeyUp(boolean pcheckOnKeyUp) throws RuntimeException
Deprecated.As of release 0.8.2, replaced by setCheckTime()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.- Parameters:
pcheckOnKeyUp- true/false- Throws:
RuntimeException- if this method is called after a edit call
-
getCheckTime
CheckTimeEnum getCheckTime()
get the time of validation.- Returns:
- check time enumeration
-
setCheckTime
void setCheckTime(CheckTimeEnum pcheckTime) throws RuntimeException
set time of validation, to change this state is only possible, before the first edit call was done.- Parameters:
pcheckTime- check time enumeration- Throws:
RuntimeException- if this method is called after a edit call
-
isSubmitOnReturn
boolean isSubmitOnReturn()
get state of submit on return (form is submitted if it's valid and return/enter is pressed).- Returns:
- true if it's active
-
setSubmitOnReturn
void setSubmitOnReturn(boolean psubmitOnReturn) throws RuntimeExceptionset state of submit on return (form is submitted if it's valid and return/enter is pressed). To change this state is only possible, before the first edit call was done.- Parameters:
psubmitOnReturn- true/false- Throws:
RuntimeException- if this method is called after a edit call
-
isSubmitOnValueChange
boolean isSubmitOnValueChange()
get state of submit on value change (form is submitted if it's valid and value has changed).- Returns:
- true if it's active
-
setSubmitOnValueChange
void setSubmitOnValueChange(boolean psubmitOnValueChange)
set state of submit on value change (form is submitted if it's valid and value has changed). To change this state is only possible, before the first edit call was done.- Parameters:
psubmitOnValueChange- true/false
-
setSubmitButton
void setSubmitButton(com.google.gwt.user.client.ui.Widget psubmitButton)
setter to add as submit button which is automatically .- Parameters:
psubmitButton- the submitUnchanged to set
-
setValidationGroups
void setValidationGroups(Class<?>... pgroups)
set validation groups.- Parameters:
pgroups- group or list of groups targeted for validation (default toDefault)
-
createInitializerVisitor
org.gwtproject.editor.client.EditorVisitor createInitializerVisitor()
create a initializer visitor implementation.- Returns:
- editor visitor
-
-