Package com.portal.bas
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 Summary
Modifier and TypeMethodDescriptionvoidaddRemoteListener(Object remoteListenerHandle) If the controller can send events to other controllers, this method is called to pass a handle to the remote listener class.voidcollectData(PCollectDataEvent event) OverridesPCollectDataListener.int[]getArrayRange(PModelHandle mh, String spec) Given a model and a specification for an array in that model, get the range of actual elements in the array.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.Returns the output data description property of the component.Gets the lightweight data object itself.getModel()Accesses the data model.Returns the input data description property of the component.Gets a reference to the remote component (controller) for this object.If the component's controller can listen for events from other controllers, this method posts a listener and returns a handle to identify it.getSelectionDataFor(String dataItem, int index) 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.booleanisLight()Determines whether this is a lightweight component.voidregister(PControllerBean stub) Allows the lightweight component to register the controller stub it received when the controller was created.voidreleaseRemoteListener(Object remoteListenerHandle) Removes all listener resources being used by the controller.voidremoveRemoteListener(Object remoteListenerHandle) If the controller can send events to other controllers, this method is called to pass a handle to the remote listener class.voidSets the output data description property of the component.voidsetLightData(Object field) Sets the lightweight data object.voidsetModel(PModelHandle model) Passes the model to the controller.voidSets the input data description property of the component.voidAllows garbage collection - disassociates the component from its controller.
-
Method Details
-
unregister
Allows garbage collection - disassociates the component from its controller.- Throws:
RemoteException
-
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:
getDataDescriptorin interfacePLightComponent- Returns:
- A
Stringdata description.
-
getLightData
Gets the lightweight data object itself.- Specified by:
getLightDatain interfacePLightComponent- Returns:
- A field
Objectthat represents a component's display data.
-
setLightData
Sets the lightweight data object.- Specified by:
setLightDatain interfacePLightComponent- Parameters:
field- the lightweight component's display data
-
collectData
OverridesPCollectDataListener. Causes the control to save changes back to the data model. Done prior to commiting changes to Portal.- Specified by:
collectDatain interfacePCollectDataListener- Parameters:
event- the data collection event
-
setModel
Passes the model to the controller.- Specified by:
setModelin interfacePControllerBean- Parameters:
model- the new data model- Throws:
RemoteException- thrown for errors
-
getModel
Accesses the data model.- Specified by:
getModelin interfacePControllerBean- Returns:
- The data model.
- Throws:
RemoteException- thrown for errors
-
isLight
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 thegetModelHandlemethod will always return null, thesetModelHandlemethod is ignored, and no property change events are generated. The value returned must be the same in both component and controller.- Specified by:
isLightin interfacePControllerBean- Returns:
- True if the component is lightweight; false otherwise.
- Throws:
RemoteException- thrown for errors
-
getSelectionDataFor
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:
getSelectionDataForin interfacePControllerBean- Parameters:
dataItem- the name of a data item. Must match the name of an item changed by sending aPViewDataChangeEvent.index- an optional index into an array data item- Returns:
- A model handle or array of model handles.
- Throws:
RemoteException- thrown for errors
-
getArrayRange
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:
getArrayRangein interfacePControllerBean- Parameters:
mh- a model handlespec- a field description- Returns:
- An integer array that contains the range of actual values.
- Throws:
RemoteException- thrown for all problems
-
getRemoteListenerHandle
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:
getRemoteListenerHandlein interfacePControllerBean- Parameters:
type- the type of listener to get- Returns:
- An object handle to identify the listener.
- Throws:
RemoteException- thrown for all problems
-
releaseRemoteListener
Removes all listener resources being used by the controller.- Specified by:
releaseRemoteListenerin interfacePControllerBean- Parameters:
remoteListenerHandle- an object handle as returned bygetRemoteListenerHandle()from another object- Throws:
RemoteException- thrown for all problems
-
addRemoteListener
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:
addRemoteListenerin interfacePControllerBean- Parameters:
remoteListenerHandle- an object handle as returned bygetRemoteListenerHandle()from another object- Throws:
RemoteException- thrown for all problems
-
removeRemoteListener
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:
removeRemoteListenerin interfacePControllerBean- Parameters:
remoteListenerHandle- an object handle as returned bygetRemoteListenerHandle()from another object- Throws:
RemoteException- thrown for all problems
-
register
Allows the lightweight component to register the controller stub it received when the controller was created.- Specified by:
registerin interfacePControllerBean- Parameters:
stub- the controller stub owned by the client view- Throws:
RemoteException- thrown in case of error- See Also:
-
getRemoteComponent
Gets a reference to the remote component (controller) for this object.- Returns:
- A
Remoteobject.
-
setModelFieldDescription
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
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
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
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
-