Suite user administration.
[gpl/argeo-suite.git] / org.argeo.suite.ui / src / org / argeo / suite / ui / SuiteUi.java
index c2c3c8943d37678d67d8c75e564c18da203f2e7c..3d1e938eaacd3bbd59e251c1ffe6c14ef09515d4 100644 (file)
@@ -106,10 +106,11 @@ class SuiteUi extends Composite {
                                context = userHome;
                }
                Composite toShow = getLayer(layer, context);
-               getDisplay().syncExec(() -> {
-                       toShow.moveAbove(null);
-                       dynamicArea.layout(true, true);
-               });
+               if (!isDisposed())
+                       getDisplay().syncExec(() -> {
+                               toShow.moveAbove(null);
+                               dynamicArea.layout(true, true);
+                       });
                currentLayerId = layer;
                return toShow;
        }
@@ -172,4 +173,15 @@ class SuiteUi extends Composite {
                return sysSession;
        }
 
+       Session getSession(String workspaceName) {
+               if (workspaceName == null)
+                       return sysSession;
+               if (NodeConstants.SYS_WORKSPACE.equals(workspaceName))
+                       return sysSession;
+               else if (NodeConstants.HOME_WORKSPACE.equals(workspaceName))
+                       return homeSession;
+               else
+                       throw new IllegalArgumentException("Unknown workspace " + workspaceName);
+       }
+
 }