Class AbstractBeanValidationEditorDriver<T,​E extends com.google.gwt.editor.client.Editor<T>>

  • Type Parameters:
    T - the type being edited
    E - the Editor type
    All Implemented Interfaces:
    com.google.gwt.editor.client.EditorDriver<T>, com.google.gwt.event.logical.shared.HasValueChangeHandlers<T>, com.google.gwt.event.shared.HasHandlers, BeanValidationEditorDriver<T,​E>, HasFormSubmitHandlers<T>

    public 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>
    A base implementation class for generated BeanValidationEditorDriver implementations.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Class<?>[] validationGroups
      validation groups to limit validation.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method 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)  
      • Methods inherited from class com.google.gwt.editor.client.impl.BaseEditorDriver

        accept, configureDelegate, createDelegate, doEdit, doFlush, doInitialize, doSetViolations, getDelegate, getEditor, getErrors, getObject, getViolationKeyMethod, hasErrors, isDirty, setConstraintViolations, toString
      • Methods inherited from interface com.google.gwt.editor.client.EditorDriver

        accept, getErrors, hasErrors, isDirty, setConstraintViolations
    • Field Detail

      • validationGroups

        protected Class<?>[] validationGroups
        validation groups to limit validation.
    • Constructor Detail

      • AbstractBeanValidationEditorDriver

        public AbstractBeanValidationEditorDriver()
        default constructor.
    • Method Detail

      • createInitializerVisitor

        public com.google.gwt.editor.client.EditorVisitor createInitializerVisitor()
        Description copied from interface: BeanValidationEditorDriver
        create a initializer visitor implementation.
        Specified by:
        createInitializerVisitor in interface BeanValidationEditorDriver<T,​E extends com.google.gwt.editor.client.Editor<T>>
        Overrides:
        createInitializerVisitor in class com.google.gwt.editor.client.impl.BaseEditorDriver<T,​E extends com.google.gwt.editor.client.Editor<T>>
        Returns:
        editor visitor
      • validateContent

        protected Set<javax.validation.ConstraintViolation<?>> validateContent​(T pobject)
      • addValueChangeHandler

        public final com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler​(com.google.gwt.event.logical.shared.ValueChangeHandler<T> phandler)
        Specified by:
        addValueChangeHandler in interface com.google.gwt.event.logical.shared.HasValueChangeHandlers<T>
      • fireEvent

        public void fireEvent​(com.google.gwt.event.shared.GwtEvent<?> pevent)
        Specified by:
        fireEvent in interface com.google.gwt.event.shared.HasHandlers
      • tryToSubmitFrom

        public final boolean tryToSubmitFrom​(boolean pdirty)
        Description copied from interface: BeanValidationEditorDriver
        try to submit with dirty as parameter.
        Specified by:
        tryToSubmitFrom in interface BeanValidationEditorDriver<T,​E extends com.google.gwt.editor.client.Editor<T>>
        Parameters:
        pdirty - dirty flag, if true form is handled as dirty/changed
        Returns:
        true if submit is done
      • setSubmitUnchanged

        public final void setSubmitUnchanged​(boolean psubmitUnchanged)
        Description copied from interface: BeanValidationEditorDriver
        setter to change submit unchanged forms.
        Specified by:
        setSubmitUnchanged in interface BeanValidationEditorDriver<T,​E extends com.google.gwt.editor.client.Editor<T>>
        Parameters:
        psubmitUnchanged - the submitUnchanged to set
      • setCheckOnKeyUp

        public final void setCheckOnKeyUp​(boolean pcheckOnKeyUp)
                                   throws RuntimeException
        Description copied from interface: BeanValidationEditorDriver
        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.
        Specified by:
        setCheckOnKeyUp in interface BeanValidationEditorDriver<T,​E extends com.google.gwt.editor.client.Editor<T>>
        Parameters:
        pcheckOnKeyUp - true/false
        Throws:
        RuntimeException - if this method is called after a edit call
      • isSubmitOnReturn

        public final boolean isSubmitOnReturn()
        Description copied from interface: BeanValidationEditorDriver
        get state of submit on return (form is submitted if it's valid and return/enter is pressed).
        Specified by:
        isSubmitOnReturn in interface BeanValidationEditorDriver<T,​E extends com.google.gwt.editor.client.Editor<T>>
        Returns:
        true if it's active
      • setSubmitOnReturn

        public final void setSubmitOnReturn​(boolean psubmitOnReturn)
                                     throws RuntimeException
        Description copied from interface: BeanValidationEditorDriver
        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.
        Specified by:
        setSubmitOnReturn in interface BeanValidationEditorDriver<T,​E extends com.google.gwt.editor.client.Editor<T>>
        Parameters:
        psubmitOnReturn - true/false
        Throws:
        RuntimeException - if this method is called after a edit call
      • isSubmitOnValueChange

        public boolean isSubmitOnValueChange()
        Description copied from interface: BeanValidationEditorDriver
        get state of submit on value change (form is submitted if it's valid and value has changed).
        Specified by:
        isSubmitOnValueChange in interface BeanValidationEditorDriver<T,​E extends com.google.gwt.editor.client.Editor<T>>
        Returns:
        true if it's active
      • setSubmitOnValueChange

        public void setSubmitOnValueChange​(boolean psubmitOnValueChange)
        Description copied from interface: BeanValidationEditorDriver
        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.
        Specified by:
        setSubmitOnValueChange in interface BeanValidationEditorDriver<T,​E extends com.google.gwt.editor.client.Editor<T>>
        Parameters:
        psubmitOnValueChange - true/false
      • setSubmitButton

        public final void setSubmitButton​(com.google.gwt.user.client.ui.Widget psubmitButton)
        Description copied from interface: BeanValidationEditorDriver
        setter to add as submit button which is automatically .
        Specified by:
        setSubmitButton in interface BeanValidationEditorDriver<T,​E extends com.google.gwt.editor.client.Editor<T>>
        Parameters:
        psubmitButton - the submitUnchanged to set