webgui/www/extras/yui/docs/container/YAHOO.util.Config.html
JT Smith 4f68a0933c added YUI and YUI-ext
fixed the resizable text area with IE problem
fixed the ad space with IE problem
merged the 7.2.0 and 7.1.4 change logs
2006-11-07 23:15:57 +00:00

1219 lines
29 KiB
HTML

<html>
<head>
<title>JavaScript Documentation - </title>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
<h1>JavaScript Documentation</h1>
<h3><a href="./index.html">Yahoo! UI Library: Container</a></h3>
<div class="breadcrumbs">
<a href="./index.html">Yahoo! UI Library: Container</a>
&gt;
<strong>YAHOO.util.Config</strong>
</div>
</div>
<div id="body">
<div class="nav">
<div class="module resources">
<ul class="content">
<li><a href="overview-tree.html">Tree View</a></li>
<li><a href="index-all.html">Element Index</a></li>
</ul>
</div>
<div class="module">
<h4><a href="./allclasses-noframe.html">Classes</a></h4>
<ul class="content">
<li>
<a href="YAHOO.util.Config.html">
YAHOO.util.Config</a>
</li>
<li>
<a href="YAHOO.util.KeyListener.html">
YAHOO.util.KeyListener</a>
</li>
<li>
<a href="YAHOO.widget.ContainerEffect.html">
YAHOO.widget.ContainerEffect</a>
</li>
<li>
<a href="YAHOO.widget.Dialog.html">
YAHOO.widget.Dialog</a>
</li>
<li>
<a href="YAHOO.widget.Module.html">
YAHOO.widget.Module</a>
</li>
<li>
<a href="YAHOO.widget.Overlay.html">
YAHOO.widget.Overlay</a>
</li>
<li>
<a href="YAHOO.widget.OverlayManager.html">
YAHOO.widget.OverlayManager</a>
</li>
<li>
<a href="YAHOO.widget.Panel.html">
YAHOO.widget.Panel</a>
</li>
<li>
<a href="YAHOO.widget.SimpleDialog.html">
YAHOO.widget.SimpleDialog</a>
</li>
<li>
<a href="YAHOO.widget.Tooltip.html">
YAHOO.widget.Tooltip</a>
</li>
</ul>
</div>
<div class="module">
<h4><a href="./overview-summary.html">Files</a></h4>
<ul class="content">
<li>
<a href="overview-summary-Config.js.html">
Config.js</a>
</li>
<li>
<a href="overview-summary-ContainerEffect.js.html">
ContainerEffect.js</a>
</li>
<li>
<a href="overview-summary-Dialog.js.html">
Dialog.js</a>
</li>
<li>
<a href="overview-summary-KeyListener.js.html">
KeyListener.js</a>
</li>
<li>
<a href="overview-summary-Module.js.html">
Module.js</a>
</li>
<li>
<a href="overview-summary-Overlay.js.html">
Overlay.js</a>
</li>
<li>
<a href="overview-summary-OverlayManager.js.html">
OverlayManager.js</a>
</li>
<li>
<a href="overview-summary-Panel.js.html">
Panel.js</a>
</li>
<li>
<a href="overview-summary-SimpleDialog.js.html">
SimpleDialog.js</a>
</li>
<li>
<a href="overview-summary-Tooltip.js.html">
Tooltip.js</a>
</li>
</ul>
</div>
</div>
<div id="pri">
<div class="main">
<h2>Class YAHOO.util.Config</h2>
<pre>Object
|
+--<b>YAHOO.util.Config</b>
</pre>
<hr />
<!-- Class definition -->
<div class="class-def">
<div class="class-name">
<span class="class-attribs">
</span>
<span class="class-type">class</span>
<b>YAHOO.util.Config</b>
</div>
<div class="class-extends">
</div>
</div>
<div class="meta">
</div>
<!-- ======== QUICK LINKS ======== -->
<div class="quick-links">
<strong>Quick Links:</strong>&nbsp;
<a href="#field_summary">Field Summary</a>
|
<a href="#constructor_summary">Constructor Summary</a>
|
<a href="#methodSummary">Method Summary</a> |
<a href="#methodDetails">Method Details</a>
</div>
<!-- ======== END QUICK LINKS ======== -->
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- ======== END NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<div class="section field summaries">
<h3><a name="field_summary">Field Summary</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<td class="flags">YAHOO.util.CustomEvent</td>
<td class="spec">
<code>
<a href="#configChangedEvent">configChangedEvent</a>
</code>
<div class="description">
Object reference to the owner of this Config object
YAHOO.util.Config.prototype.args = key; value&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">object</td>
<td class="spec">
<code>
<a href="#owner">owner</a>
</code>
<div class="description">
Object reference to the owner of this Config object&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">boolean</td>
<td class="spec">
<code>
<a href="#queueInProgress">queueInProgress</a>
</code>
<div class="description">
Boolean flag that specifies whether a queue is currently being executed&nbsp;
</div>
</td>
</tr>
</table>
</div>
</div>
<!-- =========== END FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<div class="section contructor summaries">
<h3><a name="constructor_summary">Constructor Summary</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<code class="spec">
<a href="YAHOO.util.Config.html#YAHOO.util.Config()">YAHOO.util.Config</a>
</code>
<div class="description">
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.&nbsp;
</div>
</div>
</div>
<!-- ======== END CONSTRUCTOR SUMMARY ======== -->
<!-- ========== METHOD SUMMARY =========== -->
<div class="section method summaries">
<h3><a name="methodSummary">Method Summary</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#addProperty">addProperty</a>
(&lt;string&gt; key, &lt;object&gt; propertyObject)
</code>
<div class="description">
Adds a property to the Config object's private config hash.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#applyConfig">applyConfig</a>
(&lt;object&gt; userConfig,&lt;boolean&gt; init)
</code>
<div class="description">
Applies a key-value object literal to the configuration, replacing any existing values, and queueing the property events.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">boolean</td>
<td class="spec">
<code>
<a href="#checkBoolean">checkBoolean</a>
(&lt;object&gt; val)
</code>
<div class="description">
Validates that the value passed in is a boolean.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">boolean</td>
<td class="spec">
<code>
<a href="#checkNumber">checkNumber</a>
(&lt;object&gt; val)
</code>
<div class="description">
Validates that the value passed in is a number.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#fireQueue">fireQueue</a>
()
</code>
<div class="description">
Fires the normalized list of queued property change events&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">object</td>
<td class="spec">
<code>
<a href="#getConfig">getConfig</a>
()
</code>
<div class="description">
Returns a key-value configuration map of the values currently set in the Config object.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">object</td>
<td class="spec">
<code>
<a href="#getProperty">getProperty</a>
(key)
</code>
<div class="description">
Returns the value of specified property.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#init">init</a>
(&lt;object&gt; owner)
</code>
<div class="description">
Initializes the configuration object and all of its local members.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">boolean</td>
<td class="spec">
<code>
<a href="#queueProperty">queueProperty</a>
(key,value)
</code>
<div class="description">
Sets the value of a property and queues its event to execute.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#refireEvent">refireEvent</a>
(key)
</code>
<div class="description">
Fires the event for a property using the property's current value.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#refresh">refresh</a>
()
</code>
<div class="description">
Refires the events for all configuration properties using their current values.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#resetProperty">resetProperty</a>
(key)
</code>
<div class="description">
Resets the specified property's value to its initial value.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">boolean</td>
<td class="spec">
<code>
<a href="#setProperty">setProperty</a>
(key,value,silent)
</code>
<div class="description">
Sets the value of a property.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#subscribeToConfigEvent">subscribeToConfigEvent</a>
(&lt;string&gt; key,&lt;Function&gt; handler,&lt;object&gt; obj,&lt;boolean&gt; override)
</code>
<div class="description">
Subscribes an external handler to the change event for any given property.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#unsubscribeFromConfigEvent">unsubscribeFromConfigEvent</a>
(&lt;string&gt; key,&lt;Function&gt; handler,&lt;object&gt; obj)
</code>
<div class="description">
Unsubscribes an external handler from the change event for any given property.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">boolean</td>
<td class="spec">
<code>
<a href="#alreadySubscribed">alreadySubscribed</a>
(&lt;YAHOO.util.CustomEvent&gt; evt, &lt;Function&gt; fn, &lt;object&gt; obj)
</code>
<div class="description">
Checks to determine if a particular function/object pair are already subscribed to the specified CustomEvent&nbsp;
</div>
</td>
</tr>
</table>
</div>
</div>
<!-- ========== END METHOD SUMMARY =========== -->
<!-- ============ FIELD DETAIL START =========== -->
<div class="section field details">
<h3><a name="field_detail">Field Detail</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<h4><a name="configChangedEvent">configChangedEvent</a></h4>
<div class="detail">
<code>
YAHOO.util.CustomEvent
&nbsp;
<strong>configChangedEvent</strong>
</code>
<div class="description">
Object reference to the owner of this Config object
YAHOO.util.Config.prototype.args = key; value
</div>
</div>
<hr />
<h4><a name="owner">owner</a></h4>
<div class="detail">
<code>
object
&nbsp;
<strong>owner</strong>
</code>
<div class="description">
Object reference to the owner of this Config object
</div>
</div>
<hr />
<h4><a name="queueInProgress">queueInProgress</a></h4>
<div class="detail">
<code>
boolean
&nbsp;
<strong>queueInProgress</strong>
</code>
<div class="description">
Boolean flag that specifies whether a queue is currently being executed
</div>
</div>
<hr />
</div>
</div>
<!-- ============ FIELD DETAIL END =========== -->
<!-- ========= CONSTRUCTOR DETAIL START ======== -->
<div class="section constructor details">
<h3><a name="constructor_detail">Constructor Detail</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<h4><a name="YAHOO.util.Config()">YAHOO.util.Config</a></h4>
<div class="detail">
<code>
<strong>YAHOO.util.Config</strong>
()
</code>
<div class="description">
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.
<dl>
<dt>Parameters:</dt>
<dd>
<code>owner</code> -
The owner object to which this Config object belongs
</dd>
</dl>
HASH(0x1db8014)
</div>
</div>
</div>
</div>
<!-- ========= CONSTRUCTOR DETAIL END ======== -->
<!-- ============ METHOD DETAIL START ========== -->
<div class="section method details">
<h3><a name="methodDetails">Method Detail</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<h4><a name="addProperty">addProperty</a></h4>
<div class="detail">
<code>
void
<strong>addProperty</strong>
(&lt;string&gt; key, &lt;object&gt; propertyObject)
</code>
<div class="description">
Adds a property to the Config object's private config hash.
<dl>
<dt>Parameters:</dt>
<dd>
<code>key</code> -
The configuration property's name
</dd>
<dd>
<code>propertyObject</code> -
The object containing all of this property's arguments
</dd>
</dl>
HASH(0x1d03e64)
</div>
</div>
<hr />
<h4><a name="applyConfig">applyConfig</a></h4>
<div class="detail">
<code>
void
<strong>applyConfig</strong>
(&lt;object&gt; userConfig,&lt;boolean&gt; init)
</code>
<div class="description">
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.
<dl>
<dt>Parameters:</dt>
<dd>
<code>userConfig</code> -
The configuration object literal
</dd>
<dd>
<code>init</code> -
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.
</dd>
</dl>
HASH(0x1d042e4)
</div>
</div>
<hr />
<h4><a name="checkBoolean">checkBoolean</a></h4>
<div class="detail">
<code>
boolean
<strong>checkBoolean</strong>
(&lt;object&gt; val)
</code>
<div class="description">
Validates that the value passed in is a boolean.
<dl>
<dt>Parameters:</dt>
<dd>
<code>val</code> -
The value to validate
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd> true, if the value is valid</dd>
</dl>
HASH(0x1d044d0)
</div>
</div>
<hr />
<h4><a name="checkNumber">checkNumber</a></h4>
<div class="detail">
<code>
boolean
<strong>checkNumber</strong>
(&lt;object&gt; val)
</code>
<div class="description">
Validates that the value passed in is a number.
<dl>
<dt>Parameters:</dt>
<dd>
<code>val</code> -
The value to validate
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd> true, if the value is valid</dd>
</dl>
HASH(0x1d04764)
</div>
</div>
<hr />
<h4><a name="fireQueue">fireQueue</a></h4>
<div class="detail">
<code>
void
<strong>fireQueue</strong>
()
</code>
<div class="description">
Fires the normalized list of queued property change events
HASH(0x1d0734c)
</div>
</div>
<hr />
<h4><a name="getConfig">getConfig</a></h4>
<div class="detail">
<code>
object
<strong>getConfig</strong>
()
</code>
<div class="description">
Returns a key-value configuration map of the values currently set in the Config object.
<dl>
<dt>Returns:</dt>
<dd> The current config, represented in a key-value map</dd>
</dl>
HASH(0x1d076a0)
</div>
</div>
<hr />
<h4><a name="getProperty">getProperty</a></h4>
<div class="detail">
<code>
object
<strong>getProperty</strong>
(key)
</code>
<div class="description">
Returns the value of specified property.
<dl>
<dt>Parameters:</dt>
<dd>
<code>The</code> -
name of the property
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd> The value of the specified property</dd>
</dl>
HASH(0x1d4d32c)
</div>
</div>
<hr />
<h4><a name="init">init</a></h4>
<div class="detail">
<code>
void
<strong>init</strong>
(&lt;object&gt; owner)
</code>
<div class="description">
Initializes the configuration object and all of its local members.
<dl>
<dt>Parameters:</dt>
<dd>
<code>owner</code> -
The owner object to which this Config object belongs
</dd>
</dl>
HASH(0x1d4d5c0)
</div>
</div>
<hr />
<h4><a name="queueProperty">queueProperty</a></h4>
<div class="detail">
<code>
boolean
<strong>queueProperty</strong>
(key,value)
</code>
<div class="description">
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.
<dl>
<dt>Parameters:</dt>
<dd>
<code>The</code> -
name of the property
</dd>
<dd>
<code>The</code> -
value to set the property to
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd> true, if the set was successful, false if it failed.</dd>
</dl>
HASH(0x1d4d7a0)
</div>
</div>
<hr />
<h4><a name="refireEvent">refireEvent</a></h4>
<div class="detail">
<code>
void
<strong>refireEvent</strong>
(key)
</code>
<div class="description">
Fires the event for a property using the property's current value.
<dl>
<dt>Parameters:</dt>
<dd>
<code>The</code> -
name of the property
</dd>
</dl>
HASH(0x1d4d944)
</div>
</div>
<hr />
<h4><a name="refresh">refresh</a></h4>
<div class="detail">
<code>
void
<strong>refresh</strong>
()
</code>
<div class="description">
Refires the events for all configuration properties using their current values.
HASH(0x1dc6bb0)
</div>
</div>
<hr />
<h4><a name="resetProperty">resetProperty</a></h4>
<div class="detail">
<code>
void
<strong>resetProperty</strong>
(key)
</code>
<div class="description">
Resets the specified property's value to its initial value.
<dl>
<dt>Parameters:</dt>
<dd>
<code>The</code> -
name of the property
</dd>
</dl>
HASH(0x1dc6d84)
</div>
</div>
<hr />
<h4><a name="setProperty">setProperty</a></h4>
<div class="detail">
<code>
boolean
<strong>setProperty</strong>
(key,value,silent)
</code>
<div class="description">
Sets the value of a property. If the silent property is passed as true, the property's event will not be fired.
<dl>
<dt>Parameters:</dt>
<dd>
<code>The</code> -
name of the property
</dd>
<dd>
<code>The</code> -
value to set the property to
</dd>
<dd>
<code>Whether</code> -
the value should be set silently, without firing the property event.
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd> true, if the set was successful, false if it failed.</dd>
</dl>
HASH(0x1dc70cc)
</div>
</div>
<hr />
<h4><a name="subscribeToConfigEvent">subscribeToConfigEvent</a></h4>
<div class="detail">
<code>
void
<strong>subscribeToConfigEvent</strong>
(&lt;string&gt; key,&lt;Function&gt; handler,&lt;object&gt; obj,&lt;boolean&gt; override)
</code>
<div class="description">
Subscribes an external handler to the change event for any given property.
<dl>
<dt>Parameters:</dt>
<dd>
<code>key</code> -
The property name
</dd>
<dd>
<code>handler</code> -
The handler function to use subscribe to the property's event
</dd>
<dd>
<code>obj</code> -
The object to use for scoping the event handler (see CustomEvent documentation)
</dd>
<dd>
<code>override</code> -
Optional. If true, will override "this" within the handler to map to the scope object passed into the method.
</dd>
</dl>
HASH(0x1d5af38)
</div>
</div>
<hr />
<h4><a name="unsubscribeFromConfigEvent">unsubscribeFromConfigEvent</a></h4>
<div class="detail">
<code>
void
<strong>unsubscribeFromConfigEvent</strong>
(&lt;string&gt; key,&lt;Function&gt; handler,&lt;object&gt; obj)
</code>
<div class="description">
Unsubscribes an external handler from the change event for any given property.
<dl>
<dt>Parameters:</dt>
<dd>
<code>key</code> -
The property name
</dd>
<dd>
<code>handler</code> -
The handler function to use subscribe to the property's event
</dd>
<dd>
<code>obj</code> -
The object to use for scoping the event handler (see CustomEvent documentation)
</dd>
</dl>
HASH(0x1d5b358)
</div>
</div>
<hr />
<h4><a name="alreadySubscribed">alreadySubscribed</a></h4>
<div class="detail">
<code>
boolean
<strong>alreadySubscribed</strong>
(&lt;YAHOO.util.CustomEvent&gt; evt, &lt;Function&gt; fn, &lt;object&gt; obj)
</code>
<div class="description">
Checks to determine if a particular function/object pair are already subscribed to the specified CustomEvent
<dl>
<dt>Parameters:</dt>
<dd>
<code>evt</code> -
The CustomEvent for which to check the subscriptions
</dd>
<dd>
<code>fn</code> -
The function to look for in the subscribers list
</dd>
<dd>
<code>obj</code> -
The execution scope object for the subscription
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd> true, if the function/object pair is already subscribed to the CustomEvent passed in</dd>
</dl>
HASH(0x1d4554c)
</div>
</div>
<hr />
</div>
</div>
<!-- ============ METHOD DETAIL END ========== -->
</div>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<div id="footer">
<hr />
Copyright &copy; 2006 Yahoo! Inc. All rights reserved.
<br /><br />
Documentation generated by <a href="http://jsdoc.sourceforge.net/">
JSDoc</a>
</div>
</body>
</html>