X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/7a654f8d43fdb43d78b63d90528bed6e86b608cc..refs/heads/master:/docs/source/AbstractManager.html diff --git a/docs/source/AbstractManager.html b/docs/source/AbstractManager.html index 16cda9bb..43d119cc 100644 --- a/docs/source/AbstractManager.html +++ b/docs/source/AbstractManager.html @@ -1,10 +1,23 @@ -
+ +/** - * @class Ext.AbstractManager - * @extends Object - * @ignore - * Base Manager class + + + + +\ No newline at end of file +The source code + + + + + + +/** + * Base Manager class */ - Ext.define('Ext.AbstractManager', { /* Begin Definitions */ @@ -19,9 +32,8 @@ Ext.define('Ext.AbstractManager', { Ext.apply(this, config || {}); /** - * Contains all of the items currently managed - * @property all - * @type Ext.util.MixedCollection + * @property {Ext.util.HashMap} all + * Contains all of the items currently managed */ this.all = Ext.create('Ext.util.HashMap'); @@ -32,7 +44,7 @@ Ext.define('Ext.AbstractManager', { * Returns an item by id. * For additional details see {@link Ext.util.HashMap#get}. * @param {String} id The id of the item - * @return {Mixed} The item, <code>undefined</code> if not found. + * @return {Object} The item, undefined if not found. */ get : function(id) { return this.all.get(id); @@ -40,24 +52,32 @@ Ext.define('Ext.AbstractManager', { /** * Registers an item to be managed - * @param {Mixed} item The item to register + * @param {Object} item The item to register */ register: function(item) { + //<debug> + var all = this.all, + key = all.getKey(item); + + if (all.containsKey(key)) { + Ext.Error.raise('Registering duplicate id "' + key + '" with this manager'); + } + //</debug> this.all.add(item); }, /** * Unregisters an item by removing it from this manager - * @param {Mixed} item The item to unregister + * @param {Object} item The item to unregister */ unregister: function(item) { this.all.remove(item); }, /** - * <p>Registers a new item constructor, keyed by a type key. + * Registers a new item constructor, keyed by a type key. * @param {String} type The mnemonic string by which the class may be looked up. - * @param {Constructor} cls The new instance class. + * @param {Function} cls The new instance class. */ registerType : function(type, cls) { this.types[type] = cls; @@ -74,17 +94,18 @@ Ext.define('Ext.AbstractManager', { }, /** - * Creates and returns an instance of whatever this manager manages, based on the supplied type and config object + * Creates and returns an instance of whatever this manager manages, based on the supplied type and + * config object. * @param {Object} config The config object * @param {String} defaultType If no type is discovered in the config object, we fall back to this type - * @return {Mixed} The instance of whatever this manager is managing + * @return {Object} The instance of whatever this manager is managing */ create: function(config, defaultType) { var type = config[this.typeName] || config.type || defaultType, Constructor = this.types[type]; //<debug> - if (Constructor == undefined) { + if (Constructor === undefined) { Ext.Error.raise("The '" + type + "' type has not been registered with this manager"); } //</debug> @@ -93,10 +114,12 @@ Ext.define('Ext.AbstractManager', { }, /** - * Registers a function that will be called when an item with the specified id is added to the manager. This will happen on instantiation. + * Registers a function that will be called when an item with the specified id is added to the manager. + * This will happen on instantiation. * @param {String} id The item id * @param {Function} fn The callback function. Called with a single parameter, the item. - * @param {Object} scope The scope (<code>this</code> reference) in which the callback is executed. Defaults to the item. + * @param {Object} scope The scope (this reference) in which the callback is executed. + * Defaults to the item. */ onAvailable : function(id, fn, scope){ var all = this.all, @@ -117,16 +140,12 @@ Ext.define('Ext.AbstractManager', { /** * Executes the specified function once for each item in the collection. - * Returning false from the function will cease iteration. - * - * The paramaters passed to the function are: - * <div class="mdetail-params"><ul> - * <li><b>key</b> : String<p class="sub-desc">The key of the item</p></li> - * <li><b>value</b> : Number<p class="sub-desc">The value of the item</p></li> - * <li><b>length</b> : Number<p class="sub-desc">The total number of items in the collection</p></li> - * </ul></div> - * @param {Object} fn The function to execute. - * @param {Object} scope The scope to execute in. Defaults to <tt>this</tt>. + * @param {Function} fn The function to execute. + * @param {String} fn.key The key of the item + * @param {Number} fn.value The value of the item + * @param {Number} fn.length The total number of items in the collection + * @param {Boolean} fn.return False to cease iteration. + * @param {Object} scope The scope to execute in. Defaults to `this`. */ each: function(fn, scope){ this.all.each(fn, scope || this); @@ -140,4 +159,6 @@ Ext.define('Ext.AbstractManager', { return this.all.getCount(); } }); -