Interface BeanValidationEditorDriver<T,​E extends org.gwtproject.editor.client.Editor<? super T>>

  • Type Parameters:
    T - the type being edited
    E - 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. The EditorDelegate provided from this driver has a no-op implementation of EditorDelegate.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.EditorVisitor createInitializerVisitor()
      create a initializer visitor implementation.
      void edit​(T object)
      Push the data in an object graph into the Editor given to initialize(E).
      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()
      Deprecated.
      As of release 0.8.2, replaced by getCheckTime()
      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)
      Deprecated.
      As of release 0.8.2, replaced by setCheckTime()
      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.
      • Methods inherited from interface org.gwtproject.editor.client.EditorDriver

        accept, getErrors, hasErrors, isDirty, setConstraintViolations
      • Methods inherited from interface com.google.gwt.event.shared.HasHandlers

        fireEvent
      • Methods inherited from interface com.google.gwt.event.logical.shared.HasValueChangeHandlers

        addValueChangeHandler
    • Method Detail

      • flush

        T flush()
        Update the object being edited with the current state of the Editor.
        Specified by:
        flush in interface org.gwtproject.editor.client.EditorDriver<T>
        Returns:
        the object passed into edit(Object)
        Throws:
        IllegalStateException - if edit(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, a FormSubmitEvent is 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 RuntimeException
        set 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 to Default)
      • createInitializerVisitor

        org.gwtproject.editor.client.EditorVisitor createInitializerVisitor()
        create a initializer visitor implementation.
        Returns:
        editor visitor