Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / examples / desktop / BogusModule.js
1 /*!
2 * Ext JS Library 4.0
3 * Copyright(c) 2006-2011 Sencha Inc.
4 * licensing@sencha.com
5 * http://www.sencha.com/license
6 */
7
8 var windowIndex = 0;
9
10 Ext.define('MyDesktop.BogusModule', {
11     extend: 'Ext.ux.desktop.Module',
12
13     init : function(){
14         this.launcher = {
15             text: 'Window '+(++windowIndex),
16             iconCls:'bogus',
17             handler : this.createWindow,
18             scope: this,
19             windowId:windowIndex
20         }
21     },
22
23     createWindow : function(src){
24         var desktop = this.app.getDesktop();
25         var win = desktop.getWindow('bogus'+src.windowId);
26         if(!win){
27             win = desktop.createWindow({
28                 id: 'bogus'+src.windowId,
29                 title:src.text,
30                 width:640,
31                 height:480,
32                 html : '<p>Something useful would be in here.</p>',
33                 iconCls: 'bogus',
34                 animCollapse:false,
35                 constrainHeader:true
36             });
37         }
38         win.show();
39         return win;
40     }
41 });