Improve DocBook support.
[gpl/argeo-suite.git] / publishing / org.argeo.publishing.ui / src / org / argeo / cms / text / TextSection.java
index ef4bb0f38d2cbc39908320f14bcdf085e519e191..4f514bf763c4ad380262e9eb40c0863409c5ef28 100644 (file)
@@ -5,6 +5,7 @@ import javax.jcr.Node;
 import org.argeo.cms.ui.util.CmsUiUtils;
 import org.argeo.cms.ui.viewers.Section;
 import org.argeo.cms.ui.widgets.TextStyles;
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
 
 public class TextSection extends Section implements CmsNames {
@@ -12,6 +13,10 @@ public class TextSection extends Section implements CmsNames {
        private String defaultTextStyle = TextStyles.TEXT_DEFAULT;
        private String titleStyle;
 
+       private final boolean flat;
+
+       private boolean titleReadOnly = false;
+
        public TextSection(Composite parent, int style, Node node) {
                this(parent, findSection(parent), style, node);
        }
@@ -22,13 +27,18 @@ public class TextSection extends Section implements CmsNames {
 
        private TextSection(Composite parent, Section parentSection, int style, Node node) {
                super(parent, parentSection, style, node);
-               CmsUiUtils.style(this, TextStyles.TEXT_SECTION);
+               flat = SWT.FLAT == (style & SWT.FLAT);
+               //CmsUiUtils.style(this, TextStyles.TEXT_SECTION);
        }
 
        public String getDefaultTextStyle() {
                return defaultTextStyle;
        }
 
+       public boolean isFlat() {
+               return flat;
+       }
+
        public String getTitleStyle() {
                if (titleStyle != null)
                        return titleStyle;
@@ -44,4 +54,13 @@ public class TextSection extends Section implements CmsNames {
        public void setTitleStyle(String titleStyle) {
                this.titleStyle = titleStyle;
        }
+
+       public boolean isTitleReadOnly() {
+               return titleReadOnly;
+       }
+
+       public void setTitleReadOnly(boolean titleReadOnly) {
+               this.titleReadOnly = titleReadOnly;
+       }
+
 }