]>
git.argeo.org Git - gpl/argeo-suite.git/blob - publishing/org.argeo.publishing.ui/src/org/argeo/cms/text/TextSection.java
1 package org
.argeo
.cms
.text
;
5 import org
.argeo
.cms
.ui
.util
.CmsUiUtils
;
6 import org
.argeo
.cms
.ui
.viewers
.Section
;
7 import org
.argeo
.cms
.ui
.widgets
.TextStyles
;
8 import org
.eclipse
.swt
.widgets
.Composite
;
10 public class TextSection
extends Section
implements CmsNames
{
11 private static final long serialVersionUID
= -8625209546243220689L;
12 private String defaultTextStyle
= TextStyles
.TEXT_DEFAULT
;
13 private String titleStyle
;
15 public TextSection(Composite parent
, int style
, Node node
) {
16 this(parent
, findSection(parent
), style
, node
);
19 public TextSection(TextSection section
, int style
, Node node
) {
20 this(section
, section
.getParentSection(), style
, node
);
23 private TextSection(Composite parent
, Section parentSection
, int style
, Node node
) {
24 super(parent
, parentSection
, style
, node
);
25 CmsUiUtils
.style(this, TextStyles
.TEXT_SECTION
);
28 public String
getDefaultTextStyle() {
29 return defaultTextStyle
;
32 public String
getTitleStyle() {
33 if (titleStyle
!= null)
35 // TODO make base H styles configurable
36 Integer relativeDepth
= getRelativeDepth();
37 return relativeDepth
== 0 ? TextStyles
.TEXT_TITLE
: TextStyles
.TEXT_H
+ relativeDepth
;
40 public void setDefaultTextStyle(String defaultTextStyle
) {
41 this.defaultTextStyle
= defaultTextStyle
;
44 public void setTitleStyle(String titleStyle
) {
45 this.titleStyle
= titleStyle
;