Class CmsValidationHandler

java.lang.Object
org.opencms.acacia.client.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 Object implements com.google.gwt.event.logical.shared.ValueChangeHandler<org.opencms.acacia.shared.CmsEntity>, com.google.gwt.event.logical.shared.HasValueChangeHandlers<CmsValidationContext>
Validation handler.

  • Constructor Details

  • Method Details

    • 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(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)
    • getValidationContext

      Returns the validation context.

      Returns:
      the validation context
    • 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