X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.publishing.ui%2Fsrc%2Forg%2Fargeo%2Fdocbook%2Fui%2FAbstractDbkViewer.java;h=c9e21831bfb1a8865967a308bfcae5948bff93ca;hb=41e9998f7f1c87c747c57f60c6bec65fa20757a6;hp=e9000936128b2f94f850475471b28161399911dc;hpb=3440f51df3e4c015972c7b6a0efb3ce16188b89b;p=gpl%2Fargeo-suite.git diff --git a/org.argeo.publishing.ui/src/org/argeo/docbook/ui/AbstractDbkViewer.java b/org.argeo.publishing.ui/src/org/argeo/docbook/ui/AbstractDbkViewer.java index e900093..c9e2183 100644 --- a/org.argeo.publishing.ui/src/org/argeo/docbook/ui/AbstractDbkViewer.java +++ b/org.argeo.publishing.ui/src/org/argeo/docbook/ui/AbstractDbkViewer.java @@ -1,6 +1,5 @@ package org.argeo.docbook.ui; -import static org.argeo.cms.ui.util.CmsUiUtils.fillWidth; import static org.argeo.docbook.DbkType.para; import static org.argeo.docbook.DbkUtils.addDbk; import static org.argeo.docbook.DbkUtils.isDbk; @@ -17,10 +16,10 @@ import javax.jcr.NodeIterator; import javax.jcr.RepositoryException; import javax.jcr.Session; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.cms.ui.CmsEditable; -import org.argeo.cms.ui.util.CmsUiUtils; +import org.argeo.api.cms.Cms2DSize; +import org.argeo.api.cms.CmsEditable; +import org.argeo.api.cms.CmsLog; +import org.argeo.cms.swt.CmsSwtUtils; import org.argeo.cms.ui.viewers.AbstractPageViewer; import org.argeo.cms.ui.viewers.EditablePart; import org.argeo.cms.ui.viewers.NodePart; @@ -57,7 +56,7 @@ import org.eclipse.swt.widgets.Text; /** Base class for text viewers and editors. */ public abstract class AbstractDbkViewer extends AbstractPageViewer implements KeyListener, Observer { private static final long serialVersionUID = -2401274679492339668L; - private final static Log log = LogFactory.getLog(AbstractDbkViewer.class); + private final static CmsLog log = CmsLog.getLog(AbstractDbkViewer.class); private final Section mainSection; @@ -102,13 +101,13 @@ public abstract class AbstractDbkViewer extends AbstractPageViewer implements Ke long begin = System.currentTimeMillis(); Section section = (Section) control; if (section instanceof TextSection) { - CmsUiUtils.clear(section); + CmsSwtUtils.clear(section); Node node = section.getNode(); TextSection textSection = (TextSection) section; String style = node.hasProperty(DbkAttr.role.name()) ? node.getProperty(DbkAttr.role.name()).getString() : getDefaultSectionStyle(); if (style != null) - CmsUiUtils.style(textSection, style); + CmsSwtUtils.style(textSection, style); // Title Node titleNode = null; @@ -125,7 +124,7 @@ public abstract class AbstractDbkViewer extends AbstractPageViewer implements Ke if (section.getHeader() == null) section.createHeader(); DbkSectionTitle title = newSectionTitle(textSection, titleNode); - title.setLayoutData(CmsUiUtils.fillWidth()); + title.setLayoutData(CmsSwtUtils.fillWidth()); updateContent(title); } } @@ -157,7 +156,7 @@ public abstract class AbstractDbkViewer extends AbstractPageViewer implements Ke throw new IllegalArgumentException("Unsupported node type for " + child); } if (sectionPart != null && sectionPart instanceof Control) - ((Control) sectionPart).setLayoutData(CmsUiUtils.fillWidth()); + ((Control) sectionPart).setLayoutData(CmsSwtUtils.fillWidth()); } // if (!flat) @@ -165,7 +164,7 @@ public abstract class AbstractDbkViewer extends AbstractPageViewer implements Ke Node child = ni.nextNode(); if (isDbk(child, DbkType.section)) { TextSection newSection = newTextSection(section, child); - newSection.setLayoutData(CmsUiUtils.fillWidth()); + newSection.setLayoutData(CmsSwtUtils.fillWidth()); refresh(newSection); } } @@ -192,7 +191,7 @@ public abstract class AbstractDbkViewer extends AbstractPageViewer implements Ke protected Paragraph newParagraph(TextSection parent, Node node) throws RepositoryException { Paragraph paragraph = new Paragraph(parent, parent.getStyle(), node); updateContent(paragraph); - paragraph.setLayoutData(fillWidth()); + paragraph.setLayoutData(CmsSwtUtils.fillWidth()); paragraph.setMouseListener(getMouseListener()); paragraph.setFocusListener(getFocusListener()); return paragraph; @@ -205,9 +204,9 @@ public abstract class AbstractDbkViewer extends AbstractPageViewer implements Ke if (maxMediaWidth != null) { imgGd = new GridData(SWT.CENTER, SWT.FILL, false, false); imgGd.widthHint = maxMediaWidth; - img.setPreferredSize(new Point(maxMediaWidth, 0)); + img.setPreferredSize(new Cms2DSize(maxMediaWidth, 0)); } else { - imgGd = CmsUiUtils.grabWidth(SWT.CENTER, SWT.DEFAULT); + imgGd = CmsSwtUtils.grabWidth(SWT.CENTER, SWT.DEFAULT); } img.setLayoutData(imgGd); updateContent(img); @@ -691,7 +690,7 @@ public abstract class AbstractDbkViewer extends AbstractPageViewer implements Ke getTextInterpreter().write(titleNode, txt); TextSection newSection = new TextSection(section, section.getStyle(), newSectionNode); - newSection.setLayoutData(CmsUiUtils.fillWidth()); + newSection.setLayoutData(CmsSwtUtils.fillWidth()); newSection.moveBelow(paragraph); // dispose @@ -801,7 +800,7 @@ public abstract class AbstractDbkViewer extends AbstractPageViewer implements Ke Section section = paragraph.getSection(); updateContent(paragraph); Paragraph newParagraph = newParagraph((TextSection) section, newNode); - newParagraph.setLayoutData(CmsUiUtils.fillWidth()); + newParagraph.setLayoutData(CmsSwtUtils.fillWidth()); newParagraph.moveBelow(paragraph); layout(paragraph.getControl(), newParagraph.getControl()); return newParagraph;