Class CmsValidationHandler

  • All Implemented Interfaces:
    com.google.gwt.event.logical.shared.HasValueChangeHandlers<CmsValidationContext>, com.google.gwt.event.logical.shared.ValueChangeHandler<org.opencms.acacia.shared.CmsEntity>, com.google.gwt.event.shared.EventHandler, com.google.gwt.event.shared.HasHandlers

    public final class CmsValidationHandler
    extends java.lang.Object
    implements com.google.gwt.event.logical.shared.ValueChangeHandler<org.opencms.acacia.shared.CmsEntity>, com.google.gwt.event.logical.shared.HasValueChangeHandlers<CmsValidationContext>
    Validation handler.

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected <H extends com.google.gwt.event.shared.EventHandler>
      com.google.gwt.event.shared.HandlerRegistration
      addHandler​(H handler, com.google.gwt.event.shared.GwtEvent.Type<H> type)
      Adds this handler to the widget.
      com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler​(com.google.gwt.event.logical.shared.ValueChangeHandler<CmsValidationContext> handler)  
      void clear()
      Destroys the current handler instance.
      static void clearValidation​(I_CmsAttributeHandler handler)
      Clears validation message for an attribute handler.
      void displayValidation​(java.lang.String entityId, org.opencms.acacia.shared.CmsValidationResult validationResult)
      Displays the given error messages within the form.
      void fireEvent​(com.google.gwt.event.shared.GwtEvent<?> event)  
      CmsValidationContext getValidationContext()
      Returns the validation context.
      void onValueChange​(com.google.gwt.event.logical.shared.ValueChangeEvent<org.opencms.acacia.shared.CmsEntity> event)  
      void registerEntity​(org.opencms.acacia.shared.CmsEntity entity)
      Registers the validation handler for the given entity.
      void setContentService​(org.opencms.acacia.shared.rpc.I_CmsContentServiceAsync contentService)
      Sets the content service used for validation.
      void setFormTabPanel​(CmsTabbedPanel<?> tabPanel)
      Sets the form tabbed panel.
      void setPaused​(boolean paused, org.opencms.acacia.shared.CmsEntity entity)
      Sets the validation to pause.
      void setRootHandler​(CmsRootHandler rootHandler)
      Sets the root attribute handler.
      protected void validate​(org.opencms.acacia.shared.CmsEntity entity)
      Validates the given entity.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • clearValidation

        public static void clearValidation​(I_CmsAttributeHandler handler)
        Clears validation message for an attribute handler.

        Parameters:
        handler - the handler for which to clear the validation message
      • addValueChangeHandler

        public com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler​(com.google.gwt.event.logical.shared.ValueChangeHandler<CmsValidationContext> handler)
        Specified by:
        addValueChangeHandler in interface com.google.gwt.event.logical.shared.HasValueChangeHandlers<CmsValidationContext>
        See Also:
        HasValueChangeHandlers.addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler)
      • clear

        public void clear()
        Destroys the current handler instance.

      • displayValidation

        public void displayValidation​(java.lang.String entityId,
                                      org.opencms.acacia.shared.CmsValidationResult validationResult)
        Displays the given error messages within the form.

        Parameters:
        entityId - the entity id
        validationResult - the validationResult
      • fireEvent

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

        public void onValueChange​(com.google.gwt.event.logical.shared.ValueChangeEvent<org.opencms.acacia.shared.CmsEntity> event)
        Specified by:
        onValueChange in interface com.google.gwt.event.logical.shared.ValueChangeHandler<org.opencms.acacia.shared.CmsEntity>
        See Also:
        ValueChangeHandler.onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)
      • registerEntity

        public void registerEntity​(org.opencms.acacia.shared.CmsEntity entity)
        Registers the validation handler for the given entity.

        Parameters:
        entity - the entity
      • setContentService

        public void setContentService​(org.opencms.acacia.shared.rpc.I_CmsContentServiceAsync contentService)
        Sets the content service used for validation.

        Parameters:
        contentService - the content service
      • setFormTabPanel

        public void setFormTabPanel​(CmsTabbedPanel<?> tabPanel)
        Sets the form tabbed panel.

        Parameters:
        tabPanel - the tabbed panel
      • setPaused

        public void setPaused​(boolean paused,
                              org.opencms.acacia.shared.CmsEntity entity)
        Sets the validation to pause.

        Parameters:
        paused - true to pause the validation
        entity - the entity will be revalidated when setting paused to false
      • setRootHandler

        public void setRootHandler​(CmsRootHandler rootHandler)
        Sets the root attribute handler.

        Parameters:
        rootHandler - the root attribute handler
      • addHandler

        protected <H extends com.google.gwt.event.shared.EventHandler> com.google.gwt.event.shared.HandlerRegistration addHandler​(H handler,
                                                                                                                                  com.google.gwt.event.shared.GwtEvent.Type<H> type)
        Adds this handler to the widget.
        Type Parameters:
        H - the type of handler to add
        Parameters:
        type - the event type
        handler - the handler
        Returns:
        HandlerRegistration used to remove the handler
      • validate

        protected void validate​(org.opencms.acacia.shared.CmsEntity entity)
        Validates the given entity.

        Parameters:
        entity - the entity