Package com.portal.bas.comp
Class PIAFieldComponent
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
com.portal.bas.comp.PIAFieldComponent
- All Implemented Interfaces:
PAppComponent,PAppFieldComponent,PClientComponent,PComponent,PFieldBean,PViewDataChangeListener,ImageObserver,MenuContainer,Serializable,Remote,EventListener
PIAFieldComponent is a Swing-compatible, Portal-aware
field component boilerplate code.- Version:
- 3
- Author:
- Larry Lynch-Freshner
- See Also:
-
Nested Class Summary
Nested 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.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
ConstructorsConstructorDescriptionConstructs aPIAFieldComponentand registers it with the BAS server. -
Method Summary
Modifier and TypeMethodDescriptionGets the associated class, if any, for this field.Retrieves the class name of this component's controller.Gets the data field description used by the component.Gets the data field description used by this component.Gets the display field format used by this component.getField()Gets the value of the field referred to in thedisplayFieldDescription.Gets the current help ID for this component.Gets the lightweight data object; in this implementation, an empty value.Gets the data field description used by this component.Retrieves thePModelHandlefor this component.Gets a reference to the remote component (controller) for this object.Returns the base resource name used to look up a resource.getTools()Gets a list of actions supported by this component.booleanisLight()Determines whether this is a lightweight component.voidrevertToPrimary(int primary) Implement PFieldBean.revertToPrimary.voidsetAssociatedClass(String name) Sets the associated class, if any, for this field.voidsetDisplayFieldDescription(String fieldDisp) Sets the description of the field(s) in the data model for this component to display.voidsetDisplayFieldFormat(String fieldForm) Sets thejava.text.MessageFormatused to display data in this component.voidSets the value of the field referred to in themodelFieldDescription.voidSets the help ID for this component.voidsetLightData(Object field) Sets the lightweight data object; in this implementation, an empty value.voidsetModelFieldDescription(String fieldDesc) Sets the description of the field in the data model that this component is interested in.voidsetModelHandle(PModelHandle data) Establishes thePModelHandlefor this component.voidsetResourceName(String name) Sets the base resource name used to look up resources.togglePrimaryToSecondary(int primary, int secondary) Implement PFieldBean.togglePrimaryToSecondary.voidImplement PClientComponent.unregister().voidOverridesPViewDataChangeListener.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, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, 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, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIMethods 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, getAccessibleContext, 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
-
PIAFieldComponent
public PIAFieldComponent()Constructs aPIAFieldComponentand registers it with the BAS server.
-
-
Method Details
-
setModelHandle
Establishes thePModelHandlefor this component.- Specified by:
setModelHandlein interfacePComponent- Parameters:
data- the newPModelHandlefrom which to extract information- Throws:
RemoteException- thrown for errors
-
getModelHandle
Retrieves thePModelHandlefor this component.- Specified by:
getModelHandlein interfacePComponent- Returns:
- The
PModelHandleassociated with this component, or null if this is a lightweight component. - Throws:
RemoteException- thrown for errors
-
isLight
Determines whether this is a lightweight component. Lightweight components do not have their own model. Instead, they use the model of their container. This means thatgetModelHandlealways returns null,setModelHandleis ignored, and no property change events are generated.- Specified by:
isLightin interfacePComponent- Returns:
- True if the component is lightweight; false otherwise.
- Throws:
RemoteException- thrown for errors
-
getControllerClassName
Retrieves the class name of this component's controller.- Specified by:
getControllerClassNamein interfacePComponent- Returns:
- A
Stringwith the controller's class name. - Throws:
RemoteException- thrown for errors
-
getTools
Gets 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 returned list. This preserves actions supplied by base classes. The default, supplied here, includes help for this component.- Specified by:
getToolsin interfacePClientComponent- Returns:
- A
Vectorthat containsActionobjects.
-
setResourceName
Sets the base resource name used to look up resources. The resource name consists of this base, followed by a dot, followed by the local name (label).- Specified by:
setResourceNamein interfacePClientComponent- Parameters:
name- the new base resource name
-
getResourceName
Returns the base resource name used to look up a resource.- Specified by:
getResourceNamein interfacePClientComponent- Returns:
- A
Stringwith the resource name.
-
getRemoteComponent
Gets a reference to the remote component (controller) for this object.- Specified by:
getRemoteComponentin interfacePAppComponent- Returns:
- A
Remoteobject, which is the remote controller for this View class.
-
setModelFieldDescription
Sets the description of the field in the data model that this component is interested in.- Specified by:
setModelFieldDescriptionin interfacePFieldBean- Parameters:
fieldDesc- aStringthat describes the field used by this component- Throws:
RemoteException- thrown for errors
-
getModelFieldDescription
Gets the data field description used by this component.- Specified by:
getModelFieldDescriptionin interfacePFieldBean- Returns:
- A
Stringdescription of the field used by this component. - Throws:
RemoteException- thrown for errors
-
setDisplayFieldDescription
Sets the description of the field(s) in the data model for this component to display.- Specified by:
setDisplayFieldDescriptionin interfacePFieldBean- Parameters:
fieldDisp- aStringthat describes the field displayed by this component- Throws:
RemoteException- thrown for errors
-
getDisplayFieldDescription
Gets the data field description used by this component.- Specified by:
getDisplayFieldDescriptionin interfacePFieldBean- Returns:
- A
Stringdescription of the field used by this component. - Throws:
RemoteException- thrown for errors
-
setDisplayFieldFormat
Sets thejava.text.MessageFormatused to display data in this component. This is typically (but not necessarily) directly tied to thedisplayFieldDescription. For this specific widget, the format might be similar to the following:"{0,choice,0#First Label|1#2nd Label|2#Third Label}"
- Specified by:
setDisplayFieldFormatin interfacePAppFieldComponent- Parameters:
fieldForm- the format used to display the data- Throws:
RemoteException- thrown for errors
-
getDisplayFieldFormat
Gets the display field format used by this component.- Specified by:
getDisplayFieldFormatin interfacePAppFieldComponent- Returns:
- A
Stringrepresentation of the display field format. - Throws:
RemoteException- thrown for errors
-
setAssociatedClass
Sets the associated class, if any, for this field.- Specified by:
setAssociatedClassin interfacePFieldBean- Parameters:
name- aStringwith the class name- Throws:
RemoteException- thrown for errors
-
getAssociatedClass
Gets the associated class, if any, for this field.- Specified by:
getAssociatedClassin interfacePFieldBean- Returns:
- A
Stringwith the associated class name. - Throws:
RemoteException- thrown for errors
-
setField
Sets the value of the field referred to in themodelFieldDescription.- Specified by:
setFieldin interfacePFieldBean- Parameters:
field- the field's valuevalue- the field's value- Throws:
RemoteException- thrown for errors
-
getField
Gets the value of the field referred to in thedisplayFieldDescription.- Specified by:
getFieldin interfacePFieldBean- Returns:
- The field's value.
- Throws:
RemoteException- thrown for errors
-
setHelpID
Sets the help ID for this component.- Specified by:
setHelpIDin interfacePAppFieldComponent- Parameters:
id- the new help ID to set
-
getHelpID
Gets the current help ID for this component.- Specified by:
getHelpIDin interfacePAppFieldComponent- Returns:
- A
Stringwith the current help ID.
-
viewDataChange
OverridesPViewDataChangeListener. This method is no longer called by the controller itself. To ensure backward compatibility, it is called after the model is set, by any operation that causes a change in the display data. Client code should call the appropriategetmethods on the controller to get the data, because the() PViewDataChangeEventparameter is no longer used.- Specified by:
viewDataChangein interfacePViewDataChangeListener- Parameters:
event- thePViewDataChangeEventevent that describes the change. No longer used. By default, the value passed in is always set to null.- Throws:
RemoteException- thrown for errors
-
getDataDescriptor
Gets the data field description used by the component.- Returns:
- A
Stringdescription of the fields used by this component or null if there is none. - Throws:
RemoteException- thrown for errors
-
setLightData
Sets the lightweight data object; in this implementation, an empty value.- Parameters:
field- the lightweight component's display data
-
getLightData
Gets the lightweight data object; in this implementation, an empty value.- Returns:
- An empty display value.
-
togglePrimaryToSecondary
Implement PFieldBean.togglePrimaryToSecondary. This implementation simply returns null.- Specified by:
togglePrimaryToSecondaryin interfacePFieldBean- Parameters:
primary- the primary currency IDsecondary- the secondary currency ID- Returns:
- The converted value.
- Throws:
RemoteException
-
revertToPrimary
Implement PFieldBean.revertToPrimary. This implementation does nothing.- Specified by:
revertToPrimaryin interfacePFieldBean- Parameters:
primary- the primary currency ID- Throws:
RemoteException
-
unregister
Implement PClientComponent.unregister(). This implementation does nothing.- Specified by:
unregisterin interfacePClientComponent- Throws:
RemoteException
-