Improve UX
[lgpl/argeo-commons.git] / swt / org.argeo.cms.swt / src / org / argeo / cms / swt / acr / SwtSection.java
index 89d003870d7fbf51256b3d304f58a0279165bac1..f4f5961ca7c22530907c36800c5821a2a64ee587 100644 (file)
@@ -11,7 +11,7 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 
-/** A structured UI related to a JCR context. */
+/** A structured UI related to an ACR context. */
 public class SwtSection extends ContentComposite {
        private static final long serialVersionUID = -5933796173755739207L;
 
@@ -27,10 +27,14 @@ public class SwtSection extends ContentComposite {
                this(section, section, style, node);
        }
 
+       public SwtSection(SwtSection section, int style) {
+               this(section, style, null);
+       }
+
        protected SwtSection(Composite parent, SwtSection parentSection, int style, Content node) {
                super(parent, style, node);
                this.parentSection = parentSection;
-               if (parentSection != null) {
+               if (parentSection != null && hasContent() && parentSection.hasContent()) {
                        relativeDepth = getProvidedContent().getDepth() - parentSection.getProvidedContent().getDepth();
                } else {
                        relativeDepth = 0;