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
15 * 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.
16 * It provides basic rendering, activation management and enable/disable logic required to work in menus.
18 * Creates a new Adapter
19 * @param {Object} config Configuration options
21 Roo.menu.Adapter = function(component, config){
22 Roo.menu.Adapter.superclass.constructor.call(this, config);
23 this.component = component;
25 Roo.extend(Roo.menu.Adapter, Roo.menu.BaseItem, {
30 onRender : function(container, position){
31 this.component.render(container);
32 this.el = this.component.getEl();
36 activate : function(){
40 this.component.focus();
41 this.fireEvent("activate", this);
46 deactivate : function(){
47 this.fireEvent("deactivate", this);
52 this.component.disable();
53 Roo.menu.Adapter.superclass.disable.call(this);
58 this.component.enable();
59 Roo.menu.Adapter.superclass.enable.call(this);