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/Property
instance. - An array of
module:br-presenter/property/Property
instances. - Another
Properties
object.
Parameters:
Name | Type | Description |
---|---|---|
vProperties |
Object | The new properties to add. |
add Change Listener(fCallback, bNotify Immediately)
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
when module:br-presenter/property/PropertyListener#onPropertyChanged
fires, and
will not be notified if any of the other
module:br-presenter/property/PropertyListener
call-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 |
---|---|---|
fCallback |
function | The call-back that will be invoked each time the property changes. |
bNotifyImmediately |
boolean | (optional) Whether to invoke the listener immediately for the current value. |
add Listener()
Add a listener to all properties
add Update Listener(fCallback, bNotify Immediately)
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
when module:br-presenter/property/PropertyListener#onPropertyUpdated
fires, and
will not be notified if any of the other
module:br-presenter/property/PropertyListener
call-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 |
---|---|---|
fCallback |
function | The call-back that will be invoked each time the property is updated. |
bNotifyImmediately |
boolean | (optional) Whether to invoke the listener immediately for the current value. |
get Properties()
Returns array of properties in the collection.
get Size()
Returns the size of the collection.
remove All Listeners()
Removes all the listeners attached to the properties.
set Value(vValue)
Invoke setValue()
on all writable properties within the collection.
Parameters:
Name | Type | Description |
---|---|---|
vValue |
Object | 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.