Package com.portal.bas.comp
Class PIATextAreaField
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.text.JTextComponent
javax.swing.JTextArea
com.portal.bas.comp.PIATextAreaField
- All Implemented Interfaces:
PAppComponent,PAppFieldComponent,PClientComponent,PCollectDataListener,PComponent,PComponentAttribute,PFieldBean,PLightComponent,PViewDataChangeListener,ImageObserver,MenuContainer,Serializable,Remote,EventListener,Accessible,Scrollable
- Direct Known Subclasses:
PChangeStatusPage.PIAChangeStatusTextAreaField
public class PIATextAreaField
extends JTextArea
implements PAppFieldComponent, PLightComponent, PComponentAttribute, PCollectDataListener, Serializable
Swing compatible, Portal aware textarea class
- Version:
- $Version$
- Author:
- Larry Lynch-Freshner
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JTextArea
JTextArea.AccessibleJTextAreaNested classes/interfaces inherited from class javax.swing.text.JTextComponent
JTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, JTextComponent.KeyBindingNested 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
FieldsFields inherited from class javax.swing.text.JTextComponent
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEYFields 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.Get the base resource name used in resource lookup.getTools()Get a list of Actions supported by this component.booleanDetermines if the component is displaying currency data.booleanisDirty()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.booleanOverridden to allow tab traversal when TAB key is entered.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.voidsetClean()Used to reset the component to the 'clean' state.voidsetCurrencyDisplay(boolean b) Used to determine if this component is displaying currency data.voidEstablishes the current value (or element count, depending on the given component) as the default value.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.voidsetMaximumLength(int max) set the limit to accept maximum number of characters in the text area fieldvoidsetModelFieldDescription(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) Causes the widget to convert its data using the BEIDManager.voidUsed to disassociate this component from its delegate (controller)voidViewDataChangeListener override.Methods inherited from class javax.swing.JTextArea
append, createDefaultModel, getAccessibleContext, getColumns, getColumnWidth, getLineCount, getLineEndOffset, getLineOfOffset, getLineStartOffset, getLineWrap, getPreferredScrollableViewportSize, getPreferredSize, getRowHeight, getRows, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getTabSize, getUIClassID, getWrapStyleWord, insert, paramString, replaceRange, setColumns, setFont, setLineWrap, setRows, setTabSize, setWrapStyleWordMethods inherited from class javax.swing.text.JTextComponent
addCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, getActions, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getDropLocation, getDropMode, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPrintable, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, modelToView2D, moveCaretPosition, paste, print, print, print, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, restoreComposedText, saveComposedText, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDocument, setDragEnabled, setDropMode, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setText, setUI, updateUI, viewToModel, viewToModel2D, writeMethods 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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, 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, 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, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
mPrimaryData
-
mPrimaryCur
protected int mPrimaryCur -
mSecondaryCur
protected int mSecondaryCur -
displayingSecondaryCurrency
protected boolean displayingSecondaryCurrency
-
-
Constructor Details
-
PIATextAreaField
public PIATextAreaField()Creates a textarea component
-
-
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
Get the base resource name used in resource lookup.- Specified by:
getResourceNamein interfacePClientComponent- Returns:
- The base resource name
- Throws:
RemoteException
-
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 example, the DisplayFieldDescription might be "FldNameinfo[any].FldFirstName, FldNameinfo[any].FldLastName" and the DisplayFieldFormat for that might be "{1}, {0}" to display the last name followed by a comma and then the first name.- 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- The value of the required attribute
-
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 current value (or element count, depending on the given component) as the default value. Any modifications after this method is called will result in a "dirty" component.- Specified by:
setDefaultin interfacePComponentAttribute
-
isCurrencyDisplay
public boolean isCurrencyDisplay()Determines if the component is displaying currency 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
Causes the widget to convert its data using the BEIDManager.- Specified by:
togglePrimaryToSecondaryin interfacePComponentAttribute- Specified by:
togglePrimaryToSecondaryin interfacePFieldBean- Parameters:
primary- The primary currency IDsecondary- The secondary currency ID- 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
-
isManagingFocus
public boolean isManagingFocus()Overridden to allow tab traversal when TAB key is entered.- Overrides:
isManagingFocusin classJComponent- Returns:
- false, so the Tab key moves focus to the next 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
-
setMaximumLength
public void setMaximumLength(int max) set the limit to accept maximum number of characters in the text area field- Parameters:
max-
-