]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.cms.ui/src/org/argeo/cms/text/TextSection.java
1 package org
.argeo
.cms
.text
;
4 import javax
.jcr
.RepositoryException
;
6 import org
.argeo
.cms
.CmsNames
;
7 import org
.argeo
.cms
.util
.CmsUtils
;
8 import org
.argeo
.cms
.viewers
.Section
;
9 import org
.eclipse
.swt
.widgets
.Composite
;
11 public class TextSection
extends Section
implements CmsNames
{
12 private static final long serialVersionUID
= -8625209546243220689L;
13 private String defaultTextStyle
= TextStyles
.TEXT_DEFAULT
;
14 private String titleStyle
;
16 public TextSection(Composite parent
, int style
, Node node
)
17 throws RepositoryException
{
18 this(parent
, findSection(parent
), style
, node
);
21 public TextSection(TextSection section
, int style
, Node node
)
22 throws RepositoryException
{
23 this(section
, section
.getParentSection(), style
, node
);
26 private TextSection(Composite parent
, Section parentSection
, int style
,
27 Node node
) throws RepositoryException
{
28 super(parent
, parentSection
, style
, node
);
29 CmsUtils
.style(this, TextStyles
.TEXT_SECTION
);
32 public String
getDefaultTextStyle() {
33 return defaultTextStyle
;
36 public String
getTitleStyle() {
37 if (titleStyle
!= null)
39 // TODO make base H styles configurable
40 Integer relativeDepth
= getRelativeDepth();
41 return relativeDepth
== 0 ? TextStyles
.TEXT_TITLE
: TextStyles
.TEXT_H
45 public void setDefaultTextStyle(String defaultTextStyle
) {
46 this.defaultTextStyle
= defaultTextStyle
;
49 public void setTitleStyle(String titleStyle
) {
50 this.titleStyle
= titleStyle
;