]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.cms.ui/src/org/argeo/cms/util/SimpleErgonomics.java
Make lightweight dialog more robust
[lgpl/argeo-commons.git] / org.argeo.cms.ui / src / org / argeo / cms / util / SimpleErgonomics.java
index a16587a2268d7c864bdcabc2287fba4329496722..505d482f3befd2e9de8a9ee35c3ce210c0d42661 100644 (file)
@@ -50,7 +50,9 @@ public class SimpleErgonomics extends AbstractCmsEntryPoint {
                parent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
                parent.setLayout(CmsUtils.noSpaceGridLayout());
 
-               // createAdminArea(parent);
+               uxContext = new SimpleUxContext();
+               if (!getUxContext().isMasterData())
+                       createAdminArea(parent);
                headerArea = new Composite(parent, SWT.NONE);
                headerArea.setLayout(new FillLayout());
                GridData headerData = new GridData(SWT.FILL, SWT.FILL, false, false);
@@ -61,7 +63,6 @@ public class SimpleErgonomics extends AbstractCmsEntryPoint {
                bodyArea.setData(RWT.CUSTOM_VARIANT, CmsStyles.CMS_BODY);
                bodyArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
                bodyArea.setLayout(CmsUtils.noSpaceGridLayout());
-               uxContext = new SimpleUxContext();
                uiInitialized = true;
                refresh();
        }
@@ -111,8 +112,9 @@ public class SimpleErgonomics extends AbstractCmsEntryPoint {
                try {
                        Node node = getNode();
                        if (node == null)
-                               throw new CmsException("Context cannot be null");
-                       uiProvider.createUi(bodyArea, node);
+                               log.error("Context cannot be null");
+                       else
+                               uiProvider.createUi(bodyArea, node);
                } catch (RepositoryException e) {
                        throw new CmsException("Cannot refresh body", e);
                }