4 * Copyright(c) 2006-2007, Ext JS, LLC.
6 * Originally Released Under LGPL - original licence link has changed is not relivant.
9 * <script type="text/javascript">
13 * @class Roo.menu.Adapter
14 * @extends Roo.menu.BaseItem
16 * 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.
17 * It provides basic rendering, activation management and enable/disable logic required to work in menus.
19 * Creates a new Adapter
20 * @param {Object} config Configuration options
22 Roo.menu.Adapter = function(component, config){
23 Roo.menu.Adapter.superclass.constructor.call(this, config);
24 this.component = component;
26 Roo.extend(Roo.menu.Adapter, Roo.menu.BaseItem, {
31 onRender : function(container, position){
32 this.component.render(container);
33 this.el = this.component.getEl();
37 activate : function(){
41 this.component.focus();
42 this.fireEvent("activate", this);
47 deactivate : function(){
48 this.fireEvent("deactivate", this);
53 this.component.disable();
54 Roo.menu.Adapter.superclass.disable.call(this);
59 this.component.enable();
60 Roo.menu.Adapter.superclass.enable.call(this);