Package com.portal.app.cc
Class PProductDetailsPanel
- All Implemented Interfaces:
PAccountViewPage
,PCCPage
,ServiceChangeListener
,StatusChangeListener
,PAppComponent
,PClientComponent
,PCollectDataListener
,PComponent
,PComponentAttribute
,PViewDataChangeListener
,ActionListener
,ContainerListener
,ImageObserver
,MenuContainer
,PropertyChangeListener
,Serializable
,EventListener
,Accessible
public class PProductDetailsPanel
extends PMaintenancePage
implements ActionListener, PropertyChangeListener, StatusChangeListener, ServiceChangeListener
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:
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PDropDown
protected PIACustomizablePanel
protected PIATextAreaField
protected JLabel
protected PIAScrollPane
protected PIACustomizablePanel
protected JLabel
protected PProductAttributesPanel
protected PIANumberField
protected JLabel
Fields inherited from class com.portal.app.cc.comp.PMaintenancePage
mNeedsRefresh, mPagesCurrentCurrency
Fields inherited from class com.portal.bas.comp.PIACustomizablePanel
isTracking, mIAList, mImpl, unregList
Fields inherited from class com.portal.pfc.ui.ImagePanel
IMAGE_CENTERED, IMAGE_SCALE_TO_HEIGHT, IMAGE_SCALE_TO_WIDTH, IMAGE_SCALED, IMAGE_TILED, mImageIcon, mScaledImage
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
actionPerformed
(ActionEvent event) void
addElementToFlist
(FList parent, ArrayField field, FList value, int index) Adding element to parent FList.void
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 availablevoid
collectData
(PCollectDataEvent event) OverridesPCollectDataListener
.void
This frame work method will be called right after a page is made visible via a drilldown.Gets the class name for this class's controllerReturn the FList for the base products which has customized products.boolean
isDirty()
Determines if any descendant is marked DIRTY in its current context.boolean
Checks for valid data entries.protected void
This is used during deal purchase.void
collects current product changes This implementation calls super.collectData() and also collects data about Status, Dates, Discount and override fieldsprotected void
Affords subclasses the opportunity to inspect the data that is about to be committed to Portal.void
void
recycle()
Used to make this page available for reuse.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.void
void
This gets called if the wizard operation is cancelled during deal purchase or wizard operation is finished.void
save()
This is crucial method for saving base product+customized product.protected void
This is introduced during deal purchase.void
Event handler for ServiceChangeEvent.void
setAdvancedCustomizationDuringDealPurchase
(boolean wIsAdvancedCustomization) This gets called during deal purchase.protected void
void
setDealPermissionFlag
(int flag) Accepts an int value for deal level customizability permission associated with this productvoid
setDealsPurchaseProduct
(int wRealIndex, PModelHandle pModelHandle) Applicable during deal purchase.void
setEnabled
(boolean b) Overrides super class' method.void
setIsCustomizeProductsPageVisited
(boolean isVisited) This method is used to set whether 'Customize Products' page is visited or not.void
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 editingprotected void
setProductStatus
(boolean enable) Use this method to enable/disable the product_status_combo(mProductStatus) and inactive_flags_panel(mChangeStatusFlagsPanel).void
setProductStatusEnabled
(boolean b) void
setSponsorshipData
(SponsorshipData[] sData, ArrayList sProd) Sets the sponsorship information for the panel.void
setVisible
(boolean wFlag) void
Event handler for StatusChagneEvent.Methods inherited from class com.portal.app.cc.comp.PMaintenancePage
dataNeedsRefresh, getDisplayedCurrency, getLabel, hasUnsavedChanges, isValidContext, primaryToSecondary, resetUnsavedChanges, revertToPrimary
Methods inherited from class com.portal.bas.comp.PIACustomizablePanel
clear, componentAdded, componentRemoved, containsError, getBackgroundImageSource, getBundle, getModelHandle, getRemoteComponent, getResourceName, getTools, isClean, isCurrencyDisplay, isError, isInputTracking, isLight, isRequired, processError, resetToDefault, setBackgroundImageMode, setBackgroundImageSource, setClean, setCurrencyDisplay, setDefault, setError, setInputTracking, setRequired, setResourceName, togglePrimaryToSecondary, unregister, viewDataChange
Methods inherited from class com.portal.pfc.ui.ImagePanel
getBackgroundImageIcon, getBackgroundImageMode, imageUpdate, paintComponent, setBackgroundImageIcon
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
mDetailsPanel
-
mQuantityLabel
-
mQuantity
-
mChangeStatusPanel
-
mInactiveStatusLabel
-
mCommentsLabel
-
mCommentsScrollPane
-
mComments
-
mProductAttributePanel
-
mAdvancedCustomizationMenu
-
-
Constructor Details
-
PProductDetailsPanel
public PProductDetailsPanel()Creates a new product details display panel.
-
-
Method Details
-
setSponsorshipData
Sets the sponsorship information for the panel.- Parameters:
sData
- an array of sponsor group informationsProd
- 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 interfacePComponentAttribute
- Overrides:
isDirty
in classPIACustomizablePanel
- 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 interfacePCCPage
- Overrides:
recycle
in classPMaintenancePage
-
collectData
Description copied from class:PIACustomizablePanel
OverridesPCollectDataListener
. Forwarded to all contained GUIComponents that are alsoPCollectDataListeners
.- Specified by:
collectData
in interfacePCollectDataListener
- Overrides:
collectData
in classPIACustomizablePanel
- Parameters:
event
- thePCollectDataEvent
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 classJComponent
-
removeNotify
public void removeNotify()- Overrides:
removeNotify
in classJComponent
-
statusChange
Event handler for StatusChagneEvent.- Specified by:
statusChange
in interfaceStatusChangeListener
- Parameters:
e
- a StatusChangeEvent
-
serviceChange
Event handler for ServiceChangeEvent.- Specified by:
serviceChange
in interfaceServiceChangeListener
- Parameters:
e
- a StatusChangeEvent
-
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
-
setModelHandle
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 interfacePComponent
- Overrides:
setModelHandle
in classPIACustomizablePanel
- Parameters:
pm
- Model handle for the product- Throws:
RemoteException
- thrown for errors
-
setDealPermissionFlag
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 interfacePAccountViewPage
- Overrides:
refresh
in classPMaintenancePage
-
save
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 interfacePAccountViewPage
- Overrides:
save
in classPMaintenancePage
- Throws:
PSaveException
-
getControllerClassName
Gets the class name for this class's controller- Specified by:
getControllerClassName
in interfacePComponent
- Overrides:
getControllerClassName
in classPIACustomizablePanel
- 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 classJComponent
-
actionPerformed
- Specified by:
actionPerformed
in interfaceActionListener
-
setProductStatusEnabled
public void setProductStatusEnabled(boolean b) -
preCommit
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 interfacePCCPage
- Overrides:
enteringPage
in classPMaintenancePage
-
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
-
localCollectData
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
-
setDealsPurchaseProduct
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
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
Adding element to parent FList.- Parameters:
parent
-field
-value
-index
-
-
setVisible
public void setVisible(boolean wFlag) - Overrides:
setVisible
in classJComponent
-