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 TypeMethodDescriptionvoid
addRemoteListener
(Object remoteListenerHandle) If the controller can send events to other controllers, this method is called to pass a handle to the remote listener class.void
collectData
(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.boolean
isLight()
Determines whether this is a lightweight component.void
register
(PControllerBean stub) Allows the lightweight component to register the controller stub it received when the controller was created.void
releaseRemoteListener
(Object remoteListenerHandle) Removes all listener resources being used by the controller.void
removeRemoteListener
(Object remoteListenerHandle) If the controller can send events to other controllers, this method is called to pass a handle to the remote listener class.void
Sets the output data description property of the component.void
setLightData
(Object field) Sets the lightweight data object.void
setModel
(PModelHandle model) Passes the model to the controller.void
Sets the input data description property of the component.void
Allows 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:
getDataDescriptor
in interfacePLightComponent
- Returns:
- A
String
data description.
-
getLightData
Gets the lightweight data object itself.- Specified by:
getLightData
in interfacePLightComponent
- Returns:
- A field
Object
that represents a component's display data.
-
setLightData
Sets the lightweight data object.- Specified by:
setLightData
in 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:
collectData
in interfacePCollectDataListener
- Parameters:
event
- the data collection event
-
setModel
Passes the model to the controller.- Specified by:
setModel
in interfacePControllerBean
- Parameters:
model
- the new data model- Throws:
RemoteException
- thrown for errors
-
getModel
Accesses the data model.- Specified by:
getModel
in 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 thegetModelHandle
method will always return null, thesetModelHandle
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 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:
getSelectionDataFor
in 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:
getArrayRange
in 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:
getRemoteListenerHandle
in 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:
releaseRemoteListener
in 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:
addRemoteListener
in 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:
removeRemoteListener
in 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:
register
in 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
Remote
object.
-
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
-