X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/3789b528d8dd8aad4558e38e22d775bcab1cbd36..6746dc89c47ed01b165cc1152533605f97eb8e8d:/src/AbstractPlugin.js diff --git a/src/AbstractPlugin.js b/src/AbstractPlugin.js index 4bd47e71..01668ade 100644 --- a/src/AbstractPlugin.js +++ b/src/AbstractPlugin.js @@ -1,12 +1,36 @@ +/* + +This file is part of Ext JS 4 + +Copyright (c) 2011 Sencha Inc + +Contact: http://www.sencha.com/contact + +GNU General Public License Usage +This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. + +If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact. + +*/ /** * @class Ext.AbstractPlugin * @extends Object * - * Plugins are injected + *

The AbstractPlugin class is the base class from which user-implemented plugins should inherit.

+ *

This class defines the essential API of plugins as used by Components by defining the following methods:

+ * */ Ext.define('Ext.AbstractPlugin', { disabled: false, - + constructor: function(config) { // if (!config.cmp && Ext.global.console) { @@ -15,34 +39,38 @@ Ext.define('Ext.AbstractPlugin', { // Ext.apply(this, config); }, - + getCmp: function() { return this.cmp; }, /** - * The init method is invoked after initComponent has been run for the - * component which we are injecting the plugin into. + *

The init method is invoked after {@link Ext.Component#initComponent initComponent} has been run for the client Component.

+ *

The supplied implementation is empty. Subclasses should perform plugin initialization, and set up bidirectional + * links between the plugin and its client Component in their own implementation of this method.

+ * @param {Component} client The client Component which owns this plugin. * @method */ init: Ext.emptyFn, /** - * The destroy method is invoked by the owning Component at the time the Component is being destroyed. - * Use this method to clean up an resources. + *

The destroy method is invoked by the owning Component at the time the Component is being destroyed.

+ *

The supplied implementation is empty. Subclasses should perform plugin cleanup in their own implementation of this method.

* @method */ destroy: Ext.emptyFn, /** - * Enable the plugin and set the disabled flag to false. + *

The base implementation just sets the plugin's disabled flag to false

+ *

Plugin subclasses which need more complex processing may implement an overriding implementation.

*/ enable: function() { this.disabled = false; }, /** - * Disable the plugin and set the disabled flag to true. + *

The base implementation just sets the plugin's disabled flag to true

+ *

Plugin subclasses which need more complex processing may implement an overriding implementation.

*/ disable: function() { this.disabled = true;