Package com.portal.bas.comp
Class PIAStringEnum
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JComboBox
com.portal.bas.comp.PIAStringEnum
- All Implemented Interfaces:
PAppComponent,PAppFieldComponent,PClientComponent,PCollectDataListener,PComponent,PComponentAttribute,PFieldBean,PLightComponent,PViewDataChangeListener,ActionListener,ImageObserver,ItemSelectable,MenuContainer,Serializable,Remote,EventListener,Accessible,ListDataListener
- Direct Known Subclasses:
PDefaultChoiceStringEnum,PDeviceComboBox,PMSExchangeOrgNameField
public class PIAStringEnum
extends JComboBox
implements PAppFieldComponent, PLightComponent, PComponentAttribute, PCollectDataListener, Serializable
Creates an Portal aware combobox containing String values
- Version:
- %version: 15 % %date_modified: Mon Oct 22 09:27:24 2001 %
- Author:
- larrylf
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComboBox
JComboBox.AccessibleJComboBox, JComboBox.KeySelectionManagerNested 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 javax.swing.JComboBox
actionCommand, dataModel, editor, isEditable, keySelectionManager, lightWeightPopupEnabled, maximumRowCount, renderer, selectedItemReminderFields 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 TypeMethodDescriptionvoidclear()Clears any existing data from the componentvoidcollectData(PCollectDataEvent event) CollectDataListener override.Gets the associated class, if any, for this field.Retrieves the class name of this component's controllerReturns a string guaranteed to be unique among the lightweight components that can be used to describe the data, and acts as a key for it.Get the data field description used by the componentGets the display field format used by this componentgetField()Gets the value of the field referred to in thedisplayFieldDescription.Get the current help id for this componentGets the lightweight data object itself.Get the data field description used by the componentRetrieves the PModelHandle for this componentGet a reference to the remote component for this object.Returns the base resource name used in resource lookupgetTools()Get a list of Actions supported by this component.booleanAlways returns false - this widget contains String databooleanisDirty()Determines if this component is currently in a DIRTY state.booleanisError()Used to determine if this component is currently in error statebooleanDetermines if input tracking is enabled.booleanisLight()Determines if this is component defers PModelHandle knowledge to its parent container.booleanDetermines if this component is required in its current context.voidResets the component value to the original value (that which was established by callingsetDefault()).voidrevertToPrimary(int primary) Causes the widget to display its data in the primary currencyvoidsetAssociatedClass(String name) Sets the associated class, if any, for this field.voidsetChoices(String[] choices) Establishes the data to display in this componentvoidsetChoices(Vector choices) Establishes the data to display in this componentvoidsetClean()Used to reset the component to the 'clean' state.voidsetCurrencyDisplay(boolean b) Used to determine if this component is displaying currency data.voidEstablishes the currently selected item as the default, and the current number of items in the model as the default item count.voidsetDisplayFieldDescription(String fieldDisp) Set the description of the field(s) in the data model that this component will displayvoidsetDisplayFieldFormat(String fieldForm) Sets the java.text.MessageFormat-type format used to display data in this component.voidsetError(boolean b) Marks this component as containing erroneous data in the current context or unmarks the error state, depending on the parametervoidSets the value of the field referred to in themodelFieldDescription.voidSet the help id for this component.voidsetInputTracking(boolean b) If input tracking is turned on, any changes made by the user to the component will be tracked and the component will be marked "dirty".voidsetLightData(Object field) Sets the lightweight data object.voidsetModelFieldDescription(String fieldDesc) Set the description of the field in the data model that this component is interested in.voidsetModelHandle(PModelHandle data) Establishes the PModelHandle for this componentvoidsetRequired(boolean b) Marks this component as required in its current context.voidsetResourceName(String name) Set the base resource name used in resource lookup.togglePrimaryToSecondary(int primary, int secondary) Does nothing - no-opvoidUsed to disassociate this component from its delegate (controller)voidViewDataChangeListener override.Methods inherited from class javax.swing.JComboBox
actionPerformed, actionPropertyChanged, addActionListener, addItem, addItemListener, addPopupMenuListener, configureEditor, configurePropertiesFromAction, contentsChanged, createActionPropertyChangeListener, createDefaultKeySelectionManager, fireActionEvent, fireItemStateChanged, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getAction, getActionCommand, getActionListeners, getEditor, getItemAt, getItemCount, getItemListeners, getKeySelectionManager, getMaximumRowCount, getModel, getPopupMenuListeners, getPrototypeDisplayValue, getRenderer, getSelectedIndex, getSelectedItem, getSelectedObjects, getUI, getUIClassID, hidePopup, insertItemAt, installAncestorListener, intervalAdded, intervalRemoved, isEditable, isLightWeightPopupEnabled, isPopupVisible, paramString, processKeyBinding, processKeyEvent, removeActionListener, removeAllItems, removeItem, removeItemAt, removeItemListener, removePopupMenuListener, selectedItemChanged, selectWithKeyChar, setAction, setActionCommand, setEditable, setEditor, setEnabled, setKeySelectionManager, setLightWeightPopupEnabled, setMaximumRowCount, setModel, setPopupVisible, setPrototypeDisplayValue, setRenderer, setSelectedIndex, setSelectedItem, setUI, showPopup, 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, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, 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, imageUpdate, 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
-
PIAStringEnum
public PIAStringEnum()
-
-
Method Details
-
unregister
Used to disassociate this component from its delegate (controller)- Specified by:
unregisterin interfacePClientComponent- Throws:
RemoteException
-
setModelHandle
Establishes the PModelHandle for this component- Specified by:
setModelHandlein interfacePComponent- Parameters:
data- The new PModelHandle from which information will be extracted.- Throws:
RemoteException
-
getModelHandle
Retrieves the PModelHandle for this component- Specified by:
getModelHandlein interfacePComponent- Returns:
- The PModelHandle associated with this component
- Throws:
RemoteException
-
isLight
Determines if this is component defers PModelHandle knowledge to its parent container. If so, the parent container will pass the PModelHandle to this component on the server side (via the controller) saving a client/server roundtrip for data exchange. If you need to do specific processing of some kind when PModelHandle is called you'll need to subclass this component and override this method. OtherwisesetModelHandle()will not be called.- Specified by:
isLightin interfacePComponent- Returns:
- true
- Throws:
RemoteException
-
getControllerClassName
Retrieves the class name of this component's controller- Specified by:
getControllerClassNamein interfacePComponent- Returns:
- "com.portal.bas.comp.PIAFieldController", the default controller for most PFieldComponents
- Throws:
RemoteException
-
getTools
Get a list of Actions supported by this component. When subclassed, the overriding class should call its super class version, then add its actions to the retuned list. This preserves actions supplied by base classes. The default, supplied here, include Help for this component.- Specified by:
getToolsin interfacePClientComponent- Returns:
- a Vector containing Action objects
-
setResourceName
Set the base resource name used in resource lookup. Basically, the resource name will be this base, followed by a dot, flowwed by the local name (label).- Specified by:
setResourceNamein interfacePClientComponent- Parameters:
name- The new base resource name.
-
getResourceName
Returns the base resource name used in resource lookup- Specified by:
getResourceNamein interfacePClientComponent- Returns:
- the resource name
-
getRemoteComponent
Get a reference to the remote component for this object. The remote component is used when interfacing with this component's controller.- Specified by:
getRemoteComponentin interfacePAppComponent- Returns:
- a RemoteComponent
-
setModelFieldDescription
Set the description of the field in the data model that this component is interested in.- Specified by:
setModelFieldDescriptionin interfacePFieldBean- Parameters:
fieldDesc- A String describing the field used by this component.- Throws:
RemoteException
-
getModelFieldDescription
Get the data field description used by the component- Specified by:
getModelFieldDescriptionin interfacePFieldBean- Returns:
- a string description of the field used by this component
- Throws:
RemoteException
-
setDisplayFieldDescription
Set the description of the field(s) in the data model that this component will display- Specified by:
setDisplayFieldDescriptionin interfacePFieldBean- Parameters:
fieldDisp- aStringthat describes the fieldfieldDesc- A String describing the field displayed by this component.- Throws:
RemoteException
-
getDisplayFieldDescription
Get the data field description used by the component- Specified by:
getDisplayFieldDescriptionin interfacePFieldBean- Returns:
- a string description of the field used by this component
- Throws:
RemoteException
-
setDisplayFieldFormat
Sets the java.text.MessageFormat-type format used to display data in this component. This is typically (but not necessarily) directly tied to the DisplayFieldDescription. For this specific widget, a format will probably be something like
"{0,choice,0#First Label|1#2nd Label|2#Third Label}"- Specified by:
setDisplayFieldFormatin interfacePAppFieldComponent- Parameters:
fieldForm- the format used when displaying the data- Throws:
RemoteException
-
getDisplayFieldFormat
Gets the display field format used by this component- Specified by:
getDisplayFieldFormatin interfacePAppFieldComponent- Returns:
- a String representation of the display field format
- Throws:
RemoteException
-
setAssociatedClass
Description copied from interface:PFieldBeanSets the associated class, if any, for this field.- Specified by:
setAssociatedClassin interfacePFieldBean- Parameters:
name- the class name- Throws:
RemoteException- thrown for errors
-
getAssociatedClass
Description copied from interface:PFieldBeanGets the associated class, if any, for this field.- Specified by:
getAssociatedClassin interfacePFieldBean- Returns:
- The class name or null.
- Throws:
RemoteException- thrown for errors
-
setField
Description copied from interface:PFieldBeanSets the value of the field referred to in themodelFieldDescription.- Specified by:
setFieldin interfacePFieldBean- Parameters:
field- the field's value- Throws:
RemoteException- thrown for errors
-
getField
Description copied from interface:PFieldBeanGets the value of the field referred to in thedisplayFieldDescription.- Specified by:
getFieldin interfacePFieldBean- Returns:
- the field's value
- Throws:
RemoteException- thrown for errors
-
getDataDescriptor
Description copied from interface:PLightComponentReturns a string guaranteed to be unique among the lightweight components that can be used to describe the data, and acts as a key for it. For field components, this can be the model description.- Specified by:
getDataDescriptorin interfacePLightComponent- Returns:
- A
Stringdata description.
-
setLightData
Description copied from interface:PLightComponentSets the lightweight data object. This is usually called by framework support as part of the lightweight component implementation.- Specified by:
setLightDatain interfacePLightComponent- Parameters:
field- the lightweight component's display data
-
getLightData
Description copied from interface:PLightComponentGets the lightweight data object itself. Lightweight components are allowed only one data item. This is likely to be a duplicate of another method of the component, and can be delegated to it.- Specified by:
getLightDatain interfacePLightComponent- Returns:
- An
Objectthat represents a component's display data.
-
setHelpID
Set the help id for this component.- Specified by:
setHelpIDin interfacePAppFieldComponent- Parameters:
id- The new help id.
-
getHelpID
Get the current help id for this component- Specified by:
getHelpIDin interfacePAppFieldComponent- Returns:
- A String help id
-
resetToDefault
public void resetToDefault()Resets the component value to the original value (that which was established by callingsetDefault()). If no default value exists, the component data will be cleared.- Specified by:
resetToDefaultin interfacePComponentAttribute
-
clear
public void clear()Clears any existing data from the component- Specified by:
clearin interfacePComponentAttribute
-
isRequired
public boolean isRequired()Determines if this component is required in its current context. This is currently a visual indicator only - there is no policy to enforce that required fields get filled in.- Specified by:
isRequiredin interfacePComponentAttribute- Returns:
- true if this field is required
-
setRequired
public void setRequired(boolean b) Marks this component as required in its current context. This is currently a visual indicator only - there is no policy to enforce that required fields get filled in.- Specified by:
setRequiredin interfacePComponentAttribute- Parameters:
b- if true, puts the component in "required" state
-
isError
public boolean isError()Used to determine if this component is currently in error state- Specified by:
isErrorin interfacePComponentAttribute- Returns:
- the error state of this component
-
setError
public void setError(boolean b) Marks this component as containing erroneous data in the current context or unmarks the error state, depending on the parameter- Specified by:
setErrorin interfacePComponentAttribute- Parameters:
b- if true, puts the component in "error" state.
-
setInputTracking
public void setInputTracking(boolean b) If input tracking is turned on, any changes made by the user to the component will be tracked and the component will be marked "dirty". If the user modifies the data and returns it to its default/original state, the component will be marked "clean", or not "dirty".- Specified by:
setInputTrackingin interfacePComponentAttribute- Parameters:
b- the state of theinputTrackingproperty
-
isInputTracking
public boolean isInputTracking()Description copied from interface:PComponentAttributeDetermines if input tracking is enabled.- Specified by:
isInputTrackingin interfacePComponentAttribute- Returns:
- the state of the input tracking flag
-
setClean
public void setClean()Used to reset the component to the 'clean' state. If the component was in dirty or error state, this method will remove those attributes. A required component will still be marked required after a call to this method.- Specified by:
setCleanin interfacePComponentAttribute
-
isDirty
public boolean isDirty()Description copied from interface:PComponentAttributeDetermines if this component is currently in a DIRTY state.- Specified by:
isDirtyin interfacePComponentAttribute- Returns:
- true if the user has modified the data represented by this component, false otherwise. It also returns false if input tracking is off.
-
setDefault
public void setDefault()Establishes the currently selected item as the default, and the current number of items in the model as the default item count.- Specified by:
setDefaultin interfacePComponentAttribute
-
isCurrencyDisplay
public boolean isCurrencyDisplay()Always returns false - this widget contains String data- Specified by:
isCurrencyDisplayin interfacePComponentAttribute- Returns:
- true if the widget is displaying currency data; false otherwise
-
setCurrencyDisplay
public void setCurrencyDisplay(boolean b) Used to determine if this component is displaying currency data. Widgets displaying currency data are capable of automatically toggling their data between 2 Portal currency types (primary invalid input: '&' secondary).- Specified by:
setCurrencyDisplayin interfacePComponentAttribute- Parameters:
b- If true, indicates the widget is displaying currency data.
-
togglePrimaryToSecondary
Does nothing - no-op- Specified by:
togglePrimaryToSecondaryin interfacePComponentAttribute- Specified by:
togglePrimaryToSecondaryin interfacePFieldBean- Parameters:
primary- the primary currency IDsecondary- the secondary currency IDfrom- Assumed to be the current currency ID being used to display the datato- The new currency ID to use when displaying the data- Returns:
- The converted value.
- Throws:
RemoteException
-
revertToPrimary
Causes the widget to display its data in the primary currency- Specified by:
revertToPrimaryin interfacePComponentAttribute- Specified by:
revertToPrimaryin interfacePFieldBean- Parameters:
primary- The primary currency ID for an account- Throws:
RemoteException
-
setChoices
Establishes the data to display in this component- Parameters:
choices- The array of String objects to display in the component
-
setChoices
Establishes the data to display in this component- Parameters:
choices- The Vector of String objects to display in the component
-
viewDataChange
ViewDataChangeListener override. Called by the controller to update the field data.- Specified by:
viewDataChangein interfacePViewDataChangeListener- Parameters:
event- The ViewDataChange event describing the change- Throws:
RemoteException- thrown for errors
-
collectData
CollectDataListener override. Causes control to save chanes back to data model. Done prior to commiting changes to Portal- Specified by:
collectDatain interfacePCollectDataListener- Parameters:
event- The collect data event
-