X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=publishing%2Forg.argeo.publishing.ui%2Fsrc%2Forg%2Fargeo%2Fdocbook%2Fui%2FDocumentTextEditor.java;h=61c0120e5ec722fdcc9645b24e5d0058f060e6eb;hb=752a7b2614895002a3d184be166ef4162caf0d05;hp=bdd72d59aad819a845178509a6a8b815c2b64d97;hpb=12715aaf68a7dcaf97efe3895f41f0c7a9440dd2;p=gpl%2Fargeo-suite.git diff --git a/publishing/org.argeo.publishing.ui/src/org/argeo/docbook/ui/DocumentTextEditor.java b/publishing/org.argeo.publishing.ui/src/org/argeo/docbook/ui/DocumentTextEditor.java index bdd72d5..61c0120 100644 --- a/publishing/org.argeo.publishing.ui/src/org/argeo/docbook/ui/DocumentTextEditor.java +++ b/publishing/org.argeo.publishing.ui/src/org/argeo/docbook/ui/DocumentTextEditor.java @@ -3,11 +3,10 @@ package org.argeo.docbook.ui; import javax.jcr.Node; import javax.jcr.RepositoryException; -import org.argeo.cms.text.TextSection; import org.argeo.cms.ui.CmsEditable; import org.argeo.cms.ui.util.CmsUiUtils; -import org.argeo.jcr.Jcr; -import org.argeo.jcr.JcrxType; +import org.argeo.docbook.DbkUtils; +import org.argeo.docbook.DbkType; import org.eclipse.swt.widgets.Composite; /** Text editor where sections and subsections can be managed by the user. */ @@ -16,15 +15,14 @@ public class DocumentTextEditor extends AbstractDbkViewer { public DocumentTextEditor(Composite parent, int style, Node textNode, CmsEditable cmsEditable) { super(new TextSection(parent, style, textNode), style, cmsEditable); - refresh(); +// refresh(); getMainSection().setLayoutData(CmsUiUtils.fillWidth()); } @Override protected void initModel(Node textNode) throws RepositoryException { if (isFlat()) { - textNode.addNode(DocBookNames.DBK_PARA, DocBookTypes.PARA).addNode(Jcr.JCR_XMLTEXT, JcrxType.JCRX_XMLTEXT) - .setProperty(Jcr.JCR_XMLCHARACTERS, ""); + DbkUtils.addParagraph(textNode, ""); } // else // textNode.setProperty(DocBookNames.DBK_TITLE, textNode.getName()); @@ -32,8 +30,8 @@ public class DocumentTextEditor extends AbstractDbkViewer { @Override protected Boolean isModelInitialized(Node textNode) throws RepositoryException { - return textNode.hasNode(DocBookTypes.TITLE) || textNode.hasNode(DocBookNames.DBK_PARA) - || (!isFlat() && textNode.hasNode(DocBookNames.DBK_SECTION)); + return textNode.hasNode(DbkType.title.get()) || textNode.hasNode(DbkType.para.get()) + || (!isFlat() && textNode.hasNode(DbkType.section.get())); } }