Class PIAPanel

All Implemented Interfaces:
PClientComponent, PCollectDataListener, PComponent, PComponentAttribute, PViewComponent, PViewDataChangeListener, ContainerListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible
Direct Known Subclasses:
PIAExpirationField, PIANotesPanel, PIAPanelGroup, PPayInfoPanel, SearchPanel

PIAPanel is a Swing-compatible, Portal-aware Panel. This component tracks the Portal-aware components that are added to it and passes data (model handles) and method calls (for example, from PComponentAttribute) to all of the children components.
Version:
8
Author:
Larry Lynch-Freshner
See Also:
  • Field Details

    • mIAList

      protected transient LinkedList mIAList
    • mImpl

      protected transient PComponentImpl mImpl
    • isTracking

      protected boolean isTracking
    • collectDataFromInvisiblePanels

      protected boolean collectDataFromInvisiblePanels
      Set this to true if you want invisible panels to participate in data collection. By default, they do not.
  • Constructor Details

    • PIAPanel

      public PIAPanel()
      Creates a PIAPanel that contains some knowledge of Portal. This Panel displays an image, centered in the background.
    • PIAPanel

      public PIAPanel(ImageIcon img, int mode)
      Creates a PIAPanel that contains some knowledge of Portal. This Panel also knows how to display an image in the background.
      Parameters:
      img - the image to display
      mode - indicates how to display the background image
  • Method Details

    • unregister

      public void unregister() throws RemoteException
      Disassociates the controller from the component
      Specified by:
      unregister in interface PClientComponent
      Throws:
      RemoteException
    • setModelHandle

      public void setModelHandle(PModelHandle data) throws RemoteException
      Establishes the PModelHandle for this component and all its descendants.
      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. Containers typically do not defer processing but instead handle it themselves.
      Specified by:
      isLight in interface PComponent
      Returns:
      False, by default.
      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 name of the controller.
      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()
      Gets the base resource name used in resource look up.
      Specified by:
      getResourceName in interface PClientComponent
      Returns:
      A String with the base resource name.
    • firePropertyChange

      public void firePropertyChange(String prop, Object oldV, Object newV)
      Fires a property change event to any registered listener.
      Specified by:
      firePropertyChange in interface PViewComponent
      Overrides:
      firePropertyChange in class Component
      Parameters:
      prop - the property that has changed
      oldV - the old value
      newV - the new value
    • fireVetoableChange

      public void fireVetoableChange(String prop, Object oldV, Object newV) throws PropertyVetoException
      Fires a vetoable property change event to any registered listener.
      Specified by:
      fireVetoableChange in interface PViewComponent
      Overrides:
      fireVetoableChange in class JComponent
      Parameters:
      prop - the property that has changed
      oldV - the old value
      newV - the new value
      Throws:
      PropertyVetoException - thrown when a proposed change to a property represents an unacceptable value
    • getRemoteComponent

      public PRemoteComponent 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 PViewComponent
      Returns:
      A Remote component.
    • togglePrimaryToSecondary

      public Object togglePrimaryToSecondary(int primary, int secondary) throws RemoteException
      This method is not implemented for PIAPanel. Use PIACustomizablePanel instead.
      Specified by:
      togglePrimaryToSecondary in interface PComponentAttribute
      Parameters:
      primary - The primary currency ID
      secondary - The secondary currency ID
      from - the current Portal currency ID
      to - the new Portal currency ID
      Throws:
      RemoteException
    • 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
      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. The client code should call the appropriate get() methods on the controller to get the data, as 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
    • setBackgroundImageSource

      public void setBackgroundImageSource(String loc)
    • getBackgroundImageSource

      public String getBackgroundImageSource()
    • setBackgroundImageMode

      public void setBackgroundImageMode(int drawMode)
      Overrides:
      setBackgroundImageMode in class ImagePanel
    • componentAdded

      public void componentAdded(ContainerEvent e)
      Tracks all Portal-aware components that are added to this panel.
      Specified by:
      componentAdded in interface ContainerListener
      Parameters:
      e - the event that indicates a child was added
    • componentRemoved

      public void componentRemoved(ContainerEvent e)
      Tracks all Portal-aware components that are removed from this panel.
      Specified by:
      componentRemoved in interface ContainerListener
      Parameters:
      e - the event that indicates a child was removed
    • setRequired

      public void setRequired(boolean b)
      Passes the setRequired() method call to all Portal-aware descendants.
      Specified by:
      setRequired in interface PComponentAttribute
      Parameters:
      b - if true, puts the component in the REQUIRED state
    • isRequired

      public boolean isRequired()
      Determines if any descendant is required in its current context.
      Specified by:
      isRequired in interface PComponentAttribute
      Returns:
      True if any descendant is marked REQUIRED; false otherwise.
    • setError

      public void setError(boolean b)
      Passes the setError() method call to all Portal-aware descendants.
      Specified by:
      setError in interface PComponentAttribute
      Parameters:
      b - if true, puts the component in the ERROR state
    • isError

      public boolean isError()
      Determines if any descendant is marked ERROR in its current context.
      Specified by:
      isError in interface PComponentAttribute
      Returns:
      True if any descendant is marked ERROR; false otherwise.
    • isDirty

      public boolean isDirty()
      Determines if any descendant is marked DIRTY in its current context.
      Specified by:
      isDirty in interface PComponentAttribute
      Returns:
      True if any descendant is marked DIRTY; false otherwise.
    • setDefault

      public void setDefault()
      Establishes the current value of every Portal-aware descendant as the default value for that component.
      Specified by:
      setDefault in interface PComponentAttribute
    • isClean

      public boolean isClean()
      Determines if any descendant is marked DIRTY or ERROR.
      Returns:
      True if no descendant is marked DIRTY or ERROR; false otherwise.
    • setClean

      public void setClean()
      A convenience method that marks all PFieldComponent components in this panel as CLEAN. Useful if components were marked DIRTY because inputTracking is on and the data was modified.
      Specified by:
      setClean in interface PComponentAttribute
    • setInputTracking

      public void setInputTracking(boolean b)
      A convenience method to toggle the inputTracking property for all descendants of this panel.

      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 on for this panel (itself).
      Specified by:
      isInputTracking in interface PComponentAttribute
      Returns:
      True if inputTracking is on; false otherwise.
    • clear

      public void clear()
      A convenience method to clear every Portal-aware descendant of this panel.
      Specified by:
      clear in interface PComponentAttribute
    • resetToDefault

      public void resetToDefault()
      A convenience method to reset every field on this panel.
      Specified by:
      resetToDefault in interface PComponentAttribute
    • isCurrencyDisplay

      public boolean isCurrencyDisplay()
      Determines whether any descendants currently display currency data.
      Specified by:
      isCurrencyDisplay in interface PComponentAttribute
      Returns:
      True if a descendant currently displays currency data; false otherwise.
      Since:
      Release 6.2
    • setCurrencyDisplay

      public void setCurrencyDisplay(boolean b)
      A convenience method to mark whether all components in this panel can display currency data.

      Widgets that display currency data are capable of automatically toggling their data between a primary and secondary Portal currency type.

      Use this API if the application you are building allows the user to switch between multiple currencies. For each widget that displays currency data, set this property to true.

      Specified by:
      setCurrencyDisplay in interface PComponentAttribute
      Parameters:
      b - if true, indicates that the widget currently displays currency data
      Since:
      Release 6.2
    • collectData

      public void collectData(PCollectDataEvent event)
      Overrides PCollectDataListener. Forewarded to all contained GUI components that are also a PCollectDataListener.
      Specified by:
      collectData in interface PCollectDataListener
      Parameters:
      event - the PCollectDataEvent data event
    • containsError

      public boolean containsError(Object obj)
      Not implemented in this class, but provides a mechanism to pass error data to subclasses. If a subclass contains non-PIA components that subclass may want to flag that those components contain errors. This method provides that mechanism.

      Typically the argument to this method is an array of CustomerValErrorData objects, but the possibility for other types is left open.

      Parameters:
      obj - a generic parameter used to pass error data to the panel
      Returns:
      False, by default
    • getBundle

      public static ResourceBundle getBundle(String name)
      Intended for use by PIAPanel subclasses that are set up for use in Borland JBuilder. JBuilder requires that resource bundles be statically loaded using the ResourceBundle.getBundle() method, but at runtime, the BAS methodology should be used. This method differentiates between design time and run time and retrieves the appropriate resources.
    • processError

      protected Object processError(PModelHandle err)
      Provides a hook for subclasses to react to errors if they choose to do so. A subclass may need to override collectData() to pass along other data. If an error occurs, that subclass needs to check to determine if it is the cause of the error and respond to it appropriately.
      Parameters:
      err - the error model handle
      Returns:
      Another hook, in case data needs to be returned.