Class PLightComponentHelper

java.lang.Object
com.portal.bas.PLightComponentHelper
All Implemented Interfaces:
PCollectDataListener, PControllerBean, PLightComponent, Remote, EventListener

public class PLightComponentHelper extends Object implements PLightComponent, PControllerBean, PCollectDataListener
PLightComponentHelper is a helper class for PLightComponent.
Version:
%version: 6 % %date_modified: Tue Dec 18 15:43:11 2001 %
Author:
larrylf
  • Method Details

    • unregister

      public void unregister() throws RemoteException
      Allows garbage collection - disassociates the component from its controller.
      Throws:
      RemoteException
    • getDataDescriptor

      public String getDataDescriptor()
      Returns 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:
      getDataDescriptor in interface PLightComponent
      Returns:
      A String data description.
    • getLightData

      public Object getLightData()
      Gets the lightweight data object itself.
      Specified by:
      getLightData in interface PLightComponent
      Returns:
      A field Object that represents a component's display data.
    • 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
    • collectData

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

      public void setModel(PModelHandle model) throws RemoteException
      Passes the model to the controller.
      Specified by:
      setModel in interface PControllerBean
      Parameters:
      model - the new data model
      Throws:
      RemoteException - thrown for errors
    • getModel

      public PModelHandle getModel() throws RemoteException
      Accesses the data model.
      Specified by:
      getModel in interface PControllerBean
      Returns:
      The data model.
      Throws:
      RemoteException - thrown for errors
    • isLight

      public boolean isLight() throws RemoteException
      Determines whether this is a lightweight component. Lightweight components do not have their own model, instead, they use that of their container. This means that the getModelHandle method will always return null, the setModelHandle method is ignored, and no property change events are generated. The value returned must be the same in both component and controller.
      Specified by:
      isLight in interface PControllerBean
      Returns:
      True if the component is lightweight; false otherwise.
      Throws:
      RemoteException - thrown for errors
    • getSelectionDataFor

      public Object getSelectionDataFor(String dataItem, int index) throws RemoteException
      Given the name of a display data item and an optional index, returns the information needed (usually, model data) for a selection event to be useful.
      Specified by:
      getSelectionDataFor in interface PControllerBean
      Parameters:
      dataItem - the name of a data item. Must match the name of an item changed by sending a PViewDataChangeEvent.
      index - an optional index into an array data item
      Returns:
      A model handle or array of model handles.
      Throws:
      RemoteException - thrown for errors
    • getArrayRange

      public int[] getArrayRange(PModelHandle mh, String spec) throws RemoteException
      Given a model and a specification for an array in that model, get the range of actual elements in the array. The returned array contains the lowest element number in [0], and the highest in [1]. If the array is sparse, each element is iterated, starting in [2] otherwise, only the range is provided.
      Specified by:
      getArrayRange in interface PControllerBean
      Parameters:
      mh - a model handle
      spec - a field description
      Returns:
      An integer array that contains the range of actual values.
      Throws:
      RemoteException - thrown for all problems
    • getRemoteListenerHandle

      public Object getRemoteListenerHandle(String type) throws RemoteException
      If the component's controller can listen for events from other controllers, this method posts a listener and returns a handle to identify it.
      Specified by:
      getRemoteListenerHandle in interface PControllerBean
      Parameters:
      type - the type of listener to get
      Returns:
      An object handle to identify the listener.
      Throws:
      RemoteException - thrown for all problems
    • releaseRemoteListener

      public void releaseRemoteListener(Object remoteListenerHandle) throws RemoteException
      Removes all listener resources being used by the controller.
      Specified by:
      releaseRemoteListener in interface PControllerBean
      Parameters:
      remoteListenerHandle - an object handle as returned by getRemoteListenerHandle() from another object
      Throws:
      RemoteException - thrown for all problems
    • addRemoteListener

      public void addRemoteListener(Object remoteListenerHandle) throws RemoteException
      If the controller can send events to other controllers, this method is called to pass a handle to the remote listener class. The listener is added to the listener list.
      Specified by:
      addRemoteListener in interface PControllerBean
      Parameters:
      remoteListenerHandle - an object handle as returned by getRemoteListenerHandle() from another object
      Throws:
      RemoteException - thrown for all problems
    • removeRemoteListener

      public void removeRemoteListener(Object remoteListenerHandle) throws RemoteException
      If the controller can send events to other controllers, this method is called to pass a handle to the remote listener class. The listener is removed from the listener list.
      Specified by:
      removeRemoteListener in interface PControllerBean
      Parameters:
      remoteListenerHandle - an object handle as returned by getRemoteListenerHandle() from another object
      Throws:
      RemoteException - thrown for all problems
    • register

      public void register(PControllerBean stub) throws RemoteException
      Allows the lightweight component to register the controller stub it received when the controller was created.
      Specified by:
      register in interface PControllerBean
      Parameters:
      stub - the controller stub owned by the client view
      Throws:
      RemoteException - thrown in case of error
      See Also:
    • getRemoteComponent

      public Remote getRemoteComponent()
      Gets a reference to the remote component (controller) for this object.
      Returns:
      A Remote object.
    • setModelFieldDescription

      public void setModelFieldDescription(String desc) throws RemoteException
      Sets the input data description property of the component.
      Parameters:
      desc - the description or name of the data field passed as an input parameter to Portal
      Throws:
      RemoteException - thrown for errors
    • getModelFieldDescription

      public String getModelFieldDescription() throws RemoteException
      Returns the input data description property of the component.
      Returns:
      The description or name of the data field passed as an input parameter to Portal that is associated with the component.
      Throws:
      RemoteException - thrown for errors
    • setDisplayFieldDescription

      public void setDisplayFieldDescription(String desc) throws RemoteException
      Sets the output data description property of the component.
      Parameters:
      desc - the description or name of the data field returned by Portal that is associated with the component
      Throws:
      RemoteException - thrown for errors
    • getDisplayFieldDescription

      public String getDisplayFieldDescription() throws RemoteException
      Returns the output data description property of the component.
      Returns:
      The description or name of the data field returned by Portal that is associated with the component.
      Throws:
      RemoteException - thrown for errors