Make CMS wizard more robust
[lgpl/argeo-commons.git] / org.argeo.eclipse.ui / src / org / argeo / eclipse / ui / dialogs / LightweightDialog.java
index e816ec718dbb4fd30ad81e44af83d0fbc523d616..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() {
@@ -224,7 +224,7 @@ public class LightweightDialog {
 
        public void setTitle(String title) {
                this.title = title;
-               if (getForegoundShell() != null)
+               if (title != null && getForegoundShell() != null)
                        getForegoundShell().setText(title);
        }