]>
git.argeo.org Git - gpl/argeo-suite.git/blob - 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
.jcr
.Jcr
;
10 import org
.argeo
.jcr
.JcrxType
;
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 textNode
.addNode(DocBookNames
.DBK_PARA
, DocBookTypes
.PARA
).addNode(Jcr
.JCR_XMLTEXT
, JcrxType
.JCRX_XMLTEXT
)
27 .setProperty(Jcr
.JCR_XMLCHARACTERS
, "");
30 // textNode.setProperty(DocBookNames.DBK_TITLE, textNode.getName());
34 protected Boolean
isModelInitialized(Node textNode
) throws RepositoryException
{
35 return textNode
.hasNode(DocBookTypes
.TITLE
) || textNode
.hasNode(DocBookNames
.DBK_PARA
)
36 || (!isFlat() && textNode
.hasNode(DocBookNames
.DBK_SECTION
));