Subversion Repositories Applications.papyrus

Rev

Rev 1372 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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