From: Mathieu Baudier Date: Sat, 19 May 2018 17:49:52 +0000 (+0200) Subject: Make CMS wizard more robust X-Git-Tag: argeo-commons-2.1.74~29 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=be23cc6f53178ac5108bc3f6cdca88d237ab1b7e;p=lgpl%2Fargeo-commons.git Make CMS wizard more robust --- 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() {