Skip to content

Commit a28f889

Browse files
author
zhourenjian
committed
Fixing bug#2321790: Not setting icon for new Shell() results in JavaScript error.
1 parent 75ad37a commit a28f889

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2101,7 +2101,7 @@ void setSystemMenu () {
21012101
}
21022102
*/ {}
21032103

2104-
if ((style & SWT.BORDER) == 0 || (style & SWT.RESIZE) != 0) {
2104+
if ((style & SWT.TOOL) == 0 && (style & (SWT.CLOSE | SWT.MIN | SWT.MAX)) != 0) {
21052105
shellIcon = document.createElement("DIV");
21062106
shellIcon.className = "shell-title-icon";
21072107
titleBar.appendChild(shellIcon);

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,10 @@ public void updateItems() {
326326
handleStyle.backgroundImage = "url(\"" + image.url + "\")";
327327
}
328328
} else {
329-
String cssClazzName = item.shell.shellIcon.className;
329+
String cssClazzName = null;
330+
if (item.shell.shellIcon != null) {
331+
cssClazzName = item.shell.shellIcon.className;
332+
}
330333
if (cssClazzName != null && cssClazzName.indexOf("shell-title-icon-console") != -1) {
331334
OS.addCSSClass(item.iconHandle, "shell-item-icon-console");
332335
}

0 commit comments

Comments
 (0)