X-Git-Url: https://git.argeo.org/?p=gpl%2Fargeo-suite.git;a=blobdiff_plain;f=publishing%2Forg.argeo.publishing.ui%2Fsrc%2Forg%2Fargeo%2Fdocbook%2Fui%2FTextSection.java;fp=publishing%2Forg.argeo.publishing.ui%2Fsrc%2Forg%2Fargeo%2Fdocbook%2Fui%2FTextSection.java;h=0000000000000000000000000000000000000000;hp=76ba661c3fd00461c962f023bd19fe7cff7f9c5d;hb=3440f51df3e4c015972c7b6a0efb3ce16188b89b;hpb=752a7b2614895002a3d184be166ef4162caf0d05 diff --git a/publishing/org.argeo.publishing.ui/src/org/argeo/docbook/ui/TextSection.java b/publishing/org.argeo.publishing.ui/src/org/argeo/docbook/ui/TextSection.java deleted file mode 100644 index 76ba661..0000000 --- a/publishing/org.argeo.publishing.ui/src/org/argeo/docbook/ui/TextSection.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.argeo.docbook.ui; - -import javax.jcr.Node; - -import org.argeo.cms.ui.util.CmsUiUtils; -import org.argeo.cms.ui.viewers.EditablePart; -import org.argeo.cms.ui.viewers.Section; -import org.argeo.cms.ui.widgets.TextStyles; -import org.argeo.docbook.DbkType; -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; - private String defaultTextStyle = DbkType.para.name(); - private String titleStyle; - - private final boolean flat; - - private boolean titleReadOnly = false; - - private final int level; - - public TextSection(Composite parent, int style, Node node) { - this(parent, findSection(parent), style, node); - } - - public TextSection(TextSection section, int style, Node node) { - this(section, section.getParentSection(), style, node); - } - - private TextSection(Composite parent, Section parentSection, int style, Node node) { - super(parent, parentSection, style, node); - flat = SWT.FLAT == (style & SWT.FLAT); - if (parentSection instanceof TextSection) { - level = ((TextSection) parentSection).getLevel() + 1; - } else { - level = 0; - } - CmsUiUtils.style(this, DbkType.section.name()); - } - - public String getDefaultTextStyle() { - return defaultTextStyle; - } - - public boolean isFlat() { - return flat; - } - - /** The level of this section, similar to h1, h2, etc. in HTML. */ - public int getLevel() { - return level; - } - - public String getTitleStyle() { - if (titleStyle != null) - return titleStyle; - // TODO make base H styles configurable -// Integer relativeDepth = getRelativeDepth(); -// System.out.println("Level: " + getLevel()); - return "h" + (getLevel() + 1); - } - - public void setDefaultTextStyle(String defaultTextStyle) { - this.defaultTextStyle = defaultTextStyle; - } - - public void setTitleStyle(String titleStyle) { - this.titleStyle = titleStyle; - } - - public boolean isTitleReadOnly() { - return titleReadOnly; - } - - public void setTitleReadOnly(boolean titleReadOnly) { - this.titleReadOnly = titleReadOnly; - } -}