YAHOO.util.CustomEvent |
configChangedEvent
Object reference to the owner of this Config object
YAHOO.util.Config.prototype.args = key; value
|
object |
owner
Object reference to the owner of this Config object
|
boolean |
queueInProgress
Boolean flag that specifies whether a queue is currently being executed
|
Class YAHOO.util.Config
Object | +--YAHOO.util.Config
class
YAHOO.util.Config
Field Summary [top]
Constructor Summary [top]
YAHOO.util.Config
Copyright (c) 2006, Yahoo!
Method Summary [top]
void |
addProperty
(<string> key, <object> propertyObject)
Adds a property to the Config object's private config hash.
|
void |
applyConfig
(<object> userConfig,<boolean> init)
Applies a key-value object literal to the configuration, replacing any existing values, and queueing the property events.
|
boolean |
checkBoolean
(<object> val)
Validates that the value passed in is a boolean.
|
boolean |
checkNumber
(<object> val)
Validates that the value passed in is a number.
|
void |
fireQueue
()
Fires the normalized list of queued property change events
|
object |
getConfig
()
Returns a key-value configuration map of the values currently set in the Config object.
|
object |
getProperty
(key)
Returns the value of specified property.
|
void |
init
(<object> owner)
Initializes the configuration object and all of its local members.
|
boolean |
queueProperty
(key,value)
Sets the value of a property and queues its event to execute.
|
void |
refireEvent
(key)
Fires the event for a property using the property's current value.
|
void |
refresh
()
Refires the events for all configuration properties using their current values.
|
void |
resetProperty
(key)
Resets the specified property's value to its initial value.
|
boolean |
setProperty
(key,value,silent)
Sets the value of a property.
|
void |
subscribeToConfigEvent
(<string> key,<Function> handler,<object> obj,<boolean> override)
Subscribes an external handler to the change event for any given property.
|
void |
unsubscribeFromConfigEvent
(<string> key,<Function> handler,<object> obj)
Unsubscribes an external handler from the change event for any given property.
|
boolean |
alreadySubscribed
(<YAHOO.util.CustomEvent> evt, <Function> fn, <object> obj)
Checks to determine if a particular function/object pair are already subscribed to the specified CustomEvent
|
Field Detail [top]
configChangedEvent
YAHOO.util.CustomEvent
configChangedEvent
Object reference to the owner of this Config object
YAHOO.util.Config.prototype.args = key; value
owner
object
owner
Object reference to the owner of this Config object
queueInProgress
boolean
queueInProgress
Boolean flag that specifies whether a queue is currently being executed
Constructor Detail [top]
YAHOO.util.Config
YAHOO.util.Config
()
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
- Parameters:
-
owner
- The owner object to which this Config object belongs
Method Detail [top]
addProperty
void
addProperty
(<string> key, <object> propertyObject)
Adds a property to the Config object's private config hash.
- Parameters:
-
key
- The configuration property's name -
propertyObject
- The object containing all of this property's arguments
applyConfig
void
applyConfig
(<object> userConfig,<boolean> init)
Applies a key-value object literal to the configuration, replacing any existing values, and queueing the property events.
Although the values will be set, fireQueue() must be called for their associated events to execute.
- Parameters:
-
userConfig
- The configuration object literal -
init
- When set to true, the initialConfig will be set to the userConfig passed in, so that calling a reset will reset the properties to the passed values.
checkBoolean
boolean
checkBoolean
(<object> val)
Validates that the value passed in is a boolean.
- Parameters:
-
val
- The value to validate
- Returns:
- true, if the value is valid
checkNumber
boolean
checkNumber
(<object> val)
Validates that the value passed in is a number.
- Parameters:
-
val
- The value to validate
- Returns:
- true, if the value is valid
fireQueue
void
fireQueue
()
Fires the normalized list of queued property change events
HASH(0x1d24684)
getConfig
object
getConfig
()
Returns a key-value configuration map of the values currently set in the Config object.
- Returns:
- The current config, represented in a key-value map
getProperty
object
getProperty
(key)
Returns the value of specified property.
- Parameters:
-
The
- name of the property
- Returns:
- The value of the specified property
init
void
init
(<object> owner)
Initializes the configuration object and all of its local members.
- Parameters:
-
owner
- The owner object to which this Config object belongs
queueProperty
boolean
queueProperty
(key,value)
Sets the value of a property and queues its event to execute. If the event is already scheduled to execute, it is
moved from its current position to the end of the queue.
- Parameters:
-
The
- name of the property -
The
- value to set the property to
- Returns:
- true, if the set was successful, false if it failed.
refireEvent
void
refireEvent
(key)
Fires the event for a property using the property's current value.
- Parameters:
-
The
- name of the property
refresh
void
refresh
()
Refires the events for all configuration properties using their current values.
HASH(0x1d3f9dc)
resetProperty
void
resetProperty
(key)
Resets the specified property's value to its initial value.
- Parameters:
-
The
- name of the property
setProperty
boolean
setProperty
(key,value,silent)
Sets the value of a property. If the silent property is passed as true, the property's event will not be fired.
- Parameters:
-
The
- name of the property -
The
- value to set the property to -
Whether
- the value should be set silently, without firing the property event.
- Returns:
- true, if the set was successful, false if it failed.
subscribeToConfigEvent
void
subscribeToConfigEvent
(<string> key,<Function> handler,<object> obj,<boolean> override)
Subscribes an external handler to the change event for any given property.
- Parameters:
-
key
- The property name -
handler
- The handler function to use subscribe to the property's event -
obj
- The object to use for scoping the event handler (see CustomEvent documentation) -
override
- Optional. If true, will override "this" within the handler to map to the scope object passed into the method.
unsubscribeFromConfigEvent
void
unsubscribeFromConfigEvent
(<string> key,<Function> handler,<object> obj)
Unsubscribes an external handler from the change event for any given property.
- Parameters:
-
key
- The property name -
handler
- The handler function to use subscribe to the property's event -
obj
- The object to use for scoping the event handler (see CustomEvent documentation)
alreadySubscribed
boolean
alreadySubscribed
(<YAHOO.util.CustomEvent> evt, <Function> fn, <object> obj)
Checks to determine if a particular function/object pair are already subscribed to the specified CustomEvent
- Parameters:
-
evt
- The CustomEvent for which to check the subscriptions -
fn
- The function to look for in the subscribers list -
obj
- The execution scope object for the subscription
- Returns:
- true, if the function/object pair is already subscribed to the CustomEvent passed in