1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4 <title>API: container YAHOO.util.Config (YUI Library)
</title>
5 <link rel=
"stylesheet" type=
"text/css" href=
"assets/api.css">
9 <div id=
"doc3" class=
"yui-t2">
12 <h1>Yahoo! UI Library
</h1>
13 <h3>Container
<span class=
"subtitle">2.2.0</span></h3>
15 <a href=
"./index.html">Yahoo! UI Library
</a>
16 > <a href=
"./module_container.html">container
</a>
17 > YAHOO.util.Config
32 Class
<b>YAHOO.util.Config
</b>
33 <span class=
"extends">
36 <span class=
"extends">
41 <!-- class tree goes here -->
46 <div class=
"summary description">
47 Config is a utility used within an Object to allow the implementer to maintain a list of local configuration properties and listen for changes to those properties dynamically using CustomEvent. The initial values are also maintained so that the configuration can be reset at any given point to its initial state.
50 <div class=
"section constructor details">
51 <h3><a name=
"constructor_detail">Constructor
</a></h3>
54 <strong>YAHOO.util.Config
</strong>
63 <div class=
"description">
70 The owner Object to which this Config Object belongs
80 <div class=
"section field details">
81 <h3><a name=
"field_detail">Properties
</a></h3>
83 <h4><a name=
"config">config
</a>
84 <code>- private Object
</code>
87 <div class=
"description">
88 Maintains the local collection of configuration property objects and their specified values
96 <h4><a name=
"eventQueue">eventQueue
</a>
97 <code>- private Object
</code>
100 <div class=
"description">
101 Maintains the local, normalized CustomEvent queue
109 <h4><a name=
"initialConfig">initialConfig
</a>
110 <code>- private Object
</code>
113 <div class=
"description">
114 Maintains the local collection of configuration property objects as they were initially applied.
115 This object is used when resetting a property.
123 <h4><a name=
"owner">owner
</a>
124 <code>- Object
</code>
127 <div class=
"description">
128 Object reference to the owner of this Config Object
136 <h4><a name=
"queueInProgress">queueInProgress
</a>
137 <code>- Boolean
</code>
140 <div class=
"description">
141 Boolean flag that specifies whether a queue is currently being executed
155 <div class=
"section method details">
156 <h3><a name=
"methodDetails">Methods
</a></h3>
157 <div class=
"content">
159 <a name=
"addProperty">addProperty
</a></h4>
166 <strong>addProperty
</strong>
180 <div class=
"description">
181 Adds a property to the Config Object's private config hash.
184 <div class=
"description">
189 <code>key
<String
></code>
190 The configuration property's name
193 <code>propertyObject
<Object
></code>
194 The Object containing all of this property's arguments
211 <a name=
"applyConfig">applyConfig
</a></h4>
218 <strong>applyConfig
</strong>
232 <div class=
"description">
233 Applies a key-value Object literal to the configuration, replacing any existing values, and queueing the property events.
234 Although the values will be set, fireQueue() must be called for their associated events to execute.
237 <div class=
"description">
242 <code>userConfig
<Object
></code>
243 The configuration Object literal
246 <code>init
<Boolean
></code>
247 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.
264 <a name=
"checkBoolean">checkBoolean
</a></h4>
271 <strong>checkBoolean
</strong>
281 <div class=
"description">
282 Validates that the value passed in is a Boolean.
285 <div class=
"description">
290 <code>val
<Object
></code>
291 The value to validate
300 <dd>true, if the value is valid
</dd>
308 <a name=
"checkNumber">checkNumber
</a></h4>
315 <strong>checkNumber
</strong>
325 <div class=
"description">
326 Validates that the value passed in is a number.
329 <div class=
"description">
334 <code>val
<Object
></code>
335 The value to validate
344 <dd>true, if the value is valid
</dd>
352 <a name=
"fireEvent">fireEvent
</a></h4>
359 <strong>fireEvent
</strong>
373 <div class=
"description">
374 Fires a configuration property event using the specified value.
377 <div class=
"description">
382 <code>key
<String
></code>
383 The configuration property's name
386 <code>Object
<value
></code>
387 The value of the correct type for the property
404 <a name=
"fireQueue">fireQueue
</a></h4>
411 <strong>fireQueue
</strong>
416 <div class=
"description">
417 Fires the normalized list of queued property change events
420 <div class=
"description">
436 <a name=
"getConfig">getConfig
</a></h4>
443 <strong>getConfig
</strong>
448 <div class=
"description">
449 Returns a key-value configuration map of the values currently set in the Config Object.
452 <div class=
"description">
460 <dd>The current config, represented in a key-value map
</dd>
468 <a name=
"getProperty">getProperty
</a></h4>
475 <strong>getProperty
</strong>
485 <div class=
"description">
486 Returns the value of specified property.
489 <div class=
"description">
494 <code>key
<String
></code>
495 The name of the property
504 <dd>The value of the specified property
</dd>
512 <a name=
"init">init
</a></h4>
519 <strong>init
</strong>
529 <div class=
"description">
530 Initializes the configuration Object and all of its local members.
533 <div class=
"description">
538 <code>owner
<Object
></code>
539 The owner Object to which this Config Object belongs
556 <a name=
"outputEventQueue">outputEventQueue
</a></h4>
563 <strong>outputEventQueue
</strong>
568 <div class=
"description">
569 Returns a string representation of the Config object's current CustomEvent queue
572 <div class=
"description">
580 <dd>The string list of CustomEvents currently queued for execution
</dd>
588 <a name=
"queueProperty">queueProperty
</a></h4>
595 <strong>queueProperty
</strong>
609 <div class=
"description">
610 Sets the value of a property and queues its event to execute. If the event is already scheduled to execute, it is
611 moved from its current position to the end of the queue.
614 <div class=
"description">
619 <code>key
<String
></code>
620 The name of the property
623 <code>value
<String
></code>
624 The value to set the property to
633 <dd>true, if the set was successful, false if it failed.
</dd>
641 <a name=
"refireEvent">refireEvent
</a></h4>
648 <strong>refireEvent
</strong>
658 <div class=
"description">
659 Fires the event for a property using the property's current value.
662 <div class=
"description">
667 <code>key
<String
></code>
668 The name of the property
685 <a name=
"refresh">refresh
</a></h4>
692 <strong>refresh
</strong>
697 <div class=
"description">
698 Refires the events for all configuration properties using their current values.
701 <div class=
"description">
717 <a name=
"resetProperty">resetProperty
</a></h4>
724 <strong>resetProperty
</strong>
734 <div class=
"description">
735 Resets the specified property's value to its initial value.
738 <div class=
"description">
743 <code>key
<String
></code>
744 The name of the property
753 <dd>True is the property was reset, false if not
</dd>
761 <a name=
"setProperty">setProperty
</a></h4>
768 <strong>setProperty
</strong>
786 <div class=
"description">
787 Sets the value of a property. If the silent property is passed as true, the property's event will not be fired.
790 <div class=
"description">
795 <code>key
<String
></code>
796 The name of the property
799 <code>value
<String
></code>
800 The value to set the property to
803 <code>silent
<Boolean
></code>
804 Whether the value should be set silently, without firing the property event.
813 <dd>True, if the set was successful, false if it failed.
</dd>
821 <a name=
"subscribeToConfigEvent">subscribeToConfigEvent
</a></h4>
828 <strong>subscribeToConfigEvent
</strong>
850 <div class=
"description">
851 Subscribes an external handler to the change event for any given property.
854 <div class=
"description">
859 <code>key
<String
></code>
863 <code>handler
<Function
></code>
864 The handler function to use subscribe to the property's event
867 <code>obj
<Object
></code>
868 The Object to use for scoping the event handler (see CustomEvent documentation)
871 <code>override
<Boolean
></code>
872 Optional. If true, will override
"this" within the handler to map to the scope Object passed into the method.
881 <dd>True, if the subscription was successful, otherwise false.
</dd>
889 <a name=
"toString">toString
</a></h4>
896 <strong>toString
</strong>
901 <div class=
"description">
902 Returns a string representation of the Config object
905 <div class=
"description">
913 <dd>The Config object in string format.
</dd>
921 <a name=
"unsubscribeFromConfigEvent">unsubscribeFromConfigEvent
</a></h4>
928 <strong>unsubscribeFromConfigEvent
</strong>
946 <div class=
"description">
947 Unsubscribes an external handler from the change event for any given property.
950 <div class=
"description">
955 <code>key
<String
></code>
959 <code>handler
<Function
></code>
960 The handler function to use subscribe to the property's event
963 <code>obj
<Object
></code>
964 The Object to use for scoping the event handler (see CustomEvent documentation)
973 <dd>True, if the unsubscription was successful, otherwise false.
</dd>
981 <a name=
"YAHOO.util.Config.alreadySubscribed">YAHOO.util.Config.alreadySubscribed
</a></h4>
988 <strong>YAHOO.util.Config.alreadySubscribed
</strong>
1006 <div class=
"description">
1007 Checks to determine if a particular function/Object pair are already subscribed to the specified CustomEvent
1010 <div class=
"description">
1013 <dt>Parameters:
</dt>
1015 <code>evt
<YAHOO.util.CustomEvent
></code>
1016 The CustomEvent for which to check the subscriptions
1019 <code>fn
<Function
></code>
1020 The function to look for in the subscribers list
1023 <code>obj
<Object
></code>
1024 The execution scope Object for the subscription
1033 <dd>true, if the function/Object pair is already subscribed to the CustomEvent passed in
</dd>
1044 <div class=
"section method details">
1045 <h3><a name=
"methodDetails">Events
</a></h3>
1046 <div class=
"content">
1048 <a name=
"configChangedEvent">configChangedEvent
</a></h4>
1049 <div class=
"detail">
1054 <strong>configChangedEvent
</strong>
1061 <div class=
"description">
1062 Object reference to the owner of this Config Object
1065 <div class=
"description">
1086 <div class=
"module">
1088 <ul class=
"content">
1090 <li class=
""><a href=
"module_animation.html">animation
</a></li>
1092 <li class=
""><a href=
"module_autocomplete.html">autocomplete
</a></li>
1094 <li class=
""><a href=
"module_button.html">button
</a></li>
1096 <li class=
""><a href=
"module_calendar.html">calendar
</a></li>
1098 <li class=
""><a href=
"module_connection.html">connection
</a></li>
1100 <li class=
"selected"><a href=
"module_container.html">container
</a></li>
1102 <li class=
""><a href=
"module_datasource.html">datasource
</a></li>
1104 <li class=
""><a href=
"module_datatable.html">datatable
</a></li>
1106 <li class=
""><a href=
"module_dom.html">dom
</a></li>
1108 <li class=
""><a href=
"module_dragdrop.html">dragdrop
</a></li>
1110 <li class=
""><a href=
"module_element.html">element
</a></li>
1112 <li class=
""><a href=
"module_event.html">event
</a></li>
1114 <li class=
""><a href=
"module_history.html">history
</a></li>
1116 <li class=
""><a href=
"module_logger.html">logger
</a></li>
1118 <li class=
""><a href=
"module_menu.html">menu
</a></li>
1120 <li class=
""><a href=
"module_slider.html">slider
</a></li>
1122 <li class=
""><a href=
"module_tabview.html">tabview
</a></li>
1124 <li class=
""><a href=
"module_treeview.html">treeview
</a></li>
1126 <li class=
""><a href=
"module_yahoo.html">yahoo
</a></li>
1130 <div class=
"module">
1132 <ul class=
"content">
1133 <li class=
"selected"><a href=
"YAHOO.util.Config.html">YAHOO.util.Config
</a></li>
1134 <li class=
""><a href=
"YAHOO.util.KeyListener.html">YAHOO.util.KeyListener
</a></li>
1135 <li class=
""><a href=
"YAHOO.widget.ContainerEffect.html">YAHOO.widget.ContainerEffect
</a></li>
1136 <li class=
""><a href=
"YAHOO.widget.Dialog.html">YAHOO.widget.Dialog
</a></li>
1137 <li class=
""><a href=
"YAHOO.widget.Module.html">YAHOO.widget.Module
</a></li>
1138 <li class=
""><a href=
"YAHOO.widget.Overlay.html">YAHOO.widget.Overlay
</a></li>
1139 <li class=
""><a href=
"YAHOO.widget.OverlayManager.html">YAHOO.widget.OverlayManager
</a></li>
1140 <li class=
""><a href=
"YAHOO.widget.Panel.html">YAHOO.widget.Panel
</a></li>
1141 <li class=
""><a href=
"YAHOO.widget.SimpleDialog.html">YAHOO.widget.SimpleDialog
</a></li>
1142 <li class=
""><a href=
"YAHOO.widget.Tooltip.html">YAHOO.widget.Tooltip
</a></li>
1146 <div class=
"module">
1148 <ul class=
"content">
1149 <li class=
""><a href=
"Config.js.html">Config.js
</a></li>
1150 <li class=
""><a href=
"ContainerEffect.js.html">ContainerEffect.js
</a></li>
1151 <li class=
""><a href=
"Dialog.js.html">Dialog.js
</a></li>
1152 <li class=
""><a href=
"KeyListener.js.html">KeyListener.js
</a></li>
1153 <li class=
""><a href=
"Module.js.html">Module.js
</a></li>
1154 <li class=
""><a href=
"Overlay.js.html">Overlay.js
</a></li>
1155 <li class=
""><a href=
"OverlayManager.js.html">OverlayManager.js
</a></li>
1156 <li class=
""><a href=
"Panel.js.html">Panel.js
</a></li>
1157 <li class=
""><a href=
"SimpleDialog.js.html">SimpleDialog.js
</a></li>
1158 <li class=
""><a href=
"Tooltip.js.html">Tooltip.js
</a></li>
1162 <div class=
"module">
1164 <ul class=
"content">
1165 <li><a href=
"#config">config
</a>
1166 <!--<code><Boolean></code>-->
1168 <li><a href=
"#eventQueue">eventQueue
</a>
1169 <!--<code><Boolean></code>-->
1171 <li><a href=
"#initialConfig">initialConfig
</a>
1172 <!--<code><Boolean></code>-->
1174 <li><a href=
"#owner">owner
</a>
1175 <!--<code><Boolean></code>-->
1177 <li><a href=
"#queueInProgress">queueInProgress
</a>
1178 <!--<code><Boolean></code>-->
1183 <div class=
"module">
1185 <ul class=
"content">
1186 <li><!--<code>void</code>-->
1187 <a href=
"#addProperty">addProperty
</a>
1189 <li><!--<code>void</code>-->
1190 <a href=
"#applyConfig">applyConfig
</a>
1192 <li><!--<code>Boolean</code>-->
1193 <a href=
"#checkBoolean">checkBoolean
</a>
1195 <li><!--<code>Boolean</code>-->
1196 <a href=
"#checkNumber">checkNumber
</a>
1198 <li><!--<code>void</code>-->
1199 <a href=
"#fireEvent">fireEvent
</a>
1201 <li><!--<code>void</code>-->
1202 <a href=
"#fireQueue">fireQueue
</a>
1204 <li><!--<code>Object</code>-->
1205 <a href=
"#getConfig">getConfig
</a>
1207 <li><!--<code>Object</code>-->
1208 <a href=
"#getProperty">getProperty
</a>
1210 <li><!--<code>void</code>-->
1211 <a href=
"#init">init
</a>
1213 <li><!--<code>String</code>-->
1214 <a href=
"#outputEventQueue">outputEventQueue
</a>
1216 <li><!--<code>Boolean</code>-->
1217 <a href=
"#queueProperty">queueProperty
</a>
1219 <li><!--<code>void</code>-->
1220 <a href=
"#refireEvent">refireEvent
</a>
1222 <li><!--<code>void</code>-->
1223 <a href=
"#refresh">refresh
</a>
1225 <li><!--<code>Boolean</code>-->
1226 <a href=
"#resetProperty">resetProperty
</a>
1228 <li><!--<code>Boolean</code>-->
1229 <a href=
"#setProperty">setProperty
</a>
1231 <li><!--<code>Boolean</code>-->
1232 <a href=
"#subscribeToConfigEvent">subscribeToConfigEvent
</a>
1234 <li><!--<code>String</code>-->
1235 <a href=
"#toString">toString
</a>
1237 <li><!--<code>Boolean</code>-->
1238 <a href=
"#unsubscribeFromConfigEvent">unsubscribeFromConfigEvent
</a>
1240 <li><!--<code>Boolean</code>-->
1241 <a href=
"#YAHOO.util.Config.alreadySubscribed">YAHOO.util.Config.alreadySubscribed
</a>
1246 <div class=
"module">
1248 <ul class=
"content">
1250 <a href=
"#configChangedEvent">configChangedEvent
</a>
1261 Copyright
© 2007 Yahoo! Inc. All rights reserved.