X-Git-Url: https://git.argeo.org/?p=gpl%2Fargeo-suite.git;a=blobdiff_plain;f=publishing%2Forg.argeo.publishing.ui%2Fsrc%2Forg%2Fargeo%2Fdocbook%2Fui%2FDocumentTextEditor.java;h=bac3fc36f8544e18530771d6f18065a0a9504dca;hp=7bb5132e35bff8b00da88815240edc7536781df3;hb=70010c4afc5799622fcad5b075740d94da074798;hpb=3f1e729ef4c76d9c946906a0983e62013945c1ef 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 7bb5132..bac3fc3 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 @@ -1,12 +1,13 @@ package org.argeo.docbook.ui; import javax.jcr.Node; -import javax.jcr.Property; 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.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. */ @@ -22,9 +23,7 @@ public class DocumentTextEditor extends AbstractDbkViewer { @Override protected void initModel(Node textNode) throws RepositoryException { if (isFlat()) { - textNode.addNode(DocBookNames.DBK_PARA, DocBookTypes.PARA) - .addNode(DocBookNames.JCR_XMLTEXT, DocBookTypes.XMLTEXT) - .setProperty(DocBookNames.JCR_XMLCHARACTERS, "Hello World!"); + DbkUtils.addParagraph(textNode, ""); } // else // textNode.setProperty(DocBookNames.DBK_TITLE, textNode.getName()); @@ -32,8 +31,8 @@ public class DocumentTextEditor extends AbstractDbkViewer { @Override protected Boolean isModelInitialized(Node textNode) throws RepositoryException { - return textNode.hasProperty(Property.JCR_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())); } }