Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2017-11-06 17:00:13 +0000
committerRemi Schnekenburger2017-12-06 09:12:56 +0000
commitb298622a72f2dd309aaa55774d4d1b35ece1ad46 (patch)
tree87e81d739a36cb7bf3e712e767200933dbda5ac1
parent61512a97eb11f7eb576abff132140a2b9040ec9f (diff)
downloadorg.eclipse.papyrus-b298622a72f2dd309aaa55774d4d1b35ece1ad46.tar.gz
org.eclipse.papyrus-b298622a72f2dd309aaa55774d4d1b35ece1ad46.tar.xz
org.eclipse.papyrus-b298622a72f2dd309aaa55774d4d1b35ece1ad46.zip
Bug 526903: [Facet] Empty shells are opened and appear on the wrong
screen https://bugs.eclipse.org/bugs/show_bug.cgi?id=526903 - Remove custom shell creation code Change-Id: I120a96ec7c4fe766d3422f8cb0e3417dab50adcd Signed-off-by: Camille Letavernier <cletavernier@eclipsesource.com> (cherry picked from commit fd6dd52241c702cfd5bdd5b97b6a372854ad6f6e)
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/papyrus/emf/facet/util/emf/ui/internal/exported/util/wizard/SelectETypeWizardImpl.java2
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/papyrus/emf/facet/util/ui/internal/exported/util/dialog/AbstractDialog.java14
2 files changed, 2 insertions, 14 deletions
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/papyrus/emf/facet/util/emf/ui/internal/exported/util/wizard/SelectETypeWizardImpl.java b/plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/papyrus/emf/facet/util/emf/ui/internal/exported/util/wizard/SelectETypeWizardImpl.java
index 818cd7e8843..589c45630d1 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/papyrus/emf/facet/util/emf/ui/internal/exported/util/wizard/SelectETypeWizardImpl.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.util.emf.ui/src/org/eclipse/papyrus/emf/facet/util/emf/ui/internal/exported/util/wizard/SelectETypeWizardImpl.java
@@ -51,7 +51,7 @@ public class SelectETypeWizardImpl<T extends EClassifier> extends Wizard
public SelectETypeWizardImpl(final Class<? extends T> eTypeOption,
final EPackage ePackage) {
super();
- this.dialog = new WizardDialog(new Shell(Display.getDefault()),
+ this.dialog = new WizardDialog(Display.getDefault().getActiveShell(),
this);
this.ePackageWP = new SelectEPackageWizardPage();
this.eClassifierWP = new SelectEClassifierWizardPage<T>(eTypeOption,
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/papyrus/emf/facet/util/ui/internal/exported/util/dialog/AbstractDialog.java b/plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/papyrus/emf/facet/util/ui/internal/exported/util/dialog/AbstractDialog.java
index 9ac112b30cd..965da7e9c1f 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/papyrus/emf/facet/util/ui/internal/exported/util/dialog/AbstractDialog.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.util.ui/src/org/eclipse/papyrus/emf/facet/util/ui/internal/exported/util/dialog/AbstractDialog.java
@@ -59,19 +59,7 @@ public abstract class AbstractDialog<CB extends Object, W extends ICommandWidget
* Constructor.
*/
protected AbstractDialog() {
- super(createDisplayedShell());
- }
-
- private static Shell createDisplayedShell() {
- final Display display = Display.getDefault();
- final Shell shell = new Shell(display);
- final Monitor primary = display.getPrimaryMonitor();
- final Rectangle bounds = primary.getBounds();
- final Rectangle rect = shell.getBounds();
- final int xLocation = bounds.x + ((bounds.width - rect.width) / 2);
- final int yLocation = bounds.y + ((bounds.height - rect.height) / 2);
- shell.setLocation(xLocation, yLocation);
- return shell;
+ super(Display.getCurrent().getActiveShell());
}
/**

Back to the top