Skip to content

Commit 1adf21b

Browse files
author
zhourenjian
committed
Load ShellManager as the default class.
1 parent 702f303 commit 1adf21b

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ if (!isDebugging) {
346346
"$.Composite",
347347
"$.Canvas",
348348
"$.Decorations",
349+
"$.ShellManager",
349350
"$.Shell"
350351
]);
351352
var w = "$wt.widgets.";

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,6 +1727,7 @@ public void setMaximized (boolean maximized) {
17271727
* };
17281728
*/ { }
17291729
}
1730+
boolean toUpdateMax = false;
17301731
if (contentHandle != null) {
17311732
if (oldBounds == null) {
17321733
oldBounds = getBounds();
@@ -1750,12 +1751,19 @@ public void setMaximized (boolean maximized) {
17501751
setBounds(computeTrim(0, 0, width, height - titleHeight));
17511752
} else {
17521753
setBounds(computeTrim(0, -titleHeight, width, height));
1754+
toUpdateMax = true;
17531755
}
17541756
}
17551757
ResizeSystem.register(this, SWT.MAX);
17561758
if (titleBar != null) {
17571759
OS.addCSSClass(titleBar, key);
17581760
}
1761+
if (toUpdateMax)
1762+
/**
1763+
* @j2sNative
1764+
* ShellManager.topbarContainerEl.style.display = "block";
1765+
* ShellManager.updateTopMaximized ();
1766+
*/ {}
17591767
} else {
17601768
setBounds(oldBounds);
17611769
if (titleBar != null) {
@@ -1910,6 +1918,8 @@ public void setMinimized (boolean minimized) {
19101918
* @j2sNative
19111919
* if (window["ShellManager"] != null && this.parent == null && minimized) {
19121920
* this.handle.style.display = "none";
1921+
* ShellManager.sidebarEl.style.display = "block";
1922+
* ShellManager.updateItems ();
19131923
* return;
19141924
* }
19151925
*/ {}
@@ -2099,11 +2109,12 @@ public void run() {
20992109
titleBar.appendChild(shellMax);
21002110
shellMax.onclick = new RunnableCompatibility() {
21012111
public void run() {
2102-
setMaximized(!getMaximized());
2112+
boolean cur = !getMaximized();
2113+
setMaximized(cur);
21032114
Decorations shell = Decorations.this;
21042115
/**
21052116
* @j2sNative
2106-
* if (window["ShellManager"] != null) {
2117+
* if (window["ShellManager"] != null && !cur) {
21072118
* ShellManager.returnTopMaximized (shell);
21082119
* }
21092120
*/ { shell.bringToTop(); }

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
* @see Decorations
103103
* @see SWT
104104
*
105+
* @j2sRequireImport org.eclipse.swt.widgets.ShellManager
105106
* @j2sPrefix
106107
* $WTC$$.registerCSS ("$wt.widgets.Shell");
107108
* @j2sSuffix
@@ -280,9 +281,7 @@ public Shell (Display display, int style) {
280281
* @param style
281282
* @param handle
282283
*
283-
* @j-2-s-Ignore-Super-Constructor
284-
* The above ignore super constructor will bring a bug that Display object
285-
* is not a Widget instance!
284+
* @j2sIgnoreSuperConstructor
286285
*/
287286
Shell (Display display, Shell parent, int style, int handle) {
288287
super ();

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ ClazzLoader.loadClass ("org.eclipse.swt.widgets.ShellManager", function () {
3333
});
3434
});
3535
</script>
36+
*
37+
* Update: Above example is out of date. -- Feb 26, 2007
3638
*/
37-
$_L(["$wt.widgets.Shell"], "$wt.widgets.ShellManager", null, function(){
39+
$_L(null, "$wt.widgets.ShellManager", null, function(){
3840
$WTC$$.registerCSS ("$wt.widgets.ShellManager");
3941
//ShellManager = new Object ();
4042
ShellManager = $_T($wt.widgets, "ShellManager");

0 commit comments

Comments
 (0)