Constructor
new module:br/presenter/property/Properties(pProperties)
Constructs a new
Properties instance containing the given list
of module:br/presenter/property/Property objects.
Parameters:
| Name | Type | Description |
|---|---|---|
pProperties |
Array | (optional) The initial set of properties. |
Methods
-
add(vProperties)
-
Add the given properties to this collection. The single argument passed to
add()can be any of the following types:- A single
module:br/presenter/property/Propertyinstance. - An array of
module:br/presenter/property/Propertyinstances. - Another
Propertiesobject.
Parameters:
Name Type Description vPropertiesObject The new properties to add. - A single
-
addChangeListener(oListener, sMethod, bNotifyImmediately)
-
Convenience method that allows a change listener to be added to added for objects that do not themselves implement
module:br/presenter/property/PropertyListener.Listeners added using
addChangeListener()will only be notified whenmodule:br/presenter/property/PropertyListener#onPropertyChangedfires, and will not be notified if any of the othermodule:br/presenter/property/PropertyListenercall-backs fire. The advantage to using this method is that objects can choose to listen to call-back events on multiple properties.Parameters:
Name Type Description oListenerObject The listener to be added. sMethodString The name of the method on the listener that will be invoked each time the property changes. bNotifyImmediatelyboolean (optional) Whether to invoke the listener immediately for the current value. -
addListener()
-
Add a listener to all properties
-
addUpdateListener(oListener, sMethod, bNotifyImmediately)
-
Convenience method that allows an update listener to be added to added for objects that do not themselves implement
module:br/presenter/property/PropertyListener.Listeners added using
addUpdateListener()will only be notified whenmodule:br/presenter/property/PropertyListener#onPropertyUpdatedfires, and will not be notified if any of the othermodule:br/presenter/property/PropertyListenercall-backs fire. The advantage to using this method is that objects can choose to listen to call-back events on multiple properties.Parameters:
Name Type Description oListenerObject The listener to be added. sMethodString The name of the method on the listener that will be invoked each time the property changes. bNotifyImmediatelyboolean (optional) Whether to invoke the listener immediately for the current value. -
getSize()
-
Returns the size of the collection.
-
removeAllListeners()
-
Removes all the listeners attached to the properties.
-
setValue(vValue)
-
Invoke
setValue()on all writable properties within the collection.Parameters:
Name Type Description vValueObject The value that all property instances will be set to. -
snapshot()
-
Returns a snapshot of the current collection that can be restored at a later date.