X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.library.ui%2Fsrc%2Forg%2Fargeo%2Flibrary%2Fui%2FDocumentsFileComposite.java;h=c9f4889592f8ef66822a3858199f4c20934ac42d;hb=41e9998f7f1c87c747c57f60c6bec65fa20757a6;hp=10cf3bd14f492b60d7fc68c8238d534be040bcf2;hpb=3440f51df3e4c015972c7b6a0efb3ce16188b89b;p=gpl%2Fargeo-suite.git diff --git a/org.argeo.library.ui/src/org/argeo/library/ui/DocumentsFileComposite.java b/org.argeo.library.ui/src/org/argeo/library/ui/DocumentsFileComposite.java index 10cf3bd..c9f4889 100644 --- a/org.argeo.library.ui/src/org/argeo/library/ui/DocumentsFileComposite.java +++ b/org.argeo.library.ui/src/org/argeo/library/ui/DocumentsFileComposite.java @@ -6,10 +6,8 @@ import java.nio.file.Path; import java.nio.file.spi.FileSystemProvider; import javax.jcr.Node; -import javax.jcr.RepositoryException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.argeo.api.cms.CmsLog; import org.argeo.cms.fs.CmsFsUtils; import org.argeo.cms.ui.util.CmsUiUtils; import org.argeo.eclipse.ui.EclipseUiUtils; @@ -30,15 +28,14 @@ import org.eclipse.swt.widgets.Label; public class DocumentsFileComposite extends Composite { private static final long serialVersionUID = -7567632342889241793L; - private final static Log log = LogFactory.getLog(DocumentsFileComposite.class); + private final static CmsLog log = CmsLog.getLog(DocumentsFileComposite.class); private final Node currentBaseContext; // UI Parts for the browser private Composite rightPannelCmp; - public DocumentsFileComposite(Composite parent, int style, Node context, - FileSystemProvider fsp) { + public DocumentsFileComposite(Composite parent, int style, Node context, FileSystemProvider fsp) { super(parent, style); this.currentBaseContext = context; this.setLayout(EclipseUiUtils.noSpaceGridLayout()); @@ -61,19 +58,15 @@ public class DocumentsFileComposite extends Composite { // browser.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, // true)); browser.setLayoutData(EclipseUiUtils.fillAll()); - try { - // FIXME make it more robust - String url = CmsUiUtils.getDataUrl(currentBaseContext, UiContext.getHttpRequest()); - // FIXME issue with the redirection to https - if (url.startsWith("http://") && !url.startsWith("http://localhost")) - url = "https://" + url.substring("http://".length(), url.length()); - if (log.isTraceEnabled()) - log.debug("Trying to display " + url); - browser.setUrl(url); - browser.layout(true, true); - } catch (RepositoryException re) { - throw new IllegalStateException("Cannot open file at " + currentBaseContext, re); - } + // FIXME make it more robust + String url = CmsUiUtils.getDataUrl(currentBaseContext, UiContext.getHttpRequest()); + // FIXME issue with the redirection to https + if (url.startsWith("http://") && !url.startsWith("http://localhost")) + url = "https://" + url.substring("http://".length(), url.length()); + if (log.isTraceEnabled()) + log.debug("Trying to display " + url); + browser.setUrl(url); + browser.layout(true, true); } /** @@ -118,8 +111,8 @@ public class DocumentsFileComposite extends Composite { // Simplify UI implementation private void addProperty(Composite parent, String propName, String value) { Label propLbl = new Label(parent, SWT.NONE); - //propLbl.setText(ConnectUtils.replaceAmpersand(propName + ": " + value)); + // propLbl.setText(ConnectUtils.replaceAmpersand(propName + ": " + value)); propLbl.setText(value); - //CmsUiUtils.markup(propLbl); + // CmsUiUtils.markup(propLbl); } }