Skip to content

Commit 3082e87

Browse files
author
jossonsmith
committed
Update comments and usage
1 parent f7575a4 commit 3082e87

File tree

1 file changed

+38
-7
lines changed
  • sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/widgets

1 file changed

+38
-7
lines changed

sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/widgets/ShellManager.js

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1+
/******************************************************************************
2+
* Copyright (c) 2005-2007 ognize.com and others.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* which accompanies this distribution, and is available at
6+
* http://www.eclipse.org/legal/epl-v10.html
7+
*
8+
* Web:
9+
* http://j2s.sourceforge.net/
10+
* http://sourceforge.net/projects/j2s/
11+
* Contributors:
12+
* ognize.com - initial API and implementation
13+
*****************************************************************************/
14+
/*******
15+
* @author zhou renjian
16+
* @create Jan 17, 2007
17+
*******/
18+
19+
/*
20+
* ShellManager is optional for SWT applications. When ShellManager is
21+
* activated, there are an automatically-hidden side bar for all windows,
22+
* and there are no title bar for maximized Shells but with an automatically-
23+
* hidden top bar. By using ShellManager, much of the inner browser window
24+
* space will be used, and minimize or maximize windows will be much more
25+
* user-friendly.
26+
*
27+
* Example:
28+
<script>
29+
...
30+
ClazzLoader.loadClass ("org.eclipse.swt.widgets.ShellManager", function () {
31+
ClazzLoader.loadClass ("com.example.Notepad", function () {
32+
com.example.Notepad.main([]);
33+
});
34+
});
35+
</script>
36+
*/
137
$_L(["$wt.widgets.Shell"], "$wt.widgets.ShellManager", null, function(){
238
$WTC$$.registerCSS ("$wt.widgets.ShellManager");
339
//ShellManager = new Object ();
@@ -151,12 +187,7 @@ sm.syncItems = function () {
151187
};
152188
sm.isAroundTopBar = function (x) {
153189
var x1, x2, barWidth;
154-
var length = 0; //this.items.length;
155-
if (length == 0) {
156-
barWidth = 320;
157-
} else {
158-
barWidth = 320 + 20; // TODO
159-
}
190+
barWidth = 320;
160191
var height = document.body.clientWidth;
161192
var offset = Math.round ((height - barWidth) / 2);
162193
x1 = offset - 72;
@@ -218,7 +249,7 @@ sm.returnTopMaximized = function (shell) {
218249
if (shell != null && lastShell != shell) return;
219250
if (lastShell == null || lastShell.titleBar == null) return;
220251

221-
// move the title bar elements into topbarEl
252+
// move the title bar elements back to Shell's title bar
222253
var els = [];
223254
for (var i = 0; i < this.topbarEl.childNodes.length; i++) {
224255
els[i] = this.topbarEl.childNodes[i];

0 commit comments

Comments
 (0)