Class PIAGroupTree

All Implemented Interfaces:
PAppComponent, PAppFieldComponent, PClientComponent, PComponent, PComponentAttribute, PFieldBean, PViewDataChangeListener, ImageObserver, MenuContainer, Serializable, Remote, EventListener, Accessible, TreeSelectionListener, Scrollable
Direct Known Subclasses:
PAcctTree

public class PIAGroupTree extends JTree implements PAppFieldComponent, PComponentAttribute, TreeSelectionListener, Serializable
PIAGroupTree is a Swing-compatible, Portal-aware group tree control. setData expects an object or an array of objects that each have a field (specified by setModelFieldSpecification()) that contains a group object. That group object should contain a collection of objects that also have group fields. The Display specification pertains to the object with the group field, not the group itself.
Version:
%revision%
Author:
Larry Lynch-Freshner
See Also:
  • Field Details

  • Constructor Details

    • PIAGroupTree

      public PIAGroupTree()
      Creates an Portal-aware tree component. This constructor differentiates between design time and run time to ensure the correct methodology is used.
    • PIAGroupTree

      public PIAGroupTree(PGroupTreeModel m)
      Creates an Portal-aware tree component that contains data in the given model.
      Parameters:
      m - the default model to use
  • Method Details

    • 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 or null, if this is a lightweight 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.PIAGroupTreeBeanImpl".
      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.
    • 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-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:
      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 group.
      Specified by:
      setAssociatedClass in interface PFieldBean
      Parameters:
      name - 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 data) throws RemoteException
      Sets the value of the field in a model.
      Specified by:
      setField in interface PFieldBean
      Parameters:
      data - the value to set
      Throws:
      RemoteException - thrown for errors
    • getField

      public Object getField() throws RemoteException
      Gets a field from a model.
      Specified by:
      getField in interface PFieldBean
      Returns:
      The field value.
      Throws:
      RemoteException - thrown if an error occurs
    • 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 calling setDefault()). If no default value exists, the component data is cleared.

      This method is currently not implemented.

      Specified by:
      resetToDefault in interface PComponentAttribute
    • clear

      public void clear()
      Clears existing data from the component.

      This method is currently not implemented.

      Specified by:
      clear in interface PComponentAttribute
    • 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 interface PComponentAttribute
      Returns:
      True if this field is required, false if it is not 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 interface PComponentAttribute
      Parameters:
      b - if true, puts the component in REQUIRED state
    • isError

      public boolean isError()
      Used to determine if this component is currently in an error state.
      Specified by:
      isError in interface PComponentAttribute
      Returns:
      The error state of this component.
    • setError

      public void setError(boolean b)
      Marks that this component contains 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
    • 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 input tracking is enabled.
      Specified by:
      isInputTracking in interface PComponentAttribute
      Returns:
      True if input tracking is enabled; false otherwise.
    • setClean

      public void setClean()
      Used to reset 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 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 results in a DIRTY component.

      This method is currently not implemented.

      Specified by:
      setDefault in interface PComponentAttribute
    • isCurrencyDisplay

      public boolean isCurrencyDisplay()
      Determines whether the component currently displays currency data. This method always returns false, because this widget displays String data.
      Specified by:
      isCurrencyDisplay in interface PComponentAttribute
      Returns:
      True if the widget currently displays currency data; false otherwise.
      Since:
      Release 6.2
    • setCurrencyDisplay

      public void setCurrencyDisplay(boolean b)
      Determines if this component currently displays currency data. Widgets that display currency data are capable of automatically toggling their data between a primary and secondary Portal currency type.

      Because this widget displays String, the value passed in is always false.

      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 pri, int sec) throws RemoteException
      Does nothing.
      Specified by:
      togglePrimaryToSecondary in interface PComponentAttribute
      Specified by:
      togglePrimaryToSecondary in interface PFieldBean
      Parameters:
      pri - the primary currency ID
      sec - the secondary currency ID
      Returns:
      null.
      Throws:
      RemoteException
    • revertToPrimary

      public void revertToPrimary(int primary) throws RemoteException
      Does nothing.
      Specified by:
      revertToPrimary in interface PComponentAttribute
      Specified by:
      revertToPrimary in interface PFieldBean
      Parameters:
      primary - the primary currency ID
      Throws:
      RemoteException
    • setLazyExpand

      public void setLazyExpand(boolean doLazy)
      Sets the state of the lazy expand flag.
      Parameters:
      doLazy - the new value of this flag
    • getLazyExpand

      public boolean getLazyExpand()
      Retrieves the state of the lazy expand flag.
      Returns:
      True, if the lazy expand flag is enabled; false otherwise.
    • valueChanged

      public void valueChanged(TreeSelectionEvent e)
      Indicates that something has changed in the tree.
      Specified by:
      valueChanged in interface TreeSelectionListener
      Parameters:
      e - the new event that contains the data change
    • addIASelectionListener

      public void addIASelectionListener(PIASelectionListener l)
    • removeIASelectionListener

      public void removeIASelectionListener(PIASelectionListener l)
    • 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
    • setSupportLocaleBasedFormat

      public void setSupportLocaleBasedFormat(boolean bSupported)
      Determines if the tree node labels are formatted uniformly based on the displayfielddescription set on the tree, or if they are formatted differently based on the locale info in each node
      Parameters:
      bSupported - set to true to support node-based formatting
    • unregister

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