Class RefundAmountRenderer

  • All Implemented Interfaces:
    com.hybris.cockpitng.widgets.common.NotifyingWidgetComponentRenderer<org.zkoss.zk.ui.Component,​com.hybris.cockpitng.core.config.impl.jaxb.editorarea.AbstractPanel,​java.lang.Object>, com.hybris.cockpitng.widgets.common.WidgetComponentRenderer<org.zkoss.zk.ui.Component,​com.hybris.cockpitng.core.config.impl.jaxb.editorarea.AbstractPanel,​java.lang.Object>

    public class RefundAmountRenderer
    extends com.hybris.cockpitng.widgets.editorarea.renderer.impl.DefaultEditorAreaPanelRenderer
    This renderer renders the total refund amount for a returned order
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.String CURRENT_OBJECT  
      protected static java.lang.String QUALIFIER  
      protected static java.lang.String REFUND_AMOUNT_OBSERVER_ID  
      protected static java.lang.String REFUND_ENTRY  
      • Fields inherited from class com.hybris.cockpitng.widgets.editorarea.renderer.impl.AbstractEditorAreaComponentRenderer

        ATTR_NOT_SAVED_OBJECT, attributeDescriptionIconRenderer, CURRENT_OBJECT_DOTLESS, MISSING_RENDERER_ERROR_MSG, SCLASS_CELL_READ_RESTRICTED, SCLASS_CUSTOM_CONTAINER, SCLASS_DESCRIPTION, SCLASS_DESCRIPTION_LABEL, SCLASS_EDITOR, SCLASS_EDITOR_CONTAINER, SCLASS_LABEL, SCLASS_READONLY_EDITOR
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected com.hybris.cockpitng.components.Editor createEditor​(com.hybris.cockpitng.dataaccess.facades.type.DataAttribute genericAttribute, com.hybris.cockpitng.core.model.WidgetModel model, java.lang.String referencedModelProperty)
      Creates the actual Editor object which gets populated later.
      protected com.hybris.cockpitng.components.Editor createEditor​(com.hybris.cockpitng.dataaccess.facades.type.DataType genericType, com.hybris.cockpitng.engine.WidgetInstanceManager widgetInstanceManager, com.hybris.cockpitng.core.config.impl.jaxb.editorarea.Attribute attribute, java.lang.Object object)
      Render method executes this overridden method
      protected com.hybris.cockpitng.labels.LabelService getLabelService()  
      protected java.math.BigDecimal getOrderRefundAmount​(ReturnRequestModel returnRequest)
      Sums up all the refund amount for all entries and then adds the delivery cost if it is to be refunded
      protected java.math.BigDecimal getRefundEntryAmount​(ReturnEntryModel returnEntryModel)
      Calculates the refund amount for this entry considering the number which was returned
      protected com.hybris.cockpitng.dataaccess.facades.type.TypeFacade getTypeFacade()  
      protected boolean isReferenceEditor​(com.hybris.cockpitng.dataaccess.facades.type.DataAttribute genericAttribute)  
      void render​(org.zkoss.zk.ui.Component component, com.hybris.cockpitng.core.config.impl.jaxb.editorarea.AbstractPanel abstractPanelConfiguration, java.lang.Object object, com.hybris.cockpitng.dataaccess.facades.type.DataType dataType, com.hybris.cockpitng.engine.WidgetInstanceManager widgetInstanceManager)
      Renders the refund amount of the order into a textbox.
      void setLabelService​(com.hybris.cockpitng.labels.LabelService labelService)  
      void setTypeFacade​(com.hybris.cockpitng.dataaccess.facades.type.TypeFacade typeFacade)  
      • Methods inherited from class com.hybris.cockpitng.widgets.editorarea.renderer.impl.DefaultEditorAreaPanelRenderer

        createAttributeRenderer, createCustomHtmlRenderer
      • Methods inherited from class com.hybris.cockpitng.widgets.editorarea.renderer.impl.AbstractEditorAreaComponentRenderer

        buildEditor, canChangeProperty, createCustom, createNotReadableAttributeLabelRenderer, evaluateCustomDefinition, extractParameterName, extractParameterValue, extractPropertiesList, getAttributeDescription, getCockpitLocaleService, getCockpitUserService, getEditAvailabilityProviderFactory, getEditorBuilder, getPermissionFacade, getPropertyValueService, getWidgetRenderingUtils, processEditorBeforeComposition, renderNotReadableLabel, resolveAttributeLabel, resolveAttributePath, resolveCustomComponentRenderer, resolveEditorType, resolveLabel, setAttributeDescriptionIconRenderer, setCockpitLocaleService, setCockpitUserService, setEditAvailabilityProviderFactory, setPermissionFacade, setPropertyValueService, setWidgetRenderingUtils, validateCustomElement
      • Methods inherited from class com.hybris.cockpitng.widgets.common.AbstractWidgetComponentRenderer

        addRendererListener, fireComponentRendered, fireComponentRendered, fireComponentRendered, removeRendererListener
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.hybris.cockpitng.widgets.common.WidgetComponentRenderer

        render
    • Constructor Detail

      • RefundAmountRenderer

        public RefundAmountRenderer()
    • Method Detail

      • render

        public void render​(org.zkoss.zk.ui.Component component,
                           com.hybris.cockpitng.core.config.impl.jaxb.editorarea.AbstractPanel abstractPanelConfiguration,
                           java.lang.Object object,
                           com.hybris.cockpitng.dataaccess.facades.type.DataType dataType,
                           com.hybris.cockpitng.engine.WidgetInstanceManager widgetInstanceManager)
        Renders the refund amount of the order into a textbox.
        Specified by:
        render in interface com.hybris.cockpitng.widgets.common.WidgetComponentRenderer<org.zkoss.zk.ui.Component,​com.hybris.cockpitng.core.config.impl.jaxb.editorarea.AbstractPanel,​java.lang.Object>
        Overrides:
        render in class com.hybris.cockpitng.widgets.editorarea.renderer.impl.DefaultEditorAreaPanelRenderer
        Parameters:
        component -
        abstractPanelConfiguration - as CustomPanel
        object - as ReturnRequestModel
        dataType -
        widgetInstanceManager -
      • createEditor

        protected com.hybris.cockpitng.components.Editor createEditor​(com.hybris.cockpitng.dataaccess.facades.type.DataType genericType,
                                                                      com.hybris.cockpitng.engine.WidgetInstanceManager widgetInstanceManager,
                                                                      com.hybris.cockpitng.core.config.impl.jaxb.editorarea.Attribute attribute,
                                                                      java.lang.Object object)
        Render method executes this overridden method
        Overrides:
        createEditor in class com.hybris.cockpitng.widgets.editorarea.renderer.impl.AbstractEditorAreaComponentRenderer<com.hybris.cockpitng.core.config.impl.jaxb.editorarea.AbstractPanel,​java.lang.Object>
        Parameters:
        genericType -
        widgetInstanceManager -
        attribute -
        object -
        Returns:
        the Editor
      • createEditor

        protected com.hybris.cockpitng.components.Editor createEditor​(com.hybris.cockpitng.dataaccess.facades.type.DataAttribute genericAttribute,
                                                                      com.hybris.cockpitng.core.model.WidgetModel model,
                                                                      java.lang.String referencedModelProperty)
        Creates the actual Editor object which gets populated later.
        Parameters:
        genericAttribute -
        model -
        referencedModelProperty -
      • getOrderRefundAmount

        protected java.math.BigDecimal getOrderRefundAmount​(ReturnRequestModel returnRequest)
        Sums up all the refund amount for all entries and then adds the delivery cost if it is to be refunded
        Parameters:
        returnRequest - the model containing the list of ReturnEntryModel
        Returns:
        the total refund amount
      • getRefundEntryAmount

        protected java.math.BigDecimal getRefundEntryAmount​(ReturnEntryModel returnEntryModel)
        Calculates the refund amount for this entry considering the number which was returned
        Parameters:
        returnEntryModel -
        Returns:
        the refund amount for a single entry
      • isReferenceEditor

        protected boolean isReferenceEditor​(com.hybris.cockpitng.dataaccess.facades.type.DataAttribute genericAttribute)
      • getTypeFacade

        protected com.hybris.cockpitng.dataaccess.facades.type.TypeFacade getTypeFacade()
      • setTypeFacade

        public void setTypeFacade​(com.hybris.cockpitng.dataaccess.facades.type.TypeFacade typeFacade)
      • getLabelService

        protected com.hybris.cockpitng.labels.LabelService getLabelService()
        Overrides:
        getLabelService in class com.hybris.cockpitng.widgets.editorarea.renderer.impl.AbstractEditorAreaComponentRenderer<com.hybris.cockpitng.core.config.impl.jaxb.editorarea.AbstractPanel,​java.lang.Object>
      • setLabelService

        public void setLabelService​(com.hybris.cockpitng.labels.LabelService labelService)
        Overrides:
        setLabelService in class com.hybris.cockpitng.widgets.editorarea.renderer.impl.AbstractEditorAreaComponentRenderer<com.hybris.cockpitng.core.config.impl.jaxb.editorarea.AbstractPanel,​java.lang.Object>