]>
git.argeo.org Git - gpl/argeo-suite.git/blob - publishing/org.argeo.publishing.ui/src/org/argeo/docbook/ui/DocumentTextEditor.java
1 package org
.argeo
.docbook
.ui
;
4 import javax
.jcr
.RepositoryException
;
6 import org
.argeo
.cms
.text
.TextSection
;
7 import org
.argeo
.cms
.ui
.CmsEditable
;
8 import org
.argeo
.cms
.ui
.util
.CmsUiUtils
;
9 import org
.argeo
.docbook
.DbkUtils
;
10 import org
.argeo
.docbook
.DbkType
;
11 import org
.eclipse
.swt
.widgets
.Composite
;
13 /** Text editor where sections and subsections can be managed by the user. */
14 public class DocumentTextEditor
extends AbstractDbkViewer
{
15 private static final long serialVersionUID
= 6049661610883342325L;
17 public DocumentTextEditor(Composite parent
, int style
, Node textNode
, CmsEditable cmsEditable
) {
18 super(new TextSection(parent
, style
, textNode
), style
, cmsEditable
);
20 getMainSection().setLayoutData(CmsUiUtils
.fillWidth());
24 protected void initModel(Node textNode
) throws RepositoryException
{
26 DbkUtils
.addParagraph(textNode
, "");
29 // textNode.setProperty(DocBookNames.DBK_TITLE, textNode.getName());
33 protected Boolean
isModelInitialized(Node textNode
) throws RepositoryException
{
34 return textNode
.hasNode(DbkType
.title
.get()) || textNode
.hasNode(DbkType
.para
.get())
35 || (!isFlat() && textNode
.hasNode(DbkType
.section
.get()));