Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2015-06-04 07:58:42 +0000
committerAnsgar Radermacher2015-06-04 07:59:02 +0000
commit49a6ffe3b2710e45a310e9ec46d9785cea3424a4 (patch)
tree9a673e093a7e8892724b336d071469b27ba9e94a /extraplugins/qompass-designer
parentdf36bae950a71d3c844ee182e96459facc3e7363 (diff)
downloadorg.eclipse.papyrus-49a6ffe3b2710e45a310e9ec46d9785cea3424a4.tar.gz
org.eclipse.papyrus-49a6ffe3b2710e45a310e9ec46d9785cea3424a4.tar.xz
org.eclipse.papyrus-49a6ffe3b2710e45a310e9ec46d9785cea3424a4.zip
469354 - [QDesigner] Large empty windows appear in several situations that are never closed.
Diffstat (limited to 'extraplugins/qompass-designer')
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/InstantiateDepPlan.java2
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TrafoAndCodegenPackage.java4
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/AllocationDialog.java4
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigureInstanceDialog.java3
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigurePortDialog.java6
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/InteractiveImplementationChooser.java4
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AddProfileAndModelLibsHandler.java6
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AllocateHandler.java3
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigureInstanceHandler.java3
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigurePortHandler.java3
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreateDepPlanHandler.java8
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreatePlatformHandler.java3
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/InstantiateDepPlanHandler.java4
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectConnectorHandler.java3
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectContainerHandler.java3
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SyncHandler.java7
-rw-r--r--extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/TracepointPropertiesCommand.java4
-rw-r--r--extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/views/TracepointView.java3
18 files changed, 41 insertions, 32 deletions
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/InstantiateDepPlan.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/InstantiateDepPlan.java
index b18adc85900..a2d89c1d40a 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/InstantiateDepPlan.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/InstantiateDepPlan.java
@@ -487,7 +487,7 @@ public class InstantiateDepPlan {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
- Shell shell = new Shell();
+ Shell shell = Display.getDefault().getActiveShell();
MessageDialog.openInformation(shell, title, message);
}
});
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TrafoAndCodegenPackage.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TrafoAndCodegenPackage.java
index 2b41484c526..798272f30d9 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TrafoAndCodegenPackage.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TrafoAndCodegenPackage.java
@@ -222,7 +222,7 @@ public class TrafoAndCodegenPackage {
@Override
public void run() {
- Shell shell = new Shell();
+ Shell shell = Display.getDefault().getActiveShell();
MessageDialog.openError(shell, Messages.InstantiateDepPlan_TransformationException, teFinal.getMessage());
}
});
@@ -234,7 +234,7 @@ public class TrafoAndCodegenPackage {
@Override
public void run() {
- Shell shell = new Shell();
+ Shell shell = Display.getDefault().getActiveShell();
String msg = eFinal.toString() + "\n\n" + //$NON-NLS-1$
Messages.InstantiateDepPlan_ConsultConsole;
MessageDialog.openError(shell, Messages.InstantiateDepPlan_ErrorsDuringTransformation, msg);
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/AllocationDialog.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/AllocationDialog.java
index 50c598fc46c..14a3e457d49 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/AllocationDialog.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/AllocationDialog.java
@@ -38,6 +38,7 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeColumn;
@@ -296,8 +297,7 @@ public class AllocationDialog extends SelectionStatusDialog {
// add or update
if (oldNode == null) {
if (!AllocUtils.allocate(is, newNode)) {
- Shell shell = new Shell();
- if (MessageDialog.openQuestion(shell, "Error",
+ if (MessageDialog.openQuestion(Display.getDefault().getActiveShell(), "Error",
"Stereotype application failed. The profile MARTE::Allocation is probably not applied. Try to apply it?")) {
AbstractEMFOperation applyProfile = new AddMarteAndFcmProfile(PackageUtil.getRootPackage(is), AddMarteAndFcmProfile.APPLY_ALLOC, TransactionUtil.getEditingDomain(is));
CommandSupport.exec(applyProfile);
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigureInstanceDialog.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigureInstanceDialog.java
index be19be8f188..af9dff45f9f 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigureInstanceDialog.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigureInstanceDialog.java
@@ -47,6 +47,7 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
@@ -217,7 +218,7 @@ public class ConfigureInstanceDialog extends SelectionStatusDialog {
DepUtils.getAllInstances(m_model, m_instanceList, filter);
if (m_instanceList.size() == 0) {
- Shell shell = new Shell();
+ Shell shell = Display.getDefault().getActiveShell();
if (DepPlanUtils.getAllDepPlans(m_model).size() == 0) {
MessageDialog.openInformation(shell, "Instance configuration",
"No deployment plans are defined. Create a deployment plan before configuring instances");
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigurePortDialog.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigurePortDialog.java
index 1344a1b86dc..7f8bc62475a 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigurePortDialog.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigurePortDialog.java
@@ -48,6 +48,7 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
@@ -69,7 +70,6 @@ import org.eclipse.uml2.uml.util.UMLUtil;
* TODO: extend rule application to instances (problematic, since rules
* transformation is done on type level)
*
- * @author ansgar
*/
public class ConfigurePortDialog extends SelectionStatusDialog {
@@ -204,7 +204,7 @@ public class ConfigurePortDialog extends SelectionStatusDialog {
fKindCombo = new Combo(instanceConfigurationGroup, SWT.NONE);
portKindList = getAvailableKinds(m_model);
if (portKindList.size() == 0) {
- MessageDialog.openInformation(new Shell(), "No port kinds founds", "No port kinds are available. Please import a Qompass model library");
+ MessageDialog.openInformation(Display.getDefault().getActiveShell(), "No port kinds founds", "No port kinds are available. Please import a Qompass model library");
}
String[] portKindStrList = new String[portKindList.size() + 1];
portKindStrList[0] = Messages.ConfigurePortDialog_None;
@@ -253,7 +253,7 @@ public class ConfigurePortDialog extends SelectionStatusDialog {
@Override
public void widgetSelected(SelectionEvent e) {
// use Papyrus type selection dialog ...
- TreeSelectorDialog tsd = new TreeSelectorDialog(new Shell());
+ TreeSelectorDialog tsd = new TreeSelectorDialog(Display.getDefault().getActiveShell());
EStructuralFeature feature = UMLPackage.eINSTANCE.getTypedElement_Type();
ServiceEditFilteredContentProvider contentProvider =
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/InteractiveImplementationChooser.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/InteractiveImplementationChooser.java
index a7792a2becf..bfdcf2d7040 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/InteractiveImplementationChooser.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/InteractiveImplementationChooser.java
@@ -18,7 +18,7 @@ import org.eclipse.emf.common.util.EList;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.papyrus.qompass.designer.core.deployment.ImplementationChooser;
-import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.NamedElement;
@@ -36,7 +36,7 @@ public class InteractiveImplementationChooser implements ImplementationChooser {
}
};
ElementListSelectionDialog dialog =
- new ElementListSelectionDialog(new Shell(), ilabel);
+ new ElementListSelectionDialog(Display.getDefault().getActiveShell(), ilabel);
dialog.setTitle("Multiple implementations found");
dialog.setMessage("Select an implementation for component type " + componentType.getName());
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AddProfileAndModelLibsHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AddProfileAndModelLibsHandler.java
index 5bd0c45a164..588f0bc84de 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AddProfileAndModelLibsHandler.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AddProfileAndModelLibsHandler.java
@@ -21,7 +21,7 @@ import org.eclipse.papyrus.qompass.designer.core.CommandSupport;
import org.eclipse.papyrus.qompass.designer.core.commands.AddMarteAndFcmProfile;
import org.eclipse.papyrus.qompass.designer.core.commands.AddQompassModelLibs;
import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler;
-import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.dialogs.ListSelectionDialog;
import org.eclipse.uml2.uml.Package;
import org.eclipse.uml2.uml.PackageImport;
@@ -59,7 +59,7 @@ public class AddProfileAndModelLibsHandler extends CmdHandler {
domain);
AddQompassModelLibs addModelLibs = new AddQompassModelLibs(selectedPkg, domain);
- final ListSelectionDialog dialog = new ListSelectionDialog(new Shell(),
+ final ListSelectionDialog dialog = new ListSelectionDialog(Display.getDefault().getActiveShell(),
addModelLibs.getAvailableImportPackages().toArray(),
new ArrayContentProvider(),
new LabelProvider() {
@@ -84,7 +84,7 @@ public class AddProfileAndModelLibsHandler extends CmdHandler {
CommandSupport.exec(addModelLibs);
CommandSupport.exec(addProfiles);
// open dialog?
- // MessageDialog.openWarning(new Shell(),
+ // MessageDialog.openWarning(Display.getDefault().getActiveShell(),
// "Warning", "The MARTE profile is not available."); //$NON-NLS-1$ //$NON-NLS-2$
}
return null;
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AllocateHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AllocateHandler.java
index c04aabc5c03..dd517e153c9 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AllocateHandler.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AllocateHandler.java
@@ -21,6 +21,7 @@ import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils;
import org.eclipse.papyrus.qompass.designer.ui.dialogs.AllocationDialog;
import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler;
import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.uml2.uml.Package;
@@ -52,7 +53,7 @@ public class AllocateHandler extends CmdHandler {
}
final Package cdp = (Package) selectedEObject;
- final Shell shell = new Shell();
+ final Shell shell = Display.getDefault().getActiveShell();
// org.eclipse.papyrus.qompass.designer.vsl.ParseVSL.test();
if (DepUtils.getMainInstance(cdp) == null) {
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigureInstanceHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigureInstanceHandler.java
index 1c961e685a5..969ecd1d367 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigureInstanceHandler.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigureInstanceHandler.java
@@ -17,6 +17,7 @@ import org.eclipse.papyrus.qompass.designer.core.CommandSupport;
import org.eclipse.papyrus.qompass.designer.core.RunnableWithResult;
import org.eclipse.papyrus.qompass.designer.ui.dialogs.ConfigureInstanceDialog;
import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.Connector;
@@ -57,7 +58,7 @@ public class ConfigureInstanceHandler extends CmdHandler {
}
final NamedElement element = (NamedElement) selectedEObject;
- final Shell shell = new Shell();
+ final Shell shell = Display.getDefault().getActiveShell();
final ExecutionEvent from = event;
// 1. select possible connectors according to port types
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigurePortHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigurePortHandler.java
index 71f427b0602..3dcbc83e054 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigurePortHandler.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigurePortHandler.java
@@ -18,6 +18,7 @@ import org.eclipse.papyrus.qompass.designer.core.RunnableWithResult;
import org.eclipse.papyrus.qompass.designer.ui.Messages;
import org.eclipse.papyrus.qompass.designer.ui.dialogs.ConfigurePortDialog;
import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.NamedElement;
@@ -53,7 +54,7 @@ public class ConfigurePortHandler extends CmdHandler {
}
final NamedElement element = (NamedElement) selectedEObject;
- final Shell shell = new Shell();
+ final Shell shell = Display.getDefault().getActiveShell();
// 1. select possible connectors according to port types
// (only show compatible connectors check-box?)
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreateDepPlanHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreateDepPlanHandler.java
index 500e2d8c2fa..6ff9c26c533 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreateDepPlanHandler.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreateDepPlanHandler.java
@@ -29,6 +29,7 @@ import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationE
import org.eclipse.papyrus.qompass.designer.ui.Messages;
import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler;
import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.InstanceSpecification;
@@ -74,7 +75,7 @@ public class CreateDepPlanHandler extends CmdHandler {
try {
String name = selectedComposite.getName() + DeployConstants.DepPlanPostfix;
if (depPlans.getMember(name) != null) {
- Shell shell = new Shell();
+ Shell shell = Display.getDefault().getActiveShell();
String dialogButtonLabels[] = new String[] {
Messages.CreateDepPlanHandler_Cancel,
Messages.CreateDepPlanHandler_Sync,
@@ -116,7 +117,8 @@ public class CreateDepPlanHandler extends CmdHandler {
Package cdp = depPlans.createNestedPackage(depPlanName);
Stereotype st = StereotypeUtil.apply(cdp, org.eclipse.papyrus.FCM.DeploymentPlan.class);
if (st == null) {
- MessageDialog.openInformation(new Shell(), Messages.CreateDepPlanHandler_CannotCreateDP,
+ MessageDialog.openInformation(Display.getDefault().getActiveShell(),
+ Messages.CreateDepPlanHandler_CannotCreateDP,
Messages.CreateDepPlanHandler_StereoApplicationFailed);
return CommandResult.newErrorCommandResult(Messages.CreateDepPlanHandler_CannotCreateDP);
}
@@ -127,7 +129,7 @@ public class CreateDepPlanHandler extends CmdHandler {
return CommandResult.newOKCommandResult();
}
catch (TransformationException e) {
- MessageDialog.openInformation(new Shell(), Messages.CreateDepPlanHandler_CannotCreateDP,
+ MessageDialog.openInformation(Display.getDefault().getActiveShell(), Messages.CreateDepPlanHandler_CannotCreateDP,
e.getMessage());
return CommandResult.newErrorCommandResult(e.getMessage());
}
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreatePlatformHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreatePlatformHandler.java
index 707a944f077..22dc6281a47 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreatePlatformHandler.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreatePlatformHandler.java
@@ -24,6 +24,7 @@ import org.eclipse.papyrus.qompass.designer.core.deployment.DeployConstants;
import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException;
import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationRTException;
import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.Package;
@@ -67,7 +68,7 @@ public class CreatePlatformHandler extends CmdHandler {
try {
if (platform.getMember(newPlatform) != null) {
- Shell shell = new Shell();
+ Shell shell = Display.getDefault().getActiveShell();
MessageDialog.openInformation(shell, "Error", //$NON-NLS-1$
"Platform definition \"" + newPlatform + "\" exists already"); //$NON-NLS-1$ //$NON-NLS-2$
} else {
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/InstantiateDepPlanHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/InstantiateDepPlanHandler.java
index 4963c0bbd08..ebfef9e8a8e 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/InstantiateDepPlanHandler.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/InstantiateDepPlanHandler.java
@@ -29,7 +29,7 @@ import org.eclipse.papyrus.qompass.designer.core.transformations.InstantiateDepP
import org.eclipse.papyrus.qompass.designer.ui.dialogs.GenerationOptionsDialog;
import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler;
import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
-import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.NamedElement;
@@ -70,7 +70,7 @@ public class InstantiateDepPlanHandler extends CmdHandler {
}
project = ProjectManagement.getCurrentProject();
- GenerationOptionsDialog optionsDialog = new GenerationOptionsDialog(new Shell());
+ GenerationOptionsDialog optionsDialog = new GenerationOptionsDialog(Display.getDefault().getActiveShell());
optionsDialog.open();
if (optionsDialog.getReturnCode() == IDialogConstants.OK_ID) {
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectConnectorHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectConnectorHandler.java
index ebb52f8df69..0dc3eb1607f 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectConnectorHandler.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectConnectorHandler.java
@@ -17,6 +17,7 @@ import org.eclipse.papyrus.qompass.designer.core.CommandSupport;
import org.eclipse.papyrus.qompass.designer.ui.dialogs.ConnectorSelectionDialog;
import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler;
import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.Connector;
@@ -55,7 +56,7 @@ public class SelectConnectorHandler extends CmdHandler {
}
// get selected connector
final Feature selectedFeature = (Feature) selectedEObject;
- Shell shell = new Shell();
+ Shell shell = Display.getDefault().getActiveShell();
// 1. select possible connectors according to port types
// (only show compatible connectors check-box?)
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectContainerHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectContainerHandler.java
index 4a06aa945d0..dd7771eea86 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectContainerHandler.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectContainerHandler.java
@@ -17,6 +17,7 @@ import org.eclipse.papyrus.qompass.designer.core.CommandSupport;
import org.eclipse.papyrus.qompass.designer.core.RunnableWithResult;
import org.eclipse.papyrus.qompass.designer.ui.dialogs.ContainerDialog;
import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.InstanceSpecification;
@@ -60,7 +61,7 @@ public class SelectContainerHandler extends CmdHandler {
}
NamedElement ne = (NamedElement) selectedEObject;
- final Shell shell = new Shell();
+ final Shell shell = Display.getDefault().getActiveShell();
if (ne instanceof Property) {
// treat property as the associated type
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SyncHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SyncHandler.java
index 60d361f6007..93708d5888e 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SyncHandler.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SyncHandler.java
@@ -28,6 +28,7 @@ import org.eclipse.papyrus.qompass.designer.core.sync.InterfaceSync;
import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationRTException;
import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler;
import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.Interface;
@@ -100,7 +101,7 @@ public class SyncHandler extends CmdHandler {
CompImplSync.syncRealizations(selectedClass);
}
catch (TransformationRTException e) {
- MessageDialog.openWarning(new Shell(), "Problems during synchronization", e.getMessage());
+ MessageDialog.openWarning(Display.getDefault().getActiveShell(), "Problems during synchronization", e.getMessage());
return CommandResult.newErrorCommandResult(e.getMessage());
}
@@ -115,7 +116,7 @@ public class SyncHandler extends CmdHandler {
@Override
public void run() {
if (!CompImplSync.syncViaType(selectedClass, false)) {
- MessageDialog.openWarning(new Shell(), "Warning: ineffective command",
+ MessageDialog.openWarning(Display.getDefault().getActiveShell(), "Warning: ineffective command",
"Synchronization applied on a component type (abstract class) will synchronize all implementations, i.e. non-abstract classes inheriting from it. However, the selected type has no implementations");
}
// CompImplSync.syncContextOps (selectedClass, true);
@@ -134,7 +135,7 @@ public class SyncHandler extends CmdHandler {
return CommandResult.newOKCommandResult();
}
catch (TransformationRTException e) {
- Shell shell = new Shell();
+ Shell shell = Display.getDefault().getActiveShell();
MessageDialog.openError(shell, "Can not synchronize deployment plan", e.getMessage());
return CommandResult.newErrorCommandResult(e.getMessage());
}
diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/TracepointPropertiesCommand.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/TracepointPropertiesCommand.java
index cb3c3a1b98e..c61c0834ce1 100644
--- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/TracepointPropertiesCommand.java
+++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/TracepointPropertiesCommand.java
@@ -25,7 +25,7 @@ import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.papyrus.infra.services.tracepoints.TracepointConstants;
import org.eclipse.papyrus.infra.services.tracepoints.dialogs.TraceActionSelection;
-import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.uml2.uml.Element;
@@ -50,7 +50,7 @@ public class TracepointPropertiesCommand extends AbstractTracepointCommand {
IMarker marker = findMarker(TracepointConstants.tpOrbpMarker);
if (marker != null) {
// should normally always hold, since this is checked in canExecute
- TraceActionSelection tad = new TraceActionSelection(new Shell(), marker, (Element) selectedElement);
+ TraceActionSelection tad = new TraceActionSelection(Display.getDefault().getActiveShell(), marker, (Element) selectedElement);
tad.open();
if (tad.getReturnCode() == IDialogConstants.OK_ID) {
Object[] result = tad.getResult();
diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/views/TracepointView.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/views/TracepointView.java
index 388e603b756..d628a81b917 100644
--- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/views/TracepointView.java
+++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/views/TracepointView.java
@@ -64,7 +64,6 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.ISelectionListener;
@@ -447,7 +446,7 @@ public class TracepointView extends ViewPart implements ISelectionListener {
IMarker marker = (IMarker) obj;
EObject eobj = MarkerUtils.getEObjectOfMarker(marker);
if (eobj instanceof Element) {
- TraceActionSelection tad = new TraceActionSelection(new Shell(), (IMarker) obj, (Element) eobj);
+ TraceActionSelection tad = new TraceActionSelection(Display.getDefault().getActiveShell(), (IMarker) obj, (Element) eobj);
tad.open();
if (tad.getReturnCode() == IDialogConstants.OK_ID) {
Object[] result = tad.getResult();

Back to the top