Class PProductDetailsPanel

All Implemented Interfaces:
PAccountViewPage, PCCPage, ServiceChangeListener, StatusChangeListener, PAppComponent, PClientComponent, PCollectDataListener, PComponent, PComponentAttribute, PViewDataChangeListener, ActionListener, ContainerListener, ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible

Panel for viewing/modifying Product details information during account creation, when purchasing a deal or plan, or when looking at an existing product in an account.

Subclasses can add custom fields to this panel along the following lines:
 public class MyBillPanel extends PProductDetailsPanel {
        public MyBillPanel() {
                PIACustomizablePanel p = new PIACustomizablePanel();
                p.setLayout(new GridBagLayout());
                p.add(new JLabel("One"), new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
                                GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                                new Insets(10, 5, 0, 0), 0, 0));
                p.add(new JLabel("Two"), new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
                                GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                                new Insets(10, 5, 0, 0), 0, 0));
                p.add(new JTextField(10), new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
                                GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                                new Insets(10, 5, 0, 0), 0, 0));
                p.add(new JTextField(10), new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0,
                                GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                                new Insets(10, 5, 0, 0), 0, 0));
                setCustomData(p);
        }
 }
 
See Also:
  • Field Details

  • Constructor Details

    • PProductDetailsPanel

      public PProductDetailsPanel()
      Creates a new product details display panel.
  • Method Details

    • setSponsorshipData

      public void setSponsorshipData(SponsorshipData[] sData, ArrayList sProd)
      Sets the sponsorship information for the panel.
      Parameters:
      sData - an array of sponsor group information
      sProd - a list of sponsored products
    • isDirty

      public boolean isDirty()
      Description copied from class: PIACustomizablePanel
      Determines if any descendant is marked DIRTY in its current context.
      Specified by:
      isDirty in interface PComponentAttribute
      Overrides:
      isDirty in class PIACustomizablePanel
      Returns:
      True if any descendant is marked DIRTY; false otherwise.
    • recycle

      public void recycle()
      Description copied from class: PMaintenancePage
      Used to make this page available for reuse.

      Subclasses should override this, but also call super.recycle()
      Specified by:
      recycle in interface PCCPage
      Overrides:
      recycle in class PMaintenancePage
    • collectData

      public void collectData(PCollectDataEvent event)
      Description copied from class: PIACustomizablePanel
      Overrides PCollectDataListener. Forwarded to all contained GUIComponents that are also PCollectDataListeners.
      Specified by:
      collectData in interface PCollectDataListener
      Overrides:
      collectData in class PIACustomizablePanel
      Parameters:
      event - the PCollectDataEvent event
    • setAdvancedCustomizationDuringDealPurchase

      public void setAdvancedCustomizationDuringDealPurchase(boolean wIsAdvancedCustomization)
      This gets called during deal purchase.
      Parameters:
      wIsAdvancedCustomization -
    • addNotify

      public void addNotify()
      Overridden to apply the font style to the header label, and the correct look and feel color to the components in the header Also, it retrieves currency value which has just became available
      Overrides:
      addNotify in class JComponent
    • removeNotify

      public void removeNotify()
      Overrides:
      removeNotify in class JComponent
    • statusChange

      public void statusChange(StatusChangeEvent e)
      Event handler for StatusChagneEvent.
      Specified by:
      statusChange in interface StatusChangeListener
      Parameters:
      e - a StatusChangeEvent
    • serviceChange

      public void serviceChange(ServiceChangeEvent e)
      Event handler for ServiceChangeEvent.
      Specified by:
      serviceChange in interface ServiceChangeListener
      Parameters:
      e - a StatusChangeEvent
    • propertyChange

      public void propertyChange(PropertyChangeEvent event)
      Specified by:
      propertyChange in interface PropertyChangeListener
    • setModelHandle

      public void setModelHandle(PModelHandle pm) throws RemoteException
      Accepts a PModelHandle of a product to be displayed May be followed by a setDealPermissionFlag(int) call to further indicate whether the product has deal level permission for editing
      Specified by:
      setModelHandle in interface PComponent
      Overrides:
      setModelHandle in class PIACustomizablePanel
      Parameters:
      pm - Model handle for the product
      Throws:
      RemoteException - thrown for errors
    • setDealPermissionFlag

      public void setDealPermissionFlag(int flag) throws RemoteException
      Accepts an int value for deal level customizability permission associated with this product
      Parameters:
      flag - int value for Optional, Required or Prohibited permission level
      Throws:
      RemoteException
    • isSwitchable

      public boolean isSwitchable()
      Checks for valid data entries. Data being validated by this method is:
    • Quantity
    • Discount/Override Amounts
    • Offset Unit
    • Dates
    • Status
    • Deal Customization
    • Returns:
      true if data on this page has no invalid data and can be switched; false otherwise
    • refresh

      public void refresh()
      When we have customized products, the refresh should happen with the base product not with any customized product as the base product is the prime model for this panel.
      Specified by:
      refresh in interface PAccountViewPage
      Overrides:
      refresh in class PMaintenancePage
    • save

      public void save() throws PSaveException
      This is crucial method for saving base product+customized product. The caller will get SaveException if any error happens. If the save exception is risen,The caller deciedes the course of action.
      Specified by:
      save in interface PAccountViewPage
      Overrides:
      save in class PMaintenancePage
      Throws:
      PSaveException
    • getControllerClassName

      public String getControllerClassName() throws RemoteException
      Gets the class name for this class's controller
      Specified by:
      getControllerClassName in interface PComponent
      Overrides:
      getControllerClassName in class PIACustomizablePanel
      Returns:
      a String with the component's controller's classname
      Throws:
      RemoteException - thrown for errors
    • setEnabled

      public void setEnabled(boolean b)
      Overrides super class' method. @ parameter b - If true, this component and its children are enabled; otherwise disabled.
      Overrides:
      setEnabled in class JComponent
    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Specified by:
      actionPerformed in interface ActionListener
    • setProductStatusEnabled

      public void setProductStatusEnabled(boolean b)
    • preCommit

      protected void preCommit(PModelHandle pm) throws PSaveException
      Affords subclasses the opportunity to inspect the data that is about to be committed to Portal. If you wish to halt the save process for any reason throw a PSaveException. It is the subclass' responsibility to display an error dialog in this case.
      Throws:
      PSaveException
    • enteringPage

      public void enteringPage()
      This frame work method will be called right after a page is made visible via a drilldown. calling super's class method is requred which will take care of the currency toggling in this page
      Specified by:
      enteringPage in interface PCCPage
      Overrides:
      enteringPage in class PMaintenancePage
    • selectPreviousSelectedRow

      protected void selectPreviousSelectedRow()
      This is introduced during deal purchase. This helps to select the right row if user moves from the last page of the wizard to this page in case of failure. Keeps track the last selected row and select the same row so that changes that are displayed in the panel are right.
    • setIsCustomizeProductsPageVisited

      public void setIsCustomizeProductsPageVisited(boolean isVisited)
      This method is used to set whether 'Customize Products' page is visited or not. This is needed when the user presses 'finish' without visiting the 'Customize Products' page, and it is used only during account creation as of now.
      Parameters:
      isVisited -
    • leavingPage

      protected void leavingPage()
      This is used during deal purchase. Helps to collect the data for customized products(Especially for the last row).
    • setCustomData

      protected void setCustomData(PIACustomizablePanel p)
    • localCollectData

      public void localCollectData(PCollectDataEvent event) throws RemoteException
      collects current product changes This implementation calls super.collectData() and also collects data about Status, Dates, Discount and override fields
      Parameters:
      The - collect data event
      Throws:
      RemoteException
    • setProductStatus

      protected void setProductStatus(boolean enable)
      Use this method to enable/disable the product_status_combo(mProductStatus) and inactive_flags_panel(mChangeStatusFlagsPanel). Componenets will be enabled only when the following conditions are met: 1. enable passed as true. 2. Customizer flag allow.modify.productStatus=true 3. Permission /accounttool/product/status has write access 4. Permission /accounttool/product/modify has write access
    • getAttributesPanel

      public PProductAttributesPanel getAttributesPanel()
    • setDealsPurchaseProduct

      public void setDealsPurchaseProduct(int wRealIndex, PModelHandle pModelHandle)
      Applicable during deal purchase. This gets fired only for the products not for the discounts. This helps to capture the dates in displayable format in the customized table.
      Parameters:
      wRealIndex -
      pModelHandle -
    • resetPurchaseDealCustomized

      public void resetPurchaseDealCustomized()
      This gets called if the wizard operation is cancelled during deal purchase or wizard operation is finished. Helps to reset the values and releases the memory.
    • getPurchaseDealInputFlist

      public FList getPurchaseDealInputFlist()
      Return the FList for the base products which has customized products. Before adding to main FList , It gets cloned so that model handle in the table will not get tampered. Add the base products to main FList. For each base product, add the customized product which will have array reference of the base product. Makes sure that customized products are appended at the right index to the main FList. (This should not clash with the base products indeces in the main FList). To do this we use customizedProductsCounter=(wBaseProductsSize+wCustomizedSize)*(basePCounter+1);
      Returns:
      FList
    • addElementToFlist

      public void addElementToFlist(FList parent, ArrayField field, FList value, int index)
      Adding element to parent FList.
      Parameters:
      parent -
      field -
      value -
      index -
    • setVisible

      public void setVisible(boolean wFlag)
      Overrides:
      setVisible in class JComponent