From be23cc6f53178ac5108bc3f6cdca88d237ab1b7e Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Sat, 19 May 2018 19:49:52 +0200 Subject: [PATCH] Make CMS wizard more robust --- .../src/org/argeo/cms/ui/dialogs/CmsWizardDialog.java | 3 ++- .../src/org/argeo/eclipse/ui/dialogs/LightweightDialog.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/dialogs/CmsWizardDialog.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/dialogs/CmsWizardDialog.java index 24835afc0..80fe3c85f 100644 --- a/org.argeo.cms.ui/src/org/argeo/cms/ui/dialogs/CmsWizardDialog.java +++ b/org.argeo.cms.ui/src/org/argeo/cms/ui/dialogs/CmsWizardDialog.java @@ -128,7 +128,8 @@ public class CmsWizardDialog extends LightweightDialog implements IWizardContain back.setEnabled(wizard.getPreviousPage(currentPage) != null); if (next != null) next.setEnabled(wizard.getNextPage(currentPage) != null && currentPage.canFlipToNextPage()); - finish.setEnabled(wizard.canFinish()); + if (finish != null) + finish.setEnabled(wizard.canFinish()); } @Override diff --git a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/dialogs/LightweightDialog.java b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/dialogs/LightweightDialog.java index 6d45e8cf2..6cc80f3dd 100644 --- a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/dialogs/LightweightDialog.java +++ b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/dialogs/LightweightDialog.java @@ -71,7 +71,6 @@ public class LightweightDialog { // backgroundShell.setMaximized(true); backgroundShell.setAlpha(128); backgroundShell.setBackground(getDisplay().getSystemColor(SWT.COLOR_BLACK)); - backgroundShell.open(); foregoundShell = new Shell(backgroundShell, SWT.NO_TRIM | SWT.ON_TOP); if (title != null) setTitle(title); @@ -103,6 +102,7 @@ public class LightweightDialog { }); + backgroundShell.open(); foregoundShell.open(); // after the foreground shell has been opened backgroundShell.addFocusListener(new FocusListener() { -- 2.30.2