]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.cms.ui/src/org/argeo/cms/util/SimpleErgonomics.java
Introduce Tokens and Argeo Studio styling
[lgpl/argeo-commons.git] / org.argeo.cms.ui / src / org / argeo / cms / util / SimpleErgonomics.java
index a16587a2268d7c864bdcabc2287fba4329496722..37464079155e3a4097325ae656f5b82d4c024997 100644 (file)
@@ -34,7 +34,7 @@ public class SimpleErgonomics extends AbstractCmsEntryPoint {
        private final CmsUiProvider uiProvider;
 
        private CmsUiProvider header;
-       private Integer headerHeight = 40;
+       private Integer headerHeight = 0;
 
        private CmsImageManager imageManager = new ImageManagerImpl();
        private UxContext uxContext = null;
@@ -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();
        }
@@ -82,6 +83,9 @@ public class SimpleErgonomics extends AbstractCmsEntryPoint {
        }
 
        protected void refreshHeader() {
+               if (header == null)
+                       return;
+
                for (Control child : headerArea.getChildren())
                        child.dispose();
                try {
@@ -111,8 +115,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);
                }