Class AtpFormulaPanelRenderer

  • 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 AtpFormulaPanelRenderer
    extends com.hybris.cockpitng.widgets.editorarea.renderer.impl.DefaultEditorAreaPanelRenderer
    This panel renderer allows displaying AtpFormula variables In order to guarantee proper rendering, you cannot reuse the same instance of this renderer across multiple widgets.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.String ADD_VARIABLE_IN_ATPFORMULA  
      protected static java.lang.String ATPFORMULA_BUILDER_HEADER_ACTIONS  
      protected static java.lang.String ATPFORMULA_BUILDER_HEADER_VARIABLES  
      protected static java.lang.String ATPFORMULA_TABLE_CLASS  
      protected static java.lang.String AVAILABILITY  
      protected static java.lang.String MINUS_OPERATOR  
      protected static java.lang.String PLUS_OPERATOR  
      protected static java.lang.String SUB_VARIABLE_IN_ATPFORMULA  
      • Fields inherited from class com.hybris.cockpitng.widgets.editorarea.renderer.impl.AbstractEditorAreaComponentRenderer

        ATTR_NOT_SAVED_OBJECT, attributeDescriptionIconRenderer, CURRENT_OBJECT, 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 java.util.Set<java.beans.PropertyDescriptor> getAllAtpFormulaVariables​(AtpFormulaModel atpFormula)
      Provides the Set of atpformula's properties
      protected java.util.Map<java.lang.String,​java.lang.String> getAtpFormulaVar2ArithmeticOperatorMap()  
      protected com.hybris.cockpitng.dataaccess.facades.object.ObjectFacade getObjectFacade()  
      protected com.hybris.cockpitng.dataaccess.facades.type.TypeFacade getTypeFacade()  
      protected void handleOnCheckEvent​(AtpFormulaModel atpFormula, com.hybris.cockpitng.engine.WidgetInstanceManager widgetInstanceManager, java.beans.PropertyDescriptor formulaVarPropertyDescriptor, org.zkoss.zul.Checkbox checkbox)
      Updates the current formula variable to the ATP formula.
      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 ATP Formula variables.
      protected void renderAtpFormulaBuilderHeader​(org.zkoss.zul.Vlayout vlayout)
      Renders the Atp Formula Builder Header.
      protected void renderAtpFormulaVariableRow​(AtpFormulaModel atpFormula, com.hybris.cockpitng.engine.WidgetInstanceManager widgetInstanceManager, org.zkoss.zul.Vlayout vlayout, java.beans.PropertyDescriptor formulaVarPropertyDescriptor)
      Renders the given Atp formula variable
      protected void renderAtpFormulaVariables​(org.zkoss.zk.ui.HtmlBasedComponent attributeContainer, AtpFormulaModel atpFormula, com.hybris.cockpitng.engine.WidgetInstanceManager widgetInstanceManager)
      Renders the properties of AtpFormulaModel along with +/- option to either add or subtract the corresponding property in the AtpFormulaModel.
      protected void renderIndividualFormulaVariables​(AtpFormulaModel atpFormula, com.hybris.cockpitng.engine.WidgetInstanceManager widgetInstanceManager, org.zkoss.zul.Vlayout vlayout)
      Renders each individual formula variable with the +/- and remove options.
      protected void setAfterCancelListener​(com.hybris.cockpitng.engine.WidgetInstanceManager widgetInstanceManager)
      Adds afterCancelListener, so as to reinitialize with original values when the Refresh button is pressed in the editor area
      void setAtpFormulaVar2ArithmeticOperatorMap​(java.util.Map<java.lang.String,​java.lang.String> atpFormulaVar2ArithmeticOperatorMap)  
      void setObjectFacade​(com.hybris.cockpitng.dataaccess.facades.object.ObjectFacade objectFacade)  
      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, createEditor, createNotReadableAttributeLabelRenderer, evaluateCustomDefinition, extractParameterName, extractParameterValue, extractPropertiesList, getAttributeDescription, getCockpitLocaleService, getCockpitUserService, getEditAvailabilityProviderFactory, getEditorBuilder, getLabelService, getPermissionFacade, getPropertyValueService, getWidgetRenderingUtils, processEditorBeforeComposition, renderNotReadableLabel, resolveAttributeLabel, resolveAttributePath, resolveCustomComponentRenderer, resolveEditorType, resolveLabel, setAttributeDescriptionIconRenderer, setCockpitLocaleService, setCockpitUserService, setEditAvailabilityProviderFactory, setLabelService, 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
    • Field Detail

      • ADD_VARIABLE_IN_ATPFORMULA

        protected static final java.lang.String ADD_VARIABLE_IN_ATPFORMULA
        See Also:
        Constant Field Values
      • SUB_VARIABLE_IN_ATPFORMULA

        protected static final java.lang.String SUB_VARIABLE_IN_ATPFORMULA
        See Also:
        Constant Field Values
      • ATPFORMULA_BUILDER_HEADER_ACTIONS

        protected static final java.lang.String ATPFORMULA_BUILDER_HEADER_ACTIONS
        See Also:
        Constant Field Values
      • ATPFORMULA_BUILDER_HEADER_VARIABLES

        protected static final java.lang.String ATPFORMULA_BUILDER_HEADER_VARIABLES
        See Also:
        Constant Field Values
      • ATPFORMULA_TABLE_CLASS

        protected static final java.lang.String ATPFORMULA_TABLE_CLASS
        See Also:
        Constant Field Values
    • Constructor Detail

      • AtpFormulaPanelRenderer

        public AtpFormulaPanelRenderer()
    • 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 ATP Formula variables.
        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 -
        object -
        dataType -
        widgetInstanceManager -
      • renderAtpFormulaVariables

        protected void renderAtpFormulaVariables​(org.zkoss.zk.ui.HtmlBasedComponent attributeContainer,
                                                 AtpFormulaModel atpFormula,
                                                 com.hybris.cockpitng.engine.WidgetInstanceManager widgetInstanceManager)
        Renders the properties of AtpFormulaModel along with +/- option to either add or subtract the corresponding property in the AtpFormulaModel.
        Parameters:
        attributeContainer -
        atpFormula -
        widgetInstanceManager -
      • renderIndividualFormulaVariables

        protected void renderIndividualFormulaVariables​(AtpFormulaModel atpFormula,
                                                        com.hybris.cockpitng.engine.WidgetInstanceManager widgetInstanceManager,
                                                        org.zkoss.zul.Vlayout vlayout)
        Renders each individual formula variable with the +/- and remove options.
        Parameters:
        atpFormula -
        widgetInstanceManager -
        vlayout -
      • renderAtpFormulaVariableRow

        protected void renderAtpFormulaVariableRow​(AtpFormulaModel atpFormula,
                                                   com.hybris.cockpitng.engine.WidgetInstanceManager widgetInstanceManager,
                                                   org.zkoss.zul.Vlayout vlayout,
                                                   java.beans.PropertyDescriptor formulaVarPropertyDescriptor)
        Renders the given Atp formula variable
        Parameters:
        atpFormula - the AtpFormulaModel to be rendered
        widgetInstanceManager - the WidgetInstanceManager
        vlayout - the Vlayout to contain the rendered atpformula variable
        formulaVarPropertyDescriptor - the PropertyDescriptor for the AtpFormula variable being rendered
      • handleOnCheckEvent

        protected void handleOnCheckEvent​(AtpFormulaModel atpFormula,
                                          com.hybris.cockpitng.engine.WidgetInstanceManager widgetInstanceManager,
                                          java.beans.PropertyDescriptor formulaVarPropertyDescriptor,
                                          org.zkoss.zul.Checkbox checkbox)
        Updates the current formula variable to the ATP formula.
        Parameters:
        atpFormula -
        widgetInstanceManager -
        formulaVarPropertyDescriptor -
      • renderAtpFormulaBuilderHeader

        protected void renderAtpFormulaBuilderHeader​(org.zkoss.zul.Vlayout vlayout)
        Renders the Atp Formula Builder Header.
        Parameters:
        vlayout -
      • setAfterCancelListener

        protected void setAfterCancelListener​(com.hybris.cockpitng.engine.WidgetInstanceManager widgetInstanceManager)
        Adds afterCancelListener, so as to reinitialize with original values when the Refresh button is pressed in the editor area
        Parameters:
        widgetInstanceManager -
      • getAllAtpFormulaVariables

        protected java.util.Set<java.beans.PropertyDescriptor> getAllAtpFormulaVariables​(AtpFormulaModel atpFormula)
        Provides the Set of atpformula's properties
        Returns:
        all atpFormulaVariables
      • getTypeFacade

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

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

        protected com.hybris.cockpitng.dataaccess.facades.object.ObjectFacade getObjectFacade()
      • setObjectFacade

        public void setObjectFacade​(com.hybris.cockpitng.dataaccess.facades.object.ObjectFacade objectFacade)
      • getAtpFormulaVar2ArithmeticOperatorMap

        protected java.util.Map<java.lang.String,​java.lang.String> getAtpFormulaVar2ArithmeticOperatorMap()
      • setAtpFormulaVar2ArithmeticOperatorMap

        public void setAtpFormulaVar2ArithmeticOperatorMap​(java.util.Map<java.lang.String,​java.lang.String> atpFormulaVar2ArithmeticOperatorMap)