Class PIAObjectField

All Implemented Interfaces:
PAppComponent, PAppFieldComponent, PClientComponent, PCollectDataListener, PComponent, PComponentAttribute, PFieldBean, PLightComponent, PViewDataChangeListener, ActionListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, Remote, EventListener, Accessible, ListDataListener

PIAObjectField is a Swing-compatible, Portal-aware List display class.
Version:
2
Author:
Larry Lynch-Freshner
See Also:
  • Constructor Details

    • PIAObjectField

      public PIAObjectField()
      Creates a combo box component that contains a PModelHandle in the model and String representations of each PModelHandle.
  • Method Details

    • unregister

      public void unregister() throws RemoteException
      Used to disassociate this component from its delegate (controller)
      Specified by:
      unregister in interface PClientComponent
      Throws:
      RemoteException
    • addNotify

      public void addNotify()
      Overridden to create a renderer for this combo box.
      Overrides:
      addNotify in class JComponent
    • setModelHandle

      public void setModelHandle(PModelHandle data) throws RemoteException
      Establishes the PModelHandle for this component.
      Specified by:
      setModelHandle in interface PComponent
      Parameters:
      data - the new PModelHandle from which to extract information
      Throws:
      RemoteException - thrown for errors
    • getModelHandle

      public PModelHandle getModelHandle() throws RemoteException
      Retrieves the PModelHandle for this component.
      Specified by:
      getModelHandle in interface PComponent
      Returns:
      The PModelHandle associated with this component.
      Throws:
      RemoteException - thrown for errors
    • isLight

      public boolean isLight() throws RemoteException
      Determines if this component defers PModelHandle knowledge to its parent container. If so, the parent container passes the PModelHandle to this component on the server side (by way of the controller), which saves a client/server round trip for data exchange.

      If specific processing is required, when PModelHandle is called, subclass this component and override this method. Otherwise, setModelHandle() will not be called.

      Specified by:
      isLight in interface PComponent
      Returns:
      True if this component defers knowledge; false otherwise.
      Throws:
      RemoteException - thrown for errors
    • getControllerClassName

      public String getControllerClassName() throws RemoteException
      Retrieves the class name of this component's controller.
      Specified by:
      getControllerClassName in interface PComponent
      Returns:
      A String with the value "com.portal.bas.comp.PIAObjectFieldBeanImpl".
      Throws:
      RemoteException - thrown for errors
    • getTools

      public Vector 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:
      getTools in interface PClientComponent
      Returns:
      A Vector that contains Action objects.
    • setResourceName

      public void setResourceName(String name)
      Sets the base resource name used in resource look up. Basically, the resource name is this base, followed by a dot, followed by the local name (label).
      Specified by:
      setResourceName in interface PClientComponent
      Parameters:
      name - the new base resource name
    • getResourceName

      public String getResourceName()
      Returns the base resource name used in resource look up.
      Specified by:
      getResourceName in interface PClientComponent
      Returns:
      A String with the base resource name used in resource look up.
    • getRemoteComponent

      public Remote getRemoteComponent()
      Gets a reference to the remote component for this object. The remote component is used to interface with this component's controller.
      Specified by:
      getRemoteComponent in interface PAppComponent
      Returns:
      A Remote component.
    • setModelFieldDescription

      public void setModelFieldDescription(String fieldDesc) throws RemoteException
      Sets the description of the field in the data model that this component is interested in.
      Specified by:
      setModelFieldDescription in interface PFieldBean
      Parameters:
      fieldDesc - a String that describes the field used by this component
      Throws:
      RemoteException - thrown for errors
    • getModelFieldDescription

      public String getModelFieldDescription() throws RemoteException
      Gets the data field description used by the component.
      Specified by:
      getModelFieldDescription in interface PFieldBean
      Returns:
      A String description of the field used by this component.
      Throws:
      RemoteException - thrown for errors
    • setDisplayFieldDescription

      public void setDisplayFieldDescription(String fieldDisp) throws RemoteException
      Sets the description of the field(s) in the data model that this component displays.
      Specified by:
      setDisplayFieldDescription in interface PFieldBean
      Parameters:
      fieldDisp - a String that describes the field displayed by this component
      Throws:
      RemoteException - thrown for errors
    • getDisplayFieldDescription

      public String getDisplayFieldDescription() throws RemoteException
      Gets the data field description used by the component.
      Specified by:
      getDisplayFieldDescription in interface PFieldBean
      Returns:
      A String description of the field used by this component.
      Throws:
      RemoteException - thrown for errors
    • setDisplayFieldFormat

      public void setDisplayFieldFormat(String fieldForm) throws RemoteException
      Sets the java.text.MessageFormat format used to display data in this component. This is typically (but not necessarily) directly tied to the displayFieldDescription property.
      Specified by:
      setDisplayFieldFormat in interface PAppFieldComponent
      Parameters:
      fieldForm - the format used to display the data
      Throws:
      RemoteException - thrown for errors
    • getDisplayFieldFormat

      public String getDisplayFieldFormat() throws RemoteException
      Gets the display field format used by this component.
      Specified by:
      getDisplayFieldFormat in interface PAppFieldComponent
      Returns:
      A String representation of the display field format.
      Throws:
      RemoteException - thrown for errors
    • setAssociatedClass

      public void setAssociatedClass(String name) throws RemoteException
      Sets the associated class, if any, for this field.
      Specified by:
      setAssociatedClass in interface PFieldBean
      Parameters:
      name - a String with the class name
      Throws:
      RemoteException - thrown for errors
    • getAssociatedClass

      public String getAssociatedClass() throws RemoteException
      Gets the associated class, if any, for this field.
      Specified by:
      getAssociatedClass in interface PFieldBean
      Returns:
      A String with the associated class name.
      Throws:
      RemoteException - thrown for errors
    • setField

      public void setField(Object field) throws RemoteException
      Sets the value of the field referred to in the modelFieldDescription.
      Specified by:
      setField in interface PFieldBean
      Parameters:
      field - the field's value
      value - the field's value
      Throws:
      RemoteException - thrown for errors
    • getField

      public Object getField() throws RemoteException
      Gets the value of the field referred to in the displayFieldDescription.
      Specified by:
      getField in interface PFieldBean
      Returns:
      The field's value.
      Throws:
      RemoteException - thrown for errors
    • getDataDescriptor

      public String getDataDescriptor()
      Gets the data field description used by the component.
      Specified by:
      getDataDescriptor in interface PLightComponent
      Returns:
      A String description of the fields used by this component or null if there is none.
      Throws:
      RemoteException - thrown for errors
    • setLightData

      public void setLightData(Object field)
      Sets the lightweight data object.
      Specified by:
      setLightData in interface PLightComponent
      Parameters:
      field - the lightweight component's display data
    • getLightData

      public Object getLightData()
      Gets the lightweight data object.
      Specified by:
      getLightData in interface PLightComponent
      Parameters:
      field - the lightweight component's display value
      Returns:
      An Object that represents a component's display data.
    • setHelpID

      public void setHelpID(String id)
      Sets the help ID for this component.
      Specified by:
      setHelpID in interface PAppFieldComponent
      Parameters:
      id - the new help ID
    • getHelpID

      public String getHelpID()
      Gets the current help ID for this component.
      Specified by:
      getHelpID in interface PAppFieldComponent
      Returns:
      A String help ID.
    • resetToDefault

      public void resetToDefault()
      Resets the component value to the original value (that which was established by a call to setDefault()). If no default value exists, the component data is cleared.
      Specified by:
      resetToDefault in interface PComponentAttribute
    • clear

      public void clear()
      Clears existing data from the component.
      Specified by:
      clear in interface PComponentAttribute
    • isRequired

      public boolean isRequired()
      Determines if this component is a required field in its current context. This provides a visual indicator only; there is no mechanism to enforce that required fields be filled in.
      Specified by:
      isRequired in interface PComponentAttribute
      Returns:
      True if this field is marked REQUIRED; false otherwise.
    • 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 mechanism to enforce that required fields be filled in.
      Specified by:
      setRequired in interface PComponentAttribute
      Parameters:
      b - if true, puts the component in REQUIRED state
    • isError

      public boolean isError()
      Determines if this component is currently in an ERROR state.
      Specified by:
      isError in interface PComponentAttribute
      Returns:
      True if this component is in an ERROR state; false otherwise.
    • 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 interface PComponentAttribute
      Parameters:
      b - if true, puts the component in ERROR state; if false, removes the ERROR state
    • setInputTracking

      public void setInputTracking(boolean b)
      If the inputTracking property is enabled, any changes made by the user to the component are tracked and the component is marked DIRTY. If the user modifies the data and returns it to its default or original state, the component is marked CLEAN or not DIRTY.
      Specified by:
      setInputTracking in interface PComponentAttribute
      Parameters:
      b - the state of the inputTracking property
    • isInputTracking

      public boolean isInputTracking()
      Determines if inputTracking is enabled.
      Specified by:
      isInputTracking in interface PComponentAttribute
      Returns:
      True if inputTracking is enabled; false otherwise.
    • setClean

      public void setClean()
      Resets the component to the CLEAN state. If the component was in a DIRTY or ERROR state, this method removes those attributes. A required component is still marked REQUIRED after a call to this method.
      Specified by:
      setClean in interface PComponentAttribute
    • isDirty

      public boolean isDirty()
      Determines if this component is currently in a DIRTY state.
      Specified by:
      isDirty in interface PComponentAttribute
      Returns:
      True if the user has modified the data represented by this component, false otherwise. It also returns false if inputTracking is not enabled.
    • setDefault

      public void setDefault()
      Establishes the currently selected item as the default selection, and the current number of items in the model as the default item count. Any modifications made after this method is called will result in a DIRTY component.
      Specified by:
      setDefault in interface PComponentAttribute
    • isCurrencyDisplay

      public boolean isCurrencyDisplay()
      Returns false to indicate that this widget never displays currency data.
      Specified by:
      isCurrencyDisplay in interface PComponentAttribute
      Returns:
      false.
      Since:
      Release 6.2
    • setCurrencyDisplay

      public void setCurrencyDisplay(boolean b)
      Does nothing.
      Specified by:
      setCurrencyDisplay in interface PComponentAttribute
      Parameters:
      b - if true, indicates that the widget currently displays currency data
      Since:
      Release 6.2
    • togglePrimaryToSecondary

      public Object togglePrimaryToSecondary(int primary, int secondary) throws RemoteException
      Does nothing.
      Specified by:
      togglePrimaryToSecondary in interface PComponentAttribute
      Specified by:
      togglePrimaryToSecondary in interface PFieldBean
      Parameters:
      primary - the primary currency ID
      secondary - the secondary currency ID
      Returns:
      The converted value.
      Throws:
      RemoteException
      Since:
      Release 6.2
    • revertToPrimary

      public void revertToPrimary(int primary) throws RemoteException
      Causes the widget to display its data in the primary currency
      Specified by:
      revertToPrimary in interface PComponentAttribute
      Specified by:
      revertToPrimary in interface PFieldBean
      Parameters:
      primary - The primary currency ID for an account
      Throws:
      RemoteException
    • viewDataChange

      public void viewDataChange(PViewDataChangeEvent event) throws RemoteException
      Overrides PViewDataChangeListener. 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 appropriate get() methods on the controller to get the data, because the PViewDataChangeEvent parameter is no longer used.
      Specified by:
      viewDataChange in interface PViewDataChangeListener
      Parameters:
      event - the PViewDataChangeEvent event that describes the change. No longer used. By default, the value passed in is always set to null.
      Throws:
      RemoteException - thrown for errors
    • collectData

      public void collectData(PCollectDataEvent event)
      Overrides PCollectDataListener. Causes control to save changes back to the data model. Done prior to committing changes to Portal.
      Specified by:
      collectData in interface PCollectDataListener
      Parameters:
      event - the data collection event
    • setChoiceModel

      public void setChoiceModel(PModelHandle mh) throws RemoteException
      Sets a model from which an array of choices can be extracted.
      Parameters:
      mh - a model handle
      Throws:
      RemoteException - thrown for errors
    • setChoiceSpec

      public void setChoiceSpec(String spec) throws RemoteException
      Specifies which field in the setChoiceModel in an array of objects can be used as selections in the combo box. The regular model, displaySpec, should also be compatible with these choices.
      Parameters:
      spec - a field specification that evaluates to an array field
      Throws:
      RemoteException - thrown for errors
    • getChoiceSpec

      public String getChoiceSpec() throws RemoteException
      Retrieves the choice specification.
      Returns:
      A String that contains the specification.
      Throws:
      RemoteException - thrown for errors