2525import org .eclipse .swt .internal .dnd .HTMLEventWrapper ;
2626import org .eclipse .swt .internal .dnd .ShellFrameDND ;
2727import org .eclipse .swt .internal .xhtml .CSSStyle ;
28+ import org .eclipse .swt .internal .xhtml .Clazz ;
2829import org .eclipse .swt .internal .xhtml .Element ;
2930import org .eclipse .swt .internal .xhtml .HTMLEvent ;
3031import org .eclipse .swt .internal .xhtml .document ;
@@ -751,12 +752,12 @@ void exportHTMLSource(boolean onlyContent) {
751752
752753/**
753754 * @j2sNative
754- * ClazzLoader.loadClass ("org.eclipse.swt.widgets.AboutJava2Script ", (function (o) { return function () {
755- * $wt.widgets.AboutJava2Script .openAbout (o);
755+ * ClazzLoader.loadClass ("org.eclipse.swt.widgets.About ", (function (o) { return function () {
756+ * $wt.widgets.About .openAbout (o);
756757 * }; }) (this));
757758 * @j2sNativeSrc
758- * ClazzLoader.loadClass ("org.eclipse.swt.widgets.AboutJava2Script ", (function (o) { return function () {
759- * $wt.widgets.AboutJava2Script .openAbout (o);
759+ * ClazzLoader.loadClass ("org.eclipse.swt.widgets.About ", (function (o) { return function () {
760+ * $wt.widgets.About .openAbout (o);
760761 * }; }) (this));
761762 */
762763void openAboutJava2Script () {
@@ -801,12 +802,9 @@ public void dispose () {
801802 * }
802803 * }
803804 */ {}
804- /**
805- * @j2sNative
806- * if (window["ShellManager"] != null && (this.getStyle() & 4) == 0) { // SWT.TOOL
807- * ShellManager.removeShellItem (this);
808- * }
809- */ {}
805+ if ((this .getStyle () & SWT .TOOL ) == 0 && display .taskBar != null ) {
806+ display .taskBar .removeShellItem ((Shell ) this );
807+ }
810808 super .dispose ();
811809}
812810
@@ -1116,12 +1114,9 @@ public boolean getMinimized () {
11161114 if (OS.IsWindowVisible (handle)) return OS.IsIconic (handle);
11171115 return swFlags == OS.SW_SHOWMINNOACTIVE;
11181116 */
1119- /**
1120- * @j2sNative
1121- * if (window["ShellManager"] != null && this.parent == null) {
1122- * return this.handle.style.display == "none";
1123- * }
1124- */ {}
1117+ if (this .parent == null ) {
1118+ return this .handle .style .display == "none" ;
1119+ }
11251120 return this .minimized ; // TODO
11261121}
11271122
@@ -1464,7 +1459,7 @@ public void setImage (Image image) {
14641459// imgBackground.style.height = "100%";
14651460// imgBackground.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"" + this.image.url + "\", sizingMethod=\"image\")";
14661461// handle.appendChild(imgBackground);
1467- iconStyle .backgroundImage = "" ;
1462+ iconStyle .backgroundImage = "url( \" about:blank \" ) " ;
14681463 iconStyle .filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\" " + this .image .url + "\" , sizingMethod=\" image\" )" ;
14691464 } else {
14701465 if (OS .isIENeedPNGFix && iconStyle .filter != null ) iconStyle .filter = "" ;
@@ -1685,7 +1680,7 @@ public void setMaximized (boolean maximized) {
16851680 * };
16861681 */ { }
16871682 }
1688- boolean toUpdateMax = false ;
1683+ // boolean toUpdateMax = false;
16891684 if (contentHandle != null ) {
16901685 if (oldBounds == null ) {
16911686 oldBounds = getBounds ();
@@ -1700,44 +1695,43 @@ public void setMaximized (boolean maximized) {
17001695 }
17011696 //int titleHeight = ((style & SWT.TITLE) != 0) ? 20 : 0;
17021697 int titleHeight = ((style & SWT .TITLE ) != 0 ) ? OS .getContainerHeight (titleBar ) : 0 ;
1703- boolean isOptMaximized = false ;
1704- /**
1705- * @j2sNative
1706- * isOptMaximized = window["ShellManager"] != null;
1707- */ {}
1708-
1709-
1710- if (!isOptMaximized ) {
1711- setBounds (computeTrim (0 , 0 , width , height - titleHeight ));
1712- } else {
1698+ // boolean isOptMaximized = false;
1699+ // /**
1700+ // * @j2sNative
1701+ // * isOptMaximized = window["ShellManager"] != null;
1702+ // */ {}
1703+ //
1704+ //
1705+ // if (!isOptMaximized) {
1706+ // setBounds(computeTrim(0, 0, width, height - titleHeight));
1707+ // } else {
17131708 Rectangle trim = computeTrim (0 , -titleHeight , width , height );
17141709 setBounds (trim .x , trim .y , trim .width , trim .height );
1715- toUpdateMax = true ;
1716- }
1710+ // toUpdateMax = true;
1711+ // }
17171712 }
17181713 ResizeSystem .register (this , SWT .MAX );
17191714 if (titleBar != null ) {
17201715 OS .addCSSClass (titleBar , key );
17211716 }
1722- if (window .currentTopZIndex == null ) {
1723- handle .style .zIndex = window .currentTopZIndex = "1000" ;
1724- } else {
1725- handle .style .zIndex = window .currentTopZIndex = ""
1726- + (Integer .parseInt (window .currentTopZIndex ) + 1 );
1717+ handle .style .zIndex = Display .getNextZIndex (true );
1718+ if (contentHandle != null ) {
1719+ window .setTimeout (Clazz .makeFunction (new Runnable () {
1720+
1721+ @ Override
1722+ public void run () {
1723+ Shell lastShell = Display .getTopMaximizedShell ();
1724+ if (lastShell == null || lastShell .titleBar == null ) return ;
1725+ if (display .topBar != null ) {
1726+ MaximizedTitle topBar = display .topBar ;
1727+ topBar .handleApproaching ();
1728+ topBar .updateLayout ();
1729+ topBar .updateLastModified ();
1730+ }
1731+ }
1732+
1733+ }), 250 );
17271734 }
1728- if (toUpdateMax )
1729- /**
1730- * @j2sNative
1731- * window.setTimeout (function () {
1732- * var lastShell = ShellManager.getTopMaximizedShell ();
1733- * if (lastShell == null || lastShell.titleBar == null) return;
1734- * if (ShellManager.topbarContainerEl != null) {
1735- * ShellManager.topbarContainerEl.style.display = "block";
1736- * }
1737- * ShellManager.updateTopMaximized ();
1738- * ShellManager.lastMMed = new Date().getTime();
1739- * }, 250);
1740- */ {}
17411735 } else {
17421736 setBounds (oldBounds );
17431737 if (titleBar != null ) {
@@ -1888,18 +1882,13 @@ public void setMinimized (boolean minimized) {
18881882 return ;
18891883 }
18901884 }
1891- /**
1892- * @j2sNative
1893- * if (window["ShellManager"] != null && this.parent == null && minimized) {
1894- * this.handle.style.display = "none";
1895- * if (ShellManager.sidebarEl != null) {
1896- * ShellManager.sidebarEl.style.display = "block";
1897- * }
1898- * ShellManager.updateItems ();
1899- * ShellManager.lastMMed = new Date().getTime();
1900- * return;
1901- * }
1902- */ {}
1885+ if (this .parent == null && minimized && display .taskBar != null ) {
1886+ this .handle .style .display = "none" ;
1887+ display .taskBar .handleApproaching ();
1888+ display .taskBar .updateLayout ();
1889+ // lastMMed
1890+ return ;
1891+ }
19031892 if (minimized && contentHandle != null ) {
19041893 //handle.style.display = "none";
19051894 if (oldBounds == null ) {
@@ -2086,12 +2075,9 @@ public void run() {
20862075 Decorations shell = Decorations .this ;
20872076 ResizeSystem .unregister (shell , SWT .MIN );
20882077 setMinimized (true );
2089- /**
2090- * @j2sNative
2091- * if (window["ShellManager"] != null) {
2092- * ShellManager.returnTopMaximized (shell);
2093- * }
2094- */ { }
2078+ if (display .topBar != null ) {
2079+ display .topBar .returnTopMaximized ((Shell ) shell );
2080+ }
20952081 }
20962082 };
20972083 }
@@ -2105,12 +2091,9 @@ public void run() {
21052091 boolean cur = !getMaximized ();
21062092 setMaximized (cur );
21072093 Decorations shell = Decorations .this ;
2108- /**
2109- * @j2sNative
2110- * if (window["ShellManager"] != null && !cur) {
2111- * ShellManager.returnTopMaximized (shell);
2112- * }
2113- */ { shell .bringToTop (); }
2094+ if (!cur && display .topBar != null ) {
2095+ display .topBar .returnTopMaximized ((Shell ) shell );
2096+ }
21142097 display .timerExec (25 , new Runnable () {
21152098 public void run () {
21162099 layout ();
@@ -2128,12 +2111,9 @@ public void run() {
21282111 public void run () {
21292112 if (Decorations .this instanceof Shell ) {
21302113 Shell shell = (Shell ) Decorations .this ;
2131- /**
2132- * @j2sNative
2133- * if (window["ShellManager"] != null) {
2134- * ShellManager.returnTopMaximized (shell);
2135- * }
2136- */ { }
2114+ if (display .topBar != null ) {
2115+ display .topBar .returnTopMaximized (shell );
2116+ }
21372117 shell .close ();
21382118 }
21392119 }
@@ -2170,12 +2150,8 @@ public void run() {
21702150 }
21712151 };
21722152
2173- if (window .currentTopZIndex == null ) {
2174- handle .style .zIndex = window .currentTopZIndex = "1000" ;
2175- } else {
2176- handle .style .zIndex = window .currentTopZIndex = ""
2177- + (Integer .parseInt (window .currentTopZIndex ) + 2 );
2178- }
2153+ Display .getNextZIndex (true );
2154+ handle .style .zIndex = Display .getNextZIndex (true );
21792155}
21802156
21812157/**
@@ -2206,19 +2182,22 @@ public void setText (String string) {
22062182 }
22072183 }
22082184 shellTitle .appendChild (document .createTextNode (string ));
2209- /**
2210- * @j2sNative
2211- * if (window["ShellManager"] != null && this.parent == null
2212- * && (this.getStyle() & 4) == 0) { // SWT.TOOL
2213- * if (ShellManager.sidebarEl != null) {
2214- * ShellManager.sidebarEl.style.display = "block";
2215- * }
2216- * window.setTimeout (function () {
2217- * ShellManager.updateItems ();
2218- * ShellManager.lastMMed = new Date().getTime();
2219- * }, 50);
2220- * }
2221- */ {}
2185+
2186+ if (this .parent == null && (this .getStyle () & SWT .TOOL ) == 0
2187+ && display .taskBar != null ) {
2188+ display .taskBar .handleApproaching ();
2189+ }
2190+ if (display .taskBar != null ) {
2191+ window .setTimeout (Clazz .makeFunction (new Runnable () {
2192+
2193+ @ Override
2194+ public void run () {
2195+ display .taskBar .updateLayout ();
2196+ // lastMM
2197+ }
2198+
2199+ }), 50 );
2200+ }
22222201 }
22232202}
22242203
0 commit comments