Class PProductAttributesPanel

All Implemented Interfaces:
PAppComponent, PClientComponent, PCollectDataListener, PComponent, PComponentAttribute, PViewDataChangeListener, ActionListener, ContainerListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class PProductAttributesPanel extends PIACustomizablePanel implements ActionListener
This Class holds the GUI components for the validity period of the products This class is reused for the Validity Period Panel in Tailormadeplan feature
See Also:
  • Field Details

  • Constructor Details

    • PProductAttributesPanel

      public PProductAttributesPanel()
      constructs the PProductAttributesPanel
  • Method Details

    • resizefields

      protected void resizefields()
    • doPurchaseDiscountInits

      protected void doPurchaseDiscountInits(boolean hasAmount)
    • doCycleDiscountInits

      protected void doCycleDiscountInits(boolean hasAmount)
    • doPurchaseOverrideInits

      protected void doPurchaseOverrideInits(boolean override)
    • doCycleOverrideInits

      protected void doCycleOverrideInits(boolean override)
    • setCyclePanelEnabled

      public void setCyclePanelEnabled(boolean b)
    • setUsageEnabled

      public void setUsageEnabled(boolean b)
    • setMultiMonthPanelEnabled

      public void setMultiMonthPanelEnabled(boolean b)
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      actionPerformed
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      e - ActionEvent
    • isInWizard

      protected boolean isInWizard()
      isInWizard
      Returns:
      boolean whether the panel is in wizard
    • setCurrentTimeToDateCtrl

      protected void setCurrentTimeToDateCtrl(PCollectDataEvent event)
    • validateOffsetUnit

      public void validateOffsetUnit() throws Exception
      Validates status.
      Throws:
      Exception - with error message if failed.
    • validateDiscountOverrideAmounts

      public void validateDiscountOverrideAmounts()
      Validates Discount and Override Amounts
    • validateDates

      public void validateDates() throws Exception
      Validates dates.
      Throws:
      Exception - with error message if failed.
    • isEndDateConfirmed

      public boolean isEndDateConfirmed()
      Ask for the confirmation before saving if default end dates are not changed
      Returns:
      true if the falg is off or user selects Yes in the confirmation when the flag is on false if user selects NO in the confirmation when the flag is on
    • setBackdateData

      public void setBackdateData(boolean flag, Date date)
      called by PCustomizeProductsPanel to let this panel know that backdate option is selected/deselected and the selected back date
      Parameters:
      flag - true if backdate option is selected, false otherwise
      date - selected backdate if backdate option is selected, current date otherwise
    • handleRButtonAction

      protected void handleRButtonAction(Object source)
    • handleCBoxAction

      protected void handleCBoxAction(Object source)
    • initProductPurchaseDetailsObjects

      protected void initProductPurchaseDetailsObjects()
    • setRateFieldsVisible

      public void setRateFieldsVisible(boolean b)
    • setAmountFieldsVisible

      public void setAmountFieldsVisible(boolean b)
    • setPurchasePanelEnabled

      protected void setPurchasePanelEnabled(boolean b)
    • setMultiMonthPanelVisible

      public void setMultiMonthPanelVisible(boolean b)
    • getPurchaseStartDateField

      public PIADateField getPurchaseStartDateField()
    • getCycleStartDateField

      public PIADateField getCycleStartDateField()
    • getUsageStartDateField

      public PIADateField getUsageStartDateField()
    • areDateFieldsDirty

      protected boolean areDateFieldsDirty()
      This method returns true if any of the validity period section has modified
      Returns:
      boolean
    • collectDateFieldsData

      public void collectDateFieldsData(PCollectDataEvent event)
      collects the modified data and updates the model handle
      Parameters:
      event - PCollectDataEvent In case of Absolute and Never Ends date, Unit and Offset should be 0. In case of First Usage, Unit should be -1 and Offset should be 0 In case of Relative date, Unit and Offset will be same as the user selection.
    • decodeDate

      protected static Object[] decodeDate(int encodedModeUnitOffset)
      this method will decode the start_details/end_details to unit and offset
      Parameters:
      encodedUnitOffset - Object, encoded relative date
      Returns:
      Object[], unit and offset array
    • initializeDateValues

      public void initializeDateValues(PModelHandle pModelHandle) throws RemoteException
      Throws:
      RemoteException
    • updateValidityDatesUI

      protected void updateValidityDatesUI(boolean status)
    • disableOrEnableAll

      protected void disableOrEnableAll(JPanel wPanel, boolean status)
    • setIsCustomizedProductValidity

      public void setIsCustomizedProductValidity(boolean b)
    • setIsCustomizableDuringDealPurchase

      public void setIsCustomizableDuringDealPurchase(boolean wIsCustomizableDuringDealPurchase)
    • setDealCustomizedFlag

      public void setDealCustomizedFlag(int dealCustomizeFlag)
    • isFirstUsage

      public boolean isFirstUsage(String wFieldName)
    • whichMode

      protected int whichMode(String wFieldName, PModelHandle wModelHandle)
    • setEnabled

      public void setEnabled(boolean isEnabled)
      This overriden method checks the following permissions /customercenter/plans/productdetails/purchase /customercenter/plans/productdetails/cycle /customercenter/plans/productdetails/usage if isEnabled is passed as true and if it is during account maintenance. Based on the above permissions purchase/usage/cycle sections will be enabled/disabled. If isEnabled is passed as false then the purchase/cycle/usage section's permissions need not be checked and all the sections will be disabled.
      Overrides:
      setEnabled in class JComponent
      Parameters:
      boolean - isEnabled pass true to enable the product attributes, If true passed then permissions also will be considered.
    • validateRangeInProductCustomizationsPanel

      public void validateRangeInProductCustomizationsPanel() throws Exception
      Check if the amount fields of 'Purchase','Cycle' sections of 'Product customizations' panel exceeds its respective min-max range.
      Throws:
      Exception - Value is not in range.