Make CMS wizard more robust
authorMathieu Baudier <mbaudier@argeo.org>
Sat, 19 May 2018 17:49:52 +0000 (19:49 +0200)
committerMathieu Baudier <mbaudier@argeo.org>
Sat, 19 May 2018 17:49:52 +0000 (19:49 +0200)
org.argeo.cms.ui/src/org/argeo/cms/ui/dialogs/CmsWizardDialog.java
org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/dialogs/LightweightDialog.java

index 24835afc00963c901762c3b2e122170faaa2402e..80fe3c85fc7b48c78be69a3b0532cf2493e5fdb8 100644 (file)
@@ -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
index 6d45e8cf21bc35ecae4be693ff993efdf807a4bc..6cc80f3ddec1d1e757b668e3f313c1e9e677fb90 100644 (file)
@@ -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() {