Subversion Repositories Applications.papyrus

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
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
 
11
dojo.provide("dojo.widget.SwtWidget");
12
dojo.require("dojo.experimental");
13
dojo.experimental("dojo.widget.SwtWidget");
14
dojo.require("dojo.event.*");
15
dojo.require("dojo.widget.Widget");
16
dojo.require("dojo.uri.*");
17
dojo.require("dojo.lang.func");
18
dojo.require("dojo.lang.extras");
19
try {
20
	importPackage(Packages.org.eclipse.swt.widgets);
21
	dojo.declare("dojo.widget.SwtWidget", dojo.widget.Widget, function () {
22
		if ((arguments.length > 0) && (typeof arguments[0] == "object")) {
23
			this.create(arguments[0]);
24
		}
25
	}, {display:null, shell:null, show:function () {
26
	}, hide:function () {
27
	}, addChild:function () {
28
	}, registerChild:function () {
29
	}, addWidgetAsDirectChild:function () {
30
	}, removeChild:function () {
31
	}, destroyRendering:function () {
32
	}, postInitialize:function () {
33
	}});
34
	dojo.widget.SwtWidget.prototype.display = new Display();
35
	dojo.widget.SwtWidget.prototype.shell = new Shell(dojo.widget.SwtWidget.prototype.display);
36
	dojo.widget.manager.startShell = function () {
37
		var sh = dojo.widget.SwtWidget.prototype.shell;
38
		var d = dojo.widget.SwtWidget.prototype.display;
39
		sh.open();
40
		while (!sh.isDisposed()) {
41
			dojo.widget.manager.doNext();
42
			if (!d.readAndDispatch()) {
43
				d.sleep();
44
			}
45
		}
46
		d.dispose();
47
	};
48
}
49
catch (e) {
50
	dojo.debug("dojo.widget.SwtWidget not loaded. SWT classes not available");
51
}
52