Package com.portal.app.cc
Class PProductAttributesPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.portal.pfc.ui.ImagePanel
com.portal.bas.comp.PIACustomizablePanel
com.portal.app.cc.PProductAttributesPanel
- All Implemented Interfaces:
PAppComponent,PClientComponent,PCollectDataListener,PComponent,PComponentAttribute,PViewDataChangeListener,ActionListener,ContainerListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible
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:
-
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 PIADefaultChoiceEnumFieldprotected PIADefaultChoiceEnumFieldprotected PIADefaultChoiceEnumFieldprotected PIADefaultChoiceEnumFieldprotected PIADefaultChoiceEnumFieldprotected PIADefaultChoiceEnumFieldprotected longprotected JCheckBoxprotected PIACurrencyFieldprotected PIACustomizablePanelprotected PIAPercentFieldprotected PIADateFieldprotected PIACurrencyFieldprotected PIACustomizablePanelprotected PIADateFieldprotected PIAIntegerFieldprotected PIAIntegerFieldprotected PIAIntegerFieldprotected PIAIntegerFieldprotected PIAIntegerFieldprotected PIAIntegerFieldprotected JCheckBoxprotected PIACurrencyFieldprotected PIACustomizablePanelprotected PIAPercentFieldprotected PIADateFieldprotected PIACurrencyFieldprotected PIACustomizablePanelprotected PIADateFieldprotected JRadioButtonprotected JRadioButtonprotected JRadioButtonprotected JRadioButtonprotected JRadioButtonprotected JRadioButtonprotected JRadioButtonprotected JRadioButtonprotected JRadioButtonprotected JCheckBoxprotected PIACustomizablePanelprotected PIAPercentFieldprotected PIADateFieldprotected PIADateFieldstatic final intstatic final intFields 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 TypeMethodDescriptionvoidactionPerformedprotected booleanThis method returns true if any of the validity period section has modifiedvoidcollects the modified data and updates the model handleprotected static Object[]decodeDate(int encodedModeUnitOffset) this method will decode the start_details/end_details to unit and offsetprotected voiddisableOrEnableAll(JPanel wPanel, boolean status) protected voiddoCycleDiscountInits(boolean hasAmount) protected voiddoCycleOverrideInits(boolean override) protected voiddoPurchaseDiscountInits(boolean hasAmount) protected voiddoPurchaseOverrideInits(boolean override) protected voidhandleCBoxAction(Object source) protected voidhandleRButtonAction(Object source) voidinitializeDateValues(PModelHandle pModelHandle) protected voidbooleanAsk for the confirmation before saving if default end dates are not changedbooleanisFirstUsage(String wFieldName) protected booleanisInWizardprotected voidvoidsetAmountFieldsVisible(boolean b) voidsetBackdateData(boolean flag, Date date) called by PCustomizeProductsPanel to let this panel know that backdate option is selected/deselected and the selected back dateprotected voidvoidsetCyclePanelEnabled(boolean b) voidsetDealCustomizedFlag(int dealCustomizeFlag) voidsetEnabled(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.voidsetIsCustomizableDuringDealPurchase(boolean wIsCustomizableDuringDealPurchase) voidsetIsCustomizedProductValidity(boolean b) voidsetMultiMonthPanelEnabled(boolean b) voidsetMultiMonthPanelVisible(boolean b) protected voidsetPurchasePanelEnabled(boolean b) voidsetRateFieldsVisible(boolean b) voidsetUsageEnabled(boolean b) protected voidupdateValidityDatesUI(boolean status) voidValidates dates.voidValidates Discount and Override AmountsvoidValidates status.voidCheck if the amount fields of 'Purchase','Cycle' sections of 'Product customizations' panel exceeds its respective min-max range.protected intwhichMode(String wFieldName, PModelHandle wModelHandle) Methods inherited from class com.portal.bas.comp.PIACustomizablePanel
clear, collectData, componentAdded, componentRemoved, containsError, getBackgroundImageSource, getBundle, getControllerClassName, getModelHandle, getRemoteComponent, getResourceName, getTools, isClean, isCurrencyDisplay, isDirty, isError, isInputTracking, isLight, isRequired, processError, resetToDefault, revertToPrimary, setBackgroundImageMode, setBackgroundImageSource, setClean, setCurrencyDisplay, setDefault, setError, setInputTracking, setModelHandle, 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, addNotify, 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, removeNotify, 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, setVisible, 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
-
mCurrentTime
protected long mCurrentTime -
mPurchaseDiscountPanel
-
mRdbPurchaseFU
-
mRdbPurchaseStartRelative
-
mRdbPurchaseEndRelative
-
mIntPurReltveStartCycle
-
mIntPurchaseRelativeEndOffset
-
mCmbPurchaseEndRelativeUnit
-
mCmbPurReltveStartUnit
-
mRdbCycleFU
-
mRdbCycleStartRelative
-
mRdbCycleEndRelative
-
mIntCylReltveStartCycle
-
mIntCycleRelativeEndOffset
-
mCmbCycleEndRelativeUnit
-
mCmbCylReltveStartUnit
-
mRdbUsageFU
-
mRdbUsageStartRelative
-
mRdbUsageEndRelative
-
mIntUsgReltveStartCycle
-
mIntUsageRelativeEndOffset
-
mCmbUsageEndRelativeUnit
-
mCmbUsgReltveStartUnit
-
mPurchaseDiscountAmount
-
mPurchaseDiscountPercent
-
mPurchaseOverridePanel
-
mPurchaseOverrideAmount
-
mPurchaseCBoxNeverCheckBox
-
mPurchaseEndDate
-
mPurchaseStartDate
-
mUsageEndDate
-
mUsageCBoxNeverCheckBox
-
mUsageStartDate
-
mUsageDiscountPercent
-
mUsageDiscountPanel
-
mCycleDiscountAmount
-
mCycleOverrideAmount
-
mCycleEndDate
-
mCycleOverridePanel
-
mCycleDiscountPercent
-
mCycleDiscountPanel
-
mCycleStartDate
-
mCycleCBoxNeverCheckBox
-
VALIDITY_FIRST_USAGE
public static final int VALIDITY_FIRST_USAGE- See Also:
-
VALIDITY_RELATIVE
public static final int VALIDITY_RELATIVE- See Also:
-
-
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
actionPerformed- Specified by:
actionPerformedin interfaceActionListener- Parameters:
e- ActionEvent
-
isInWizard
protected boolean isInWizard()isInWizard- Returns:
- boolean whether the panel is in wizard
-
setCurrentTimeToDateCtrl
-
validateOffsetUnit
Validates status.- Throws:
Exception- with error message if failed.
-
validateDiscountOverrideAmounts
public void validateDiscountOverrideAmounts()Validates Discount and Override Amounts -
validateDates
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
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 otherwisedate- selected backdate if backdate option is selected, current date otherwise
-
handleRButtonAction
-
handleCBoxAction
-
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
-
getCycleStartDateField
-
getUsageStartDateField
-
areDateFieldsDirty
protected boolean areDateFieldsDirty()This method returns true if any of the validity period section has modified- Returns:
- boolean
-
collectDateFieldsData
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
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
- Throws:
RemoteException
-
updateValidityDatesUI
protected void updateValidityDatesUI(boolean status) -
disableOrEnableAll
-
setIsCustomizedProductValidity
public void setIsCustomizedProductValidity(boolean b) -
setIsCustomizableDuringDealPurchase
public void setIsCustomizableDuringDealPurchase(boolean wIsCustomizableDuringDealPurchase) -
setDealCustomizedFlag
public void setDealCustomizedFlag(int dealCustomizeFlag) -
isFirstUsage
-
whichMode
-
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:
setEnabledin classJComponent- Parameters:
boolean- isEnabled pass true to enable the product attributes, If true passed then permissions also will be considered.
-
validateRangeInProductCustomizationsPanel
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.
-