Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Keimel2015-03-26 13:05:43 +0000
committerChristoph Keimel2015-03-26 13:08:02 +0000
commit2bd26be679e4eeb0ad47890af9528359198c58b8 (patch)
tree8b4b276b43008eabe531859228fbc016c270b0dc /experimental
parentd9ca3733cb95c33d783733bcf156b65a45f21f7e (diff)
downloadorg.eclipse.efxclipse-2bd26be679e4eeb0ad47890af9528359198c58b8.tar.gz
org.eclipse.efxclipse-2bd26be679e4eeb0ad47890af9528359198c58b8.tar.xz
org.eclipse.efxclipse-2bd26be679e4eeb0ad47890af9528359198c58b8.zip
Bug 463201 - [swtonjavafx] Allow null as parent in constructor of Shell
Signed-off-by: Christoph Keimel <c.keimel@emsw.de>
Diffstat (limited to 'experimental')
-rw-r--r--experimental/swt/org.eclipse.fx.runtime.swt/src/org/eclipse/swt/widgets/Shell.java11
-rw-r--r--experimental/swt/org.eclipse.fx.runtime.swt/src/org/eclipse/swt/widgets/Widget.java4
2 files changed, 7 insertions, 8 deletions
diff --git a/experimental/swt/org.eclipse.fx.runtime.swt/src/org/eclipse/swt/widgets/Shell.java b/experimental/swt/org.eclipse.fx.runtime.swt/src/org/eclipse/swt/widgets/Shell.java
index c151b5cf8..2b3492e76 100644
--- a/experimental/swt/org.eclipse.fx.runtime.swt/src/org/eclipse/swt/widgets/Shell.java
+++ b/experimental/swt/org.eclipse.fx.runtime.swt/src/org/eclipse/swt/widgets/Shell.java
@@ -23,8 +23,6 @@ import javafx.scene.layout.Region;
import javafx.scene.shape.LineTo;
import javafx.scene.shape.MoveTo;
import javafx.scene.shape.Path;
-import javafx.scene.shape.SVGPath;
-import javafx.scene.shape.Shape;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
@@ -38,7 +36,6 @@ import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.internal.Util;
-import com.sun.javafx.geom.Area;
import com.sun.javafx.geom.PathIterator;
public class Shell extends Decorations {
@@ -62,7 +59,7 @@ public class Shell extends Decorations {
}
public Shell(Shell s) {
- this(s.getDisplay());
+ this(s == null ? null : s.getDisplay());
stage.initOwner(s.stage);
this.parentShell = s;
}
@@ -72,8 +69,10 @@ public class Shell extends Decorations {
}
public Shell(Shell shell, int style) {
- this(shell.getDisplay(), style);
- stage.initOwner(shell.stage);
+ this(shell == null ? null : shell.getDisplay(), style);
+ if (shell != null) {
+ stage.initOwner(shell.stage);
+ }
this.parentShell = shell;
}
diff --git a/experimental/swt/org.eclipse.fx.runtime.swt/src/org/eclipse/swt/widgets/Widget.java b/experimental/swt/org.eclipse.fx.runtime.swt/src/org/eclipse/swt/widgets/Widget.java
index a78ccd074..99045f78d 100644
--- a/experimental/swt/org.eclipse.fx.runtime.swt/src/org/eclipse/swt/widgets/Widget.java
+++ b/experimental/swt/org.eclipse.fx.runtime.swt/src/org/eclipse/swt/widgets/Widget.java
@@ -13,8 +13,6 @@ package org.eclipse.swt.widgets;
import java.util.WeakHashMap;
-import javafx.scene.layout.Region;
-
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.internal.SWTEventListener;
@@ -93,6 +91,8 @@ public abstract class Widget {
}
public Display getDisplay() {
+ if (display == null)
+ display = Display.getCurrent();
return display;
}

Back to the top