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.KeySelectionManager
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
Fields inherited from class javax.swing.JComboBox
actionCommand, dataModel, editor, isEditable, keySelectionManager, lightWeightPopupEnabled, maximumRowCount, renderer, selectedItemReminder
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
clear()
Clears any existing data from the componentvoid
collectData
(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.boolean
Always returns false - this widget contains String databoolean
isDirty()
Determines if this component is currently in a DIRTY state.boolean
isError()
Used to determine if this component is currently in error stateboolean
Determines if input tracking is enabled.boolean
isLight()
Determines if this is component defers PModelHandle knowledge to its parent container.boolean
Determines if this component is required in its current context.void
Resets the component value to the original value (that which was established by callingsetDefault()
).void
revertToPrimary
(int primary) Causes the widget to display its data in the primary currencyvoid
setAssociatedClass
(String name) Sets the associated class, if any, for this field.void
setChoices
(String[] choices) Establishes the data to display in this componentvoid
setChoices
(Vector choices) Establishes the data to display in this componentvoid
setClean()
Used to reset the component to the 'clean' state.void
setCurrencyDisplay
(boolean b) Used to determine if this component is displaying currency data.void
Establishes the currently selected item as the default, and the current number of items in the model as the default item count.void
setDisplayFieldDescription
(String fieldDisp) Set the description of the field(s) in the data model that this component will displayvoid
setDisplayFieldFormat
(String fieldForm) Sets the java.text.MessageFormat-type format used to display data in this component.void
setError
(boolean b) Marks this component as containing erroneous data in the current context or unmarks the error state, depending on the parametervoid
Sets the value of the field referred to in themodelFieldDescription
.void
Set the help id for this component.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".void
setLightData
(Object field) Sets the lightweight data object.void
setModelFieldDescription
(String fieldDesc) Set the description of the field in the data model that this component is interested in.void
setModelHandle
(PModelHandle data) Establishes the PModelHandle for this componentvoid
setRequired
(boolean b) Marks this component as required in its current context.void
setResourceName
(String name) Set the base resource name used in resource lookup.togglePrimaryToSecondary
(int primary, int secondary) Does nothing - no-opvoid
Used to disassociate this component from its delegate (controller)void
ViewDataChangeListener 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, updateUI
Methods 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, 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, 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:
unregister
in interfacePClientComponent
- Throws:
RemoteException
-
setModelHandle
Establishes the PModelHandle for this component- Specified by:
setModelHandle
in interfacePComponent
- Parameters:
data
- The new PModelHandle from which information will be extracted.- Throws:
RemoteException
-
getModelHandle
Retrieves the PModelHandle for this component- Specified by:
getModelHandle
in 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:
isLight
in interfacePComponent
- Returns:
- true
- Throws:
RemoteException
-
getControllerClassName
Retrieves the class name of this component's controller- Specified by:
getControllerClassName
in 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:
getTools
in 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:
setResourceName
in interfacePClientComponent
- Parameters:
name
- The new base resource name.
-
getResourceName
Returns the base resource name used in resource lookup- Specified by:
getResourceName
in 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:
getRemoteComponent
in interfacePAppComponent
- Returns:
- a RemoteComponent
-
setModelFieldDescription
Set the description of the field in the data model that this component is interested in.- Specified by:
setModelFieldDescription
in 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:
getModelFieldDescription
in 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:
setDisplayFieldDescription
in interfacePFieldBean
- Parameters:
fieldDisp
- aString
that 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:
getDisplayFieldDescription
in 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:
setDisplayFieldFormat
in interfacePAppFieldComponent
- Parameters:
fieldForm
- the format used when displaying the data- Throws:
RemoteException
-
getDisplayFieldFormat
Gets the display field format used by this component- Specified by:
getDisplayFieldFormat
in interfacePAppFieldComponent
- Returns:
- a String representation of the display field format
- Throws:
RemoteException
-
setAssociatedClass
Description copied from interface:PFieldBean
Sets the associated class, if any, for this field.- Specified by:
setAssociatedClass
in interfacePFieldBean
- Parameters:
name
- the class name- Throws:
RemoteException
- thrown for errors
-
getAssociatedClass
Description copied from interface:PFieldBean
Gets the associated class, if any, for this field.- Specified by:
getAssociatedClass
in interfacePFieldBean
- Returns:
- The class name or null.
- Throws:
RemoteException
- thrown for errors
-
setField
Description copied from interface:PFieldBean
Sets the value of the field referred to in themodelFieldDescription
.- Specified by:
setField
in interfacePFieldBean
- Parameters:
field
- the field's value- Throws:
RemoteException
- thrown for errors
-
getField
Description copied from interface:PFieldBean
Gets the value of the field referred to in thedisplayFieldDescription
.- Specified by:
getField
in interfacePFieldBean
- Returns:
- the field's value
- Throws:
RemoteException
- thrown for errors
-
getDataDescriptor
Description copied from interface:PLightComponent
Returns 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:
getDataDescriptor
in interfacePLightComponent
- Returns:
- A
String
data description.
-
setLightData
Description copied from interface:PLightComponent
Sets the lightweight data object. This is usually called by framework support as part of the lightweight component implementation.- Specified by:
setLightData
in interfacePLightComponent
- Parameters:
field
- the lightweight component's display data
-
getLightData
Description copied from interface:PLightComponent
Gets 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:
getLightData
in interfacePLightComponent
- Returns:
- An
Object
that represents a component's display data.
-
setHelpID
Set the help id for this component.- Specified by:
setHelpID
in interfacePAppFieldComponent
- Parameters:
id
- The new help id.
-
getHelpID
Get the current help id for this component- Specified by:
getHelpID
in 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:
resetToDefault
in interfacePComponentAttribute
-
clear
public void clear()Clears any existing data from the component- Specified by:
clear
in 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:
isRequired
in 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:
setRequired
in 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:
isError
in 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:
setError
in 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:
setInputTracking
in interfacePComponentAttribute
- Parameters:
b
- the state of theinputTracking
property
-
isInputTracking
public boolean isInputTracking()Description copied from interface:PComponentAttribute
Determines if input tracking is enabled.- Specified by:
isInputTracking
in 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:
setClean
in interfacePComponentAttribute
-
isDirty
public boolean isDirty()Description copied from interface:PComponentAttribute
Determines if this component is currently in a DIRTY state.- Specified by:
isDirty
in 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:
setDefault
in interfacePComponentAttribute
-
isCurrencyDisplay
public boolean isCurrencyDisplay()Always returns false - this widget contains String data- Specified by:
isCurrencyDisplay
in 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:
setCurrencyDisplay
in interfacePComponentAttribute
- Parameters:
b
- If true, indicates the widget is displaying currency data.
-
togglePrimaryToSecondary
Does nothing - no-op- Specified by:
togglePrimaryToSecondary
in interfacePComponentAttribute
- Specified by:
togglePrimaryToSecondary
in 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:
revertToPrimary
in interfacePComponentAttribute
- Specified by:
revertToPrimary
in 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:
viewDataChange
in 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:
collectData
in interfacePCollectDataListener
- Parameters:
event
- The collect data event
-