25
25
import org .eclipse .swt .internal .dnd .HTMLEventWrapper ;
26
26
import org .eclipse .swt .internal .dnd .ShellFrameDND ;
27
27
import org .eclipse .swt .internal .xhtml .CSSStyle ;
28
+ import org .eclipse .swt .internal .xhtml .Clazz ;
28
29
import org .eclipse .swt .internal .xhtml .Element ;
29
30
import org .eclipse .swt .internal .xhtml .HTMLEvent ;
30
31
import org .eclipse .swt .internal .xhtml .document ;
@@ -751,12 +752,12 @@ void exportHTMLSource(boolean onlyContent) {
751
752
752
753
/**
753
754
* @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);
756
757
* }; }) (this));
757
758
* @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);
760
761
* }; }) (this));
761
762
*/
762
763
void openAboutJava2Script () {
@@ -801,12 +802,9 @@ public void dispose () {
801
802
* }
802
803
* }
803
804
*/ {}
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
+ }
810
808
super .dispose ();
811
809
}
812
810
@@ -1116,12 +1114,9 @@ public boolean getMinimized () {
1116
1114
if (OS.IsWindowVisible (handle)) return OS.IsIconic (handle);
1117
1115
return swFlags == OS.SW_SHOWMINNOACTIVE;
1118
1116
*/
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
+ }
1125
1120
return this .minimized ; // TODO
1126
1121
}
1127
1122
@@ -1464,7 +1459,7 @@ public void setImage (Image image) {
1464
1459
// imgBackground.style.height = "100%";
1465
1460
// imgBackground.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"" + this.image.url + "\", sizingMethod=\"image\")";
1466
1461
// handle.appendChild(imgBackground);
1467
- iconStyle .backgroundImage = "" ;
1462
+ iconStyle .backgroundImage = "url( \" about:blank \" ) " ;
1468
1463
iconStyle .filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\" " + this .image .url + "\" , sizingMethod=\" image\" )" ;
1469
1464
} else {
1470
1465
if (OS .isIENeedPNGFix && iconStyle .filter != null ) iconStyle .filter = "" ;
@@ -1685,7 +1680,7 @@ public void setMaximized (boolean maximized) {
1685
1680
* };
1686
1681
*/ { }
1687
1682
}
1688
- boolean toUpdateMax = false ;
1683
+ // boolean toUpdateMax = false;
1689
1684
if (contentHandle != null ) {
1690
1685
if (oldBounds == null ) {
1691
1686
oldBounds = getBounds ();
@@ -1700,44 +1695,43 @@ public void setMaximized (boolean maximized) {
1700
1695
}
1701
1696
//int titleHeight = ((style & SWT.TITLE) != 0) ? 20 : 0;
1702
1697
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 {
1713
1708
Rectangle trim = computeTrim (0 , -titleHeight , width , height );
1714
1709
setBounds (trim .x , trim .y , trim .width , trim .height );
1715
- toUpdateMax = true ;
1716
- }
1710
+ // toUpdateMax = true;
1711
+ // }
1717
1712
}
1718
1713
ResizeSystem .register (this , SWT .MAX );
1719
1714
if (titleBar != null ) {
1720
1715
OS .addCSSClass (titleBar , key );
1721
1716
}
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 );
1727
1734
}
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
- */ {}
1741
1735
} else {
1742
1736
setBounds (oldBounds );
1743
1737
if (titleBar != null ) {
@@ -1888,18 +1882,13 @@ public void setMinimized (boolean minimized) {
1888
1882
return ;
1889
1883
}
1890
1884
}
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
+ }
1903
1892
if (minimized && contentHandle != null ) {
1904
1893
//handle.style.display = "none";
1905
1894
if (oldBounds == null ) {
@@ -2086,12 +2075,9 @@ public void run() {
2086
2075
Decorations shell = Decorations .this ;
2087
2076
ResizeSystem .unregister (shell , SWT .MIN );
2088
2077
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
+ }
2095
2081
}
2096
2082
};
2097
2083
}
@@ -2105,12 +2091,9 @@ public void run() {
2105
2091
boolean cur = !getMaximized ();
2106
2092
setMaximized (cur );
2107
2093
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
+ }
2114
2097
display .timerExec (25 , new Runnable () {
2115
2098
public void run () {
2116
2099
layout ();
@@ -2128,12 +2111,9 @@ public void run() {
2128
2111
public void run () {
2129
2112
if (Decorations .this instanceof Shell ) {
2130
2113
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
+ }
2137
2117
shell .close ();
2138
2118
}
2139
2119
}
@@ -2170,12 +2150,8 @@ public void run() {
2170
2150
}
2171
2151
};
2172
2152
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 );
2179
2155
}
2180
2156
2181
2157
/**
@@ -2206,19 +2182,22 @@ public void setText (String string) {
2206
2182
}
2207
2183
}
2208
2184
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
+ }
2222
2201
}
2223
2202
}
2224
2203
0 commit comments