From bfe68d240859f57c36c56c196b7913d3d741aa09 Mon Sep 17 00:00:00 2001 From: Ron Anderson Date: Thu, 25 Feb 2016 10:13:16 -0600 Subject: [PATCH] Omaha #5054 Fix ValuesDialog when run without active workbench (GFE Autotests) Change-Id: I9604f77298ac56b511d0b05859db4c146dbd2e7f Former-commit-id: afb2a11dfe8bdc6ba5aa85affa38052349c717a8 --- .../raytheon/viz/gfe/ui/runtimeui/ValuesDialog.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/ui/runtimeui/ValuesDialog.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/ui/runtimeui/ValuesDialog.java index a81f0804e1..fe8c34f480 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/ui/runtimeui/ValuesDialog.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/ui/runtimeui/ValuesDialog.java @@ -122,7 +122,7 @@ public class ValuesDialog extends CaveJFACEDialog { @Override protected void createButtonsForButtonBar(Composite parent) { - if (callback != null || closeAfterRun) { + if ((callback != null) || closeAfterRun) { createButton(parent, ButtonConstant.RUN.id, ButtonConstant.RUN.label, false); createButton(parent, ButtonConstant.RUN_DISMISS.id, @@ -301,10 +301,15 @@ public class ValuesDialog extends CaveJFACEDialog { @Override public void run() { - Shell shell = PlatformUI.getWorkbench() - .getActiveWorkbenchWindow().getShell(); + Shell shell = null; + if (PlatformUI.isWorkbenchRunning()) { + shell = PlatformUI.getWorkbench() + .getActiveWorkbenchWindow().getShell(); + } + syncedDialog = new ValuesDialog(shell, title, fieldDefs, dataMgr); + syncedDialog.setShellStyle(SWT.MODELESS | SWT.TITLE | SWT.RESIZE); syncedDialog.open();