Class PComponentImpl

java.lang.Object
com.portal.bas.PComponentImpl
All Implemented Interfaces:
PComponent, PRemoteComponent, PViewDataChangeListener, Serializable, Remote, EventListener
Direct Known Subclasses:
PFieldComponentImpl

public class PComponentImpl extends Object implements PRemoteComponent, Serializable
Deprecated.
As of Release 6.1, PComponentImpl is deprecated and replaced by PComponentDelegate.
PComponentImpl is a distributed class that provides the base functionality needed by a new UI control to support display and editing of Portal database information. This class is used as a delegate by PViewComponent to work around multiple inheritance problems. PViewComponent is the class that should be inherited from for new components.
Version:
12
Author:
Larry Lynch-Freshner
See Also:
  • Field Details

  • Constructor Details

    • PComponentImpl

      public PComponentImpl(PViewComponent comp) throws RemoteException
      Deprecated.
      Creates an instance of the implementation object to delegate to the PViewComponent interface. Any implementations of PViewComponent must delegate to this object. Because this implementation provides the remote object behavior, there is some delegation back to the PAppComponent subclass as well.
      Parameters:
      comp - the derivitive of PViewComponent for which this instance implements remote behavior
      Throws:
      RemoteException - thrown for all problems
  • Method Details

    • setModelHandle

      public void setModelHandle(PModelHandle data) throws RemoteException
      Deprecated.
      Sets the PModelHandle property. This data is forwarded to the controller as well.
      Specified by:
      setModelHandle in interface PComponent
      Parameters:
      data - the new model handle
      Throws:
      RemoteException - thrown for all problems
    • getModelHandle

      public PModelHandle getModelHandle() throws RemoteException
      Deprecated.
      Gets the model handle.
      Specified by:
      getModelHandle in interface PComponent
      Returns:
      A PModelHandle.
      Throws:
      RemoteException - thrown for all problems
    • isLight

      public boolean isLight() throws RemoteException
      Deprecated.
      Determines whether this is a lightweight component. Lightweight components do not have their own model. Instead, they use the model of their container. This means that getModelHandle() always returns null, setModelHandle() is ignored, and no property change events are generated.
      Specified by:
      isLight in interface PComponent
      Returns:
      True if component is lightweight; false otherwise.
      Throws:
      RemoteException - thrown for all problems
    • getControllerClassName

      public String getControllerClassName() throws RemoteException
      Deprecated.
      Gets the name for the controller of this class. The default is to add the word "Controller" to the component's class name. This should be overridden by the delegator to use other names.
      Specified by:
      getControllerClassName in interface PComponent
      Returns:
      A String with the component's controller class name.
      Throws:
      RemoteException - thrown for all problems
    • viewDataChange

      public void viewDataChange(PViewDataChangeEvent event) throws RemoteException
      Deprecated.
      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. The default behavior handles async errors.
      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
    • setComponentController

      public void setComponentController(PComponentController controller) throws RemoteException
      Deprecated.
      An internal method called by the BAS server to assign the created controller.
      Specified by:
      setComponentController in interface PRemoteComponent
      Parameters:
      controller - the new controller object
      Throws:
      RemoteException - thrown for problems
    • getComponentController

      public PComponentController getComponentController() throws RemoteException
      Deprecated.
      Gets the controller. Sometimes called by a delegator for special direct access.
      Specified by:
      getComponentController in interface PRemoteComponent
      Returns:
      A PComponentController object.
      Throws:
      RemoteException - thrown for all problems
    • setResourceName

      public void setResourceName(String name)
      Deprecated.
      Sets the base resource name.
      Parameters:
      name - a String with the resource name
    • getResourceName

      public String getResourceName()
      Deprecated.
      Gets the base resource name. If one has not been set for this component specifically, it returns one set in a parent object.
      Returns:
      A String that contains the resource base name, if any; null otherwise.
    • getTools

      public Vector getTools()
      Deprecated.
      Gets a list of Actions supported by this component. When subclassed, the override class should call its superclass, then add its actions to the returned list. This preserves actions supplied by base classes. The default, supplied here, includes help for this component.
      Returns:
      A Vector that contains Action objects.
    • getResource

      public String getResource(String tag) throws RemoteException
      Deprecated.
      Gets the resource string associated with the parameter. Takes the base resource name into account.
      Parameters:
      tag - the resource tag
      Returns:
      A String resource. If none is found, returns the tag.
      Throws:
      RemoteException - thrown for errors
    • register

      public void register() throws RemoteException
      Deprecated.
      A utility method called to retrieve the name of a subclass and register it as a new GUI component.
      Throws:
      RemoteException - thrown for errors
    • unregister

      public void unregister() throws RemoteException
      Deprecated.
      A utility method called to unregister a subclass from its controller, thus allowing both to be garbage collected.
      Throws:
      RemoteException
    • sendDataActionEvent

      public Object sendDataActionEvent(String command, Object data) throws RemoteException
      Deprecated.
      A utility method used to send actions to the controller to be handled.
      Parameters:
      command - the action command for the controller to handle
      data - the data for the controller to use
      Returns:
      The result, if any, of the action performed.
      Throws:
      RemoteException - thrown for errors
    • setProperty

      public void setProperty(String prop, Object val) throws RemoteException
      Deprecated.
      Sets the value of an arbitrary property. The property has meaning only to a specific subclass.
      Parameters:
      prop - a String property name
      val - the property value
      Throws:
      RemoteException - thrown for all problems
    • getProperty

      public Object getProperty(String prop) throws RemoteException
      Deprecated.
      Gets the value of an arbitrary property. The property has meaning only to a specific subclass.
      Parameters:
      prop - a String property name
      Returns:
      The property value.
      Throws:
      RemoteException - thrown for all problems
    • getRemoteListenerHandle

      public Object getRemoteListenerHandle(String type) throws RemoteException
      Deprecated.
      Gets a remote listener handle from the controller. Can be used to add a remote listener to another component.
      Parameters:
      type - the listener's type
      Returns:
      The listener's handle.
      Throws:
      RemoteException - thrown for all problems
    • addRemoteListener

      public void addRemoteListener(Object remoteListenerHandle) throws RemoteException
      Deprecated.
      Adds a controller-side event listener.
      Parameters:
      remoteListenerHandle - a handle to a controller-side listener
      Throws:
      RemoteException - thrown for all problems
    • removeRemoteListener

      public void removeRemoteListener(Object remoteListenerHandle) throws RemoteException
      Deprecated.
      Removes a controller-side event listener.
      Parameters:
      remoteListenerHandle - a handle to a controller-side listener
      Throws:
      RemoteException - thrown for all problems
    • releaseRemoteListener

      public void releaseRemoteListener(Object remoteListenerHandle) throws RemoteException
      Deprecated.
      Releases a remote listener handle.
      Parameters:
      remoteListenerHandle - the listener's handle
      Throws:
      RemoteException - thrown for all problems
    • getArraySpecRange

      public int[] getArraySpecRange(PModelHandle mh, String spec) throws RemoteException
      Deprecated.
      Given a model and a specification for an array in that model, get the range of actual elements in the array. The return array will contain 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.
      Parameters:
      mh - a PModelHandle
      spec - a field description
      Returns:
      An int array, where indexes 0 and 1 contain the low and high bounds (if the array has a single element, only the low bound is given). If the array doesn't contain consecutive indices, then indices 2 and up contain the specific element number used in the SparseArray.
      Throws:
      RemoteException - thrown for errors
    • getArraySpecEnum

      public Enumeration getArraySpecEnum(String spec, int[] vals)
      Deprecated.
      Gets an enumeration for an array description, given a set of possible index values. The enumeration produces string descriptions of specific array elements.
      Parameters:
      spec - a field description string that describes an array
      vals - possible array index values
      Returns:
      An Enumeration object.
    • getElementOfSpec

      public String getElementOfSpec(String spec, int element)
      Deprecated.
      A helper function which, given an array specification string and an index, returns a String with the index used in the array.
      Parameters:
      spec - a field description string that describes an array
      element - a specific element in the array
      Returns:
      The specified String, with the array element replaced by the specified new element.