Package com.portal.app.cc
Class PContactPanel
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.PContactPanel
- All Implemented Interfaces:
PAppComponent,PClientComponent,PCollectDataListener,PComponent,PComponentAttribute,PIASelectionListener,PViewDataChangeListener,ActionListener,ContainerListener,FocusListener,ItemListener,ImageObserver,MenuContainer,PropertyChangeListener,Serializable,EventListener,Accessible
public class PContactPanel
extends PIACustomizablePanel
implements ActionListener, PropertyChangeListener, PIASelectionListener, FocusListener, ItemListener
A generalized panel for displaying/modifying information for an Portal
contact. Since Portal supports multiple contacts it is likely that
a hosting panel would create and maintain multiple instances of this panel.
- 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
Fields 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
ConstructorsConstructorDescriptionCreates a contact panel for a new contact having no type and with an index of 1 for the associated NameInfo array entry.PContactPanel(int nameInfoIndex, boolean newContact) Creates a contact display panel using the passed-in type, index, and a flag to establish the type of the contact, the index of the associated NameInfo array entry, and whether the panel will host an existing or a new contact. -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) voidOverridden to apply style to some of the fontsvoidcollectData(PCollectDataEvent event) Collects contact data from the contained components.voidNo-op.voidUpdates the contact panel's label to reflect the contact type entered by the user.Retrieves the contact data for this account.protected intRetrieves the index into the Nameinfo array that this particular contact panel representsvoidbooleanReturns whether the contact is a new one or exists in an account.voidvoidbooleanvoidA convenience method that resets every field on this panel.voidHandles a selection event.voidEstablishes the contact data for this account.voidInforms this panel that its contact has been saved to the account.voidAdds the custom panel at the bottom of the contact panel.voidsetDeleteEnabled(boolean b) Shows or hides the delete button.voidsetInitialContactType(String ctype) voidEstablishes the salutation that should be initially selected in the menu.voidSets the contact panel type and/or label.voidsetValidContactType(String[] ctypes) voidsetValidSalutations(String[] salutations) Establishes the list of selectable values for each contact's salutation field.voidUpdates the contact panel's label to reflect the contact type entered by the user.Methods inherited from class com.portal.bas.comp.PIACustomizablePanel
clear, componentAdded, componentRemoved, containsError, getBackgroundImageSource, getBundle, getControllerClassName, getModelHandle, getRemoteComponent, getResourceName, getTools, isClean, isCurrencyDisplay, isDirty, isError, isInputTracking, isLight, isRequired, processError, revertToPrimary, 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, removeNotify, removeVetoableChangeListener, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, 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
-
Constructor Details
-
PContactPanel
public PContactPanel()Creates a contact panel for a new contact having no type and with an index of 1 for the associated NameInfo array entry. -
PContactPanel
public PContactPanel(int nameInfoIndex, boolean newContact) Creates a contact display panel using the passed-in type, index, and a flag to establish the type of the contact, the index of the associated NameInfo array entry, and whether the panel will host an existing or a new contact.- Parameters:
nameInfoIndex- The index to use for the NameInfo array entry.newContact- Iftrue, this panel will hold a new contact. Iffalse, this panel will hold a contact that exists in an account.
-
-
Method Details
-
setCustomData
Adds the custom panel at the bottom of the contact panel.
Note that profile panels can be added here and saved automatically with no intervention from the user since the same MODIFY_CUSTOMER opcode works with contact fields and profile objects.
Be aware that this panel will appear for each contact added - it is the caller's job to ensure that data is saved in the appropriate array index.- Parameters:
The- new panel to display.
-
isNewContact
public boolean isNewContact()Returns whether the contact is a new one or exists in an account.- Returns:
trueif the contact hasn't yet been saved to the account. Returnsfalseif it exists in the account.
-
setContactSaved
public void setContactSaved()Informs this panel that its contact has been saved to the account. -
identifyPanel
public void identifyPanel() -
addNotify
public void addNotify()Overridden to apply style to some of the fonts- Overrides:
addNotifyin classJComponent
-
setModelHandle
Sets the contact panel type and/or label.- Specified by:
setModelHandlein interfacePComponent- Overrides:
setModelHandlein classPIACustomizablePanel- Parameters:
pm- Model handle for the account- Throws:
RemoteException- thrown for errors
-
setDeleteEnabled
public void setDeleteEnabled(boolean b) Shows or hides the delete button.- Parameters:
b- true to enable the delete button; false otherwise
-
getNameInfoIndex
protected int getNameInfoIndex()Retrieves the index into the Nameinfo array that this particular contact panel represents- Returns:
- The Nameinfo index this panel represents
-
collectData
Collects contact data from the contained components. Three cases are handled:- This panel is visible (not deleted). In this case data from this panel's contained widgets is appended to the model in the passed-in collect data event.
- This panel is hidden (deleted) and its contact is a "new" one. (That is, its contact isn't already present in the account.) In this case no data is appended to the the model in the passed-in collect data event.
- This panel is hidden (deleted) and the panel contains an already-existing contact for this account. In this case, a "deleted" entry for the contact is appended to the the model in the passed-in collect data event.
- Specified by:
collectDatain interfacePCollectDataListener- Overrides:
collectDatain classPIACustomizablePanel- Parameters:
event- The collect data event
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
selectionChanged
Description copied from interface:PIASelectionListenerHandles a selection event.- Specified by:
selectionChangedin interfacePIASelectionListener- Parameters:
event- the event to handle
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-
resetToDefault
public void resetToDefault()Description copied from class:PIACustomizablePanelA convenience method that resets every field on this panel.- Specified by:
resetToDefaultin interfacePComponentAttribute- Overrides:
resetToDefaultin classPIACustomizablePanel
-
setContactData
Establishes the contact data for this account.- Parameters:
data- The NameAddressData for this account
-
getContactData
Retrieves the contact data for this account.- Returns:
- Contact data
-
requestDefaultFocus
public boolean requestDefaultFocus()- Overrides:
requestDefaultFocusin classJComponent
-
focusGained
No-op.- Specified by:
focusGainedin interfaceFocusListener- Parameters:
e- the focus event
-
focusLost
Updates the contact panel's label to reflect the contact type entered by the user.- Specified by:
focusLostin interfaceFocusListener- Parameters:
e- the focus event
-
updateContactLabel
public void updateContactLabel()Updates the contact panel's label to reflect the contact type entered by the user. -
itemStateChanged
- Specified by:
itemStateChangedin interfaceItemListener
-
getContactTypeWidget
-
setValidContactType
-
setValidSalutations
Establishes the list of selectable values for each contact's salutation field. The list will appear as a dropdown menu in the contact panel instead of an editable textfield.- Parameters:
salutations- The list of selectable salutations
-
setInitialSalutation
Establishes the salutation that should be initially selected in the menu. Only valid if a list of countries has been specified.- Parameters:
sal- The salutation that is selected by default.
-
setInitialContactType
-