Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Eidsness2014-05-26 10:55:16 +0000
committerDoug Schaefer2014-05-26 13:47:24 +0000
commite0682a2412d31e133d3ea605c532c913ca08fa1a (patch)
tree04e78e5a9a605ed4f7cf5c15f71dd3b01fc80b90
parent251d54056ed6e8114ffd75b98be460fb8ce82f16 (diff)
downloadorg.eclipse.cdt-e0682a2412d31e133d3ea605c532c913ca08fa1a.tar.gz
org.eclipse.cdt-e0682a2412d31e133d3ea605c532c913ca08fa1a.tar.xz
org.eclipse.cdt-e0682a2412d31e133d3ea605c532c913ca08fa1a.zip
Shouldn't use new SWT.Shell()
I noticed that one case in the template engine is creating a dialog that uses it's own instance of SWT Shell (i.e., the code contains "new Shell()". This patch modifies that case to use the display's active shell instead. Change-Id: I253d6540899ce4dfef033924e27e2ddcd62ded19 Signed-off-by: Andrew Eidsness <eclipse@jfront.com> Reviewed-on: https://git.eclipse.org/r/27278 Tested-by: Hudson CI Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
-rw-r--r--core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/pages/TemplateInputDialog.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/pages/TemplateInputDialog.java b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/pages/TemplateInputDialog.java
index 42882200ed1..a3381a3c4ee 100644
--- a/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/pages/TemplateInputDialog.java
+++ b/core/org.eclipse.cdt.ui/templateengine/org/eclipse/cdt/ui/templateengine/pages/TemplateInputDialog.java
@@ -274,12 +274,17 @@ public class TemplateInputDialog extends Dialog {
public int popDuplicate() {
- MessageBox mBox = new MessageBox(new Shell(), SWT.ICON_INFORMATION);
- mBox.setText(TemplatePreferencePage.Message);
- mBox.setMessage(TemplatePreferencePage.DuplicateEntry);
- int result = mBox.open();
- return result;
-
+ final int[] result = new int[]{ 0 };
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ MessageBox mBox = new MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_INFORMATION);
+ mBox.setText(TemplatePreferencePage.Message);
+ mBox.setMessage(TemplatePreferencePage.DuplicateEntry);
+ result[0] = mBox.open();
+ }
+ });
+ return result[0];
}
/*

Back to the top