Omaha #5054 Fix ValuesDialog when run without active workbench (GFE Autotests)

Change-Id: I9604f77298ac56b511d0b05859db4c146dbd2e7f

Former-commit-id: afb2a11dfe8bdc6ba5aa85affa38052349c717a8
This commit is contained in:
Ron Anderson 2016-02-25 10:13:16 -06:00
parent 2c3c687750
commit bfe68d2408

View file

@ -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();