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.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PDropDownprotected PIACustomizablePanelprotected PIATextAreaFieldprotected JLabelprotected PIAScrollPaneprotected PIACustomizablePanelprotected JLabelprotected PProductAttributesPanelprotected PIANumberFieldprotected JLabelFields inherited from class com.portal.app.cc.comp.PMaintenancePage
mNeedsRefresh, mPagesCurrentCurrencyFields inherited from class com.portal.bas.comp.PIACustomizablePanel
isTracking, mIAList, mImpl, unregListFields inherited from class com.portal.pfc.ui.ImagePanel
IMAGE_CENTERED, IMAGE_SCALE_TO_HEIGHT, IMAGE_SCALE_TO_WIDTH, IMAGE_SCALED, IMAGE_TILED, mImageIcon, mScaledImageFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) voidaddElementToFlist(FList parent, ArrayField field, FList value, int index) Adding element to parent FList.voidOverridden 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 availablevoidcollectData(PCollectDataEvent event) OverridesPCollectDataListener.voidThis 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.booleanisDirty()Determines if any descendant is marked DIRTY in its current context.booleanChecks for valid data entries.protected voidThis is used during deal purchase.voidcollects current product changes This implementation calls super.collectData() and also collects data about Status, Dates, Discount and override fieldsprotected voidAffords subclasses the opportunity to inspect the data that is about to be committed to Portal.voidvoidrecycle()Used to make this page available for reuse.voidrefresh()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.voidvoidThis gets called if the wizard operation is cancelled during deal purchase or wizard operation is finished.voidsave()This is crucial method for saving base product+customized product.protected voidThis is introduced during deal purchase.voidEvent handler for ServiceChangeEvent.voidsetAdvancedCustomizationDuringDealPurchase(boolean wIsAdvancedCustomization) This gets called during deal purchase.protected voidvoidsetDealPermissionFlag(int flag) Accepts an int value for deal level customizability permission associated with this productvoidsetDealsPurchaseProduct(int wRealIndex, PModelHandle pModelHandle) Applicable during deal purchase.voidsetEnabled(boolean b) Overrides super class' method.voidsetIsCustomizeProductsPageVisited(boolean isVisited) This method is used to set whether 'Customize Products' page is visited or not.voidAccepts 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 voidsetProductStatus(boolean enable) Use this method to enable/disable the product_status_combo(mProductStatus) and inactive_flags_panel(mChangeStatusFlagsPanel).voidsetProductStatusEnabled(boolean b) voidsetSponsorshipData(SponsorshipData[] sData, ArrayList sProd) Sets the sponsorship information for the panel.voidsetVisible(boolean wFlag) voidEvent handler for StatusChagneEvent.Methods inherited from class com.portal.app.cc.comp.PMaintenancePage
dataNeedsRefresh, getDisplayedCurrency, getLabel, hasUnsavedChanges, isValidContext, primaryToSecondary, resetUnsavedChanges, revertToPrimaryMethods 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, viewDataChangeMethods inherited from class com.portal.pfc.ui.ImagePanel
getBackgroundImageIcon, getBackgroundImageMode, imageUpdate, paintComponent, setBackgroundImageIconMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, updateMethods 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, validateTreeMethods 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:PIACustomizablePanelDetermines if any descendant is marked DIRTY in its current context.- Specified by:
isDirtyin interfacePComponentAttribute- Overrides:
isDirtyin classPIACustomizablePanel- Returns:
- True if any descendant is marked DIRTY; false otherwise.
-
recycle
public void recycle()Description copied from class:PMaintenancePageUsed to make this page available for reuse.
Subclasses should override this, but also call super.recycle()- Specified by:
recyclein interfacePCCPage- Overrides:
recyclein classPMaintenancePage
-
collectData
Description copied from class:PIACustomizablePanelOverridesPCollectDataListener. Forwarded to all contained GUIComponents that are alsoPCollectDataListeners.- Specified by:
collectDatain interfacePCollectDataListener- Overrides:
collectDatain classPIACustomizablePanel- Parameters:
event- thePCollectDataEventevent
-
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:
addNotifyin classJComponent
-
removeNotify
public void removeNotify()- Overrides:
removeNotifyin classJComponent
-
statusChange
Event handler for StatusChagneEvent.- Specified by:
statusChangein interfaceStatusChangeListener- Parameters:
e- a StatusChangeEvent
-
serviceChange
Event handler for ServiceChangeEvent.- Specified by:
serviceChangein interfaceServiceChangeListener- Parameters:
e- a StatusChangeEvent
-
propertyChange
- Specified by:
propertyChangein 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:
setModelHandlein interfacePComponent- Overrides:
setModelHandlein 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:
refreshin interfacePAccountViewPage- Overrides:
refreshin 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:
savein interfacePAccountViewPage- Overrides:
savein classPMaintenancePage- Throws:
PSaveException
-
getControllerClassName
Gets the class name for this class's controller- Specified by:
getControllerClassNamein interfacePComponent- Overrides:
getControllerClassNamein 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:
setEnabledin classJComponent
-
actionPerformed
- Specified by:
actionPerformedin 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:
enteringPagein interfacePCCPage- Overrides:
enteringPagein 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:
setVisiblein classJComponent
-