1318 |
alexandre_ |
1 |
/*
|
|
|
2 |
Copyright (c) 2004-2006, The Dojo Foundation
|
|
|
3 |
All Rights Reserved.
|
|
|
4 |
|
|
|
5 |
Licensed under the Academic Free License version 2.1 or above OR the
|
|
|
6 |
modified BSD license. For more information on Dojo licensing, see:
|
|
|
7 |
|
|
|
8 |
http://dojotoolkit.org/community/licensing.shtml
|
|
|
9 |
*/
|
|
|
10 |
|
1422 |
alexandre_ |
11 |
|
|
|
12 |
|
1318 |
alexandre_ |
13 |
dojo.provide("dojo.widget.SwtWidget");
|
|
|
14 |
dojo.require("dojo.experimental");
|
|
|
15 |
dojo.experimental("dojo.widget.SwtWidget");
|
|
|
16 |
dojo.require("dojo.event.*");
|
|
|
17 |
dojo.require("dojo.widget.Widget");
|
|
|
18 |
dojo.require("dojo.uri.*");
|
|
|
19 |
dojo.require("dojo.lang.func");
|
|
|
20 |
dojo.require("dojo.lang.extras");
|
|
|
21 |
try {
|
|
|
22 |
importPackage(Packages.org.eclipse.swt.widgets);
|
|
|
23 |
dojo.declare("dojo.widget.SwtWidget", dojo.widget.Widget, function () {
|
|
|
24 |
if ((arguments.length > 0) && (typeof arguments[0] == "object")) {
|
|
|
25 |
this.create(arguments[0]);
|
|
|
26 |
}
|
|
|
27 |
}, {display:null, shell:null, show:function () {
|
|
|
28 |
}, hide:function () {
|
|
|
29 |
}, addChild:function () {
|
|
|
30 |
}, registerChild:function () {
|
|
|
31 |
}, addWidgetAsDirectChild:function () {
|
|
|
32 |
}, removeChild:function () {
|
|
|
33 |
}, destroyRendering:function () {
|
|
|
34 |
}, postInitialize:function () {
|
|
|
35 |
}});
|
|
|
36 |
dojo.widget.SwtWidget.prototype.display = new Display();
|
|
|
37 |
dojo.widget.SwtWidget.prototype.shell = new Shell(dojo.widget.SwtWidget.prototype.display);
|
|
|
38 |
dojo.widget.manager.startShell = function () {
|
|
|
39 |
var sh = dojo.widget.SwtWidget.prototype.shell;
|
|
|
40 |
var d = dojo.widget.SwtWidget.prototype.display;
|
|
|
41 |
sh.open();
|
|
|
42 |
while (!sh.isDisposed()) {
|
|
|
43 |
dojo.widget.manager.doNext();
|
|
|
44 |
if (!d.readAndDispatch()) {
|
|
|
45 |
d.sleep();
|
|
|
46 |
}
|
|
|
47 |
}
|
|
|
48 |
d.dispose();
|
|
|
49 |
};
|
|
|
50 |
}
|
|
|
51 |
catch (e) {
|
|
|
52 |
dojo.debug("dojo.widget.SwtWidget not loaded. SWT classes not available");
|
|
|
53 |
}
|
|
|
54 |
|