From: Mathieu Baudier Date: Thu, 11 Feb 2021 10:23:52 +0000 (+0100) Subject: Introduce showMainTitle property. X-Git-Tag: argeo-suite-2.1.20~1^2~6 X-Git-Url: https://git.argeo.org/?p=gpl%2Fargeo-suite.git;a=commitdiff_plain;h=44909f08709dd0bde1284e203a2495f03a613ed8 Introduce showMainTitle property. --- diff --git a/publishing/org.argeo.publishing.ui/src/org/argeo/docbook/ui/AbstractDbkViewer.java b/publishing/org.argeo.publishing.ui/src/org/argeo/docbook/ui/AbstractDbkViewer.java index b790358..814cfb3 100644 --- a/publishing/org.argeo.publishing.ui/src/org/argeo/docbook/ui/AbstractDbkViewer.java +++ b/publishing/org.argeo.publishing.ui/src/org/argeo/docbook/ui/AbstractDbkViewer.java @@ -72,6 +72,8 @@ public abstract class AbstractDbkViewer extends AbstractPageViewer implements Ke private final boolean flat; + private boolean showMainTitle = true; + private Integer maxMediaWidth = null; protected AbstractDbkViewer(Section parent, int style, CmsEditable cmsEditable) { @@ -105,12 +107,15 @@ public abstract class AbstractDbkViewer extends AbstractPageViewer implements Ke Node node = section.getNode(); TextSection textSection = (TextSection) section; if (node.hasNode(DbkType.title.get())) { - if (section.getHeader() == null) - section.createHeader(); - Node titleNode = node.getNode(DbkType.title.get()); - DocBookSectionTitle title = newSectionTitle(textSection, titleNode); - title.setLayoutData(CmsUiUtils.fillWidth()); - updateContent(title); + boolean showTitle = getMainSection() == section ? showMainTitle : true; + if (showTitle) { + if (section.getHeader() == null) + section.createHeader(); + Node titleNode = node.getNode(DbkType.title.get()); + DocBookSectionTitle title = newSectionTitle(textSection, titleNode); + title.setLayoutData(CmsUiUtils.fillWidth()); + updateContent(title); + } } for (NodeIterator ni = node.getNodes(); ni.hasNext();) { @@ -937,6 +942,10 @@ public abstract class AbstractDbkViewer extends AbstractPageViewer implements Ke this.maxMediaWidth = maxMediaWidth; } + public void setShowMainTitle(boolean showMainTitle) { + this.showMainTitle = showMainTitle; + } + // FILE UPLOAD LISTENER private class FUL implements FileUploadListener { public void uploadProgress(FileUploadEvent event) {