projects
/
gpl
/
argeo-suite.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Do not refresh document editor by default.
[gpl/argeo-suite.git]
/
publishing
/
org.argeo.publishing.ui
/
src
/
org
/
argeo
/
docbook
/
ui
/
DocumentTextEditor.java
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 9dc7e1002dea7e68d91f6f4eb1a28532b5a05f75..61c0120e5ec722fdcc9645b24e5d0058f060e6eb 100644
(file)
--- 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,31
+1,28
@@
package org.argeo.docbook.ui;
import javax.jcr.Node;
package org.argeo.docbook.ui;
import javax.jcr.Node;
-import javax.jcr.Property;
import javax.jcr.RepositoryException;
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.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. */
public class DocumentTextEditor extends AbstractDbkViewer {
private static final long serialVersionUID = 6049661610883342325L;
import org.eclipse.swt.widgets.Composite;
/** Text editor where sections and subsections can be managed by the user. */
public class DocumentTextEditor extends AbstractDbkViewer {
private static final long serialVersionUID = 6049661610883342325L;
- public DocumentTextEditor(Composite parent, int style, Node textNode, CmsEditable cmsEditable)
- throws RepositoryException {
+ public DocumentTextEditor(Composite parent, int style, Node textNode, CmsEditable cmsEditable) {
super(new TextSection(parent, style, textNode), style, 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()) {
getMainSection().setLayoutData(CmsUiUtils.fillWidth());
}
@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());
}
// else
// textNode.setProperty(DocBookNames.DBK_TITLE, textNode.getName());
@@
-33,8
+30,8
@@
public class DocumentTextEditor extends AbstractDbkViewer {
@Override
protected Boolean isModelInitialized(Node textNode) throws RepositoryException {
@Override
protected Boolean isModelInitialized(Node textNode) throws RepositoryException {
- return textNode.has
Property(Property.JCR_TITLE) || textNode.hasNode(DocBookNames.DBK_PARA
)
- || (!isFlat() && textNode.hasNode(D
ocBookNames.DBK_SECTION
));
+ return textNode.has
Node(DbkType.title.get()) || textNode.hasNode(DbkType.para.get()
)
+ || (!isFlat() && textNode.hasNode(D
bkType.section.get()
));
}
}
}
}