import org.argeo.cms.ui.viewers.EditablePart;
import org.argeo.cms.ui.viewers.Section;
import org.argeo.cms.ui.widgets.TextStyles;
import org.argeo.cms.ui.viewers.EditablePart;
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;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
/** An editable section. */
public class TextSection extends Section {
private static final long serialVersionUID = -8625209546243220689L;
/** An editable section. */
public class TextSection extends Section {
private static final long serialVersionUID = -8625209546243220689L;
private String titleStyle;
private final boolean flat;
private boolean titleReadOnly = false;
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);
}
public TextSection(Composite parent, int style, Node node) {
this(parent, findSection(parent), style, node);
}
private TextSection(Composite parent, Section parentSection, int style, Node node) {
super(parent, parentSection, style, node);
flat = SWT.FLAT == (style & SWT.FLAT);
private TextSection(Composite parent, Section parentSection, int style, Node node) {
super(parent, parentSection, style, node);
flat = SWT.FLAT == (style & SWT.FLAT);
- // CmsUiUtils.style(this, TextStyles.TEXT_SECTION);
+ if (parentSection instanceof TextSection) {
+ level = ((TextSection) parentSection).getLevel() + 1;
+ } else {
+ level = 0;
+ }
+ CmsUiUtils.style(this, DbkType.section.name());
- Integer relativeDepth = getRelativeDepth();
- return relativeDepth == 0 ? TextStyles.TEXT_TITLE : TextStyles.TEXT_H + relativeDepth;
+// Integer relativeDepth = getRelativeDepth();
+// System.out.println("Level: " + getLevel());
+ return "h" + (getLevel() + 1);