+++ /dev/null
-/*\r
- * Ext JS Library 2.2.1\r
- * Copyright(c) 2006-2009, Ext JS, LLC.\r
- * licensing@extjs.com\r
- * \r
- * http://extjs.com/license\r
- */\r
-\r
-/**\r
- * @class Ext.menu.Adapter\r
- * @extends Ext.menu.BaseItem\r
- * A base utility class that adapts a non-menu component so that it can be wrapped by a menu item and added to a menu.\r
- * It provides basic rendering, activation management and enable/disable logic required to work in menus.\r
- * @constructor\r
- * Creates a new Adapter\r
- * @param {Ext.Component} component The component being adapted to render into a menu\r
- * @param {Object} config Configuration options\r
- */\r
-Ext.menu.Adapter = function(component, config){\r
- Ext.menu.Adapter.superclass.constructor.call(this, config);\r
- this.component = component;\r
-};\r
-Ext.extend(Ext.menu.Adapter, Ext.menu.BaseItem, {\r
- // private\r
- canActivate : true,\r
-\r
- // private\r
- onRender : function(container, position){\r
- this.component.render(container);\r
- this.el = this.component.getEl();\r
- },\r
-\r
- // private\r
- activate : function(){\r
- if(this.disabled){\r
- return false;\r
- }\r
- this.component.focus();\r
- this.fireEvent("activate", this);\r
- return true;\r
- },\r
-\r
- // private\r
- deactivate : function(){\r
- this.fireEvent("deactivate", this);\r
- },\r
-\r
- // private\r
- disable : function(){\r
- this.component.disable();\r
- Ext.menu.Adapter.superclass.disable.call(this);\r
- },\r
-\r
- // private\r
- enable : function(){\r
- this.component.enable();\r
- Ext.menu.Adapter.superclass.enable.call(this);\r
- }\r
-});
\ No newline at end of file