From: Bruno Sinou Date: Wed, 9 Mar 2011 22:45:26 +0000 (+0000) Subject: -> Finalisation of file download for RAP X-Git-Tag: argeo-commons-2.1.30~1378 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=d2ed44a6c5968200c6ba18809dc0845749072b7f;p=lgpl%2Fargeo-commons.git -> Finalisation of file download for RAP -> some little UI Bugs git-svn-id: https://svn.argeo.org/commons/trunk@4277 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/eclipse/runtime/org.argeo.eclipse.ui.jcr/pom.xml b/eclipse/runtime/org.argeo.eclipse.ui.jcr/pom.xml index 5e42d87ad..b3aa8239b 100644 --- a/eclipse/runtime/org.argeo.eclipse.ui.jcr/pom.xml +++ b/eclipse/runtime/org.argeo.eclipse.ui.jcr/pom.xml @@ -31,12 +31,12 @@ lazy + org.eclipse.ui;resolution:=optional,org.eclipse.rap.ui;resolution:=optional,org.eclipse.core.runtime org.eclipse.swt, org.argeo.eclipse.ui.specific, * - org.eclipse.ui;resolution:=optional,org.eclipse.rap.ui;resolution:=optional,org.eclipse.core.runtime @@ -94,6 +94,5 @@ org.slf4j com.springsource.slf4j.org.apache.commons.logging - diff --git a/eclipse/runtime/org.argeo.eclipse.ui.rap/pom.xml b/eclipse/runtime/org.argeo.eclipse.ui.rap/pom.xml index 9a92853bd..7dcb9622b 100644 --- a/eclipse/runtime/org.argeo.eclipse.ui.rap/pom.xml +++ b/eclipse/runtime/org.argeo.eclipse.ui.rap/pom.xml @@ -32,12 +32,17 @@ lazy org.argeo.eclipse.ui.ArgeoUiPlugin - org.eclipse.rap.ui,org.eclipse.core.runtime + org.eclipse.rap.ui,org.eclipse.rwt.widgets.upload,org.eclipse.core.runtime + org.apache.commons.io, org.argeo, org.springframework.beans.factory, org.springframework.core.io.support, + !org.eclipse.rwt.widgets, !org.eclipse.core.runtime, !org.eclipse.core.commands, !org.eclipse.ui.plugin, @@ -66,6 +71,11 @@ ${version.argeo-commons} + + org.argeo.dep.rap + org.eclipse.rwt.widgets.upload + + org.slf4j diff --git a/eclipse/runtime/org.argeo.eclipse.ui.rcp/src/main/java/org/argeo/eclipse/ui/specific/FileHandler.java b/eclipse/runtime/org.argeo.eclipse.ui.rcp/src/main/java/org/argeo/eclipse/ui/specific/FileHandler.java index 93e9d9213..b9c4d31d3 100644 --- a/eclipse/runtime/org.argeo.eclipse.ui.rcp/src/main/java/org/argeo/eclipse/ui/specific/FileHandler.java +++ b/eclipse/runtime/org.argeo.eclipse.ui.rcp/src/main/java/org/argeo/eclipse/ui/specific/FileHandler.java @@ -17,10 +17,12 @@ import org.argeo.ArgeoException; */ public class FileHandler { - public FileHandler() { + // unused file provider : collateral effects of single sourcing, this File + // provider is compulsory for RAP file handler + public FileHandler(FileProvider jfp) { } - public void openFile(String fileName, InputStream is) { + public void openFile(String fileName, String fileId, InputStream is) { String prefix = "", extension = ""; if (fileName != null) { @@ -44,7 +46,7 @@ public class FileHandler { } } - public void openFile(File file) { + private void openFile(File file) { try { Desktop desktop = null; if (Desktop.isDesktopSupported()) { diff --git a/eclipse/runtime/org.argeo.eclipse.ui.rcp/src/main/java/org/argeo/eclipse/ui/specific/FileProvider.java b/eclipse/runtime/org.argeo.eclipse.ui.rcp/src/main/java/org/argeo/eclipse/ui/specific/FileProvider.java new file mode 100644 index 000000000..ba4946d8f --- /dev/null +++ b/eclipse/runtime/org.argeo.eclipse.ui.rcp/src/main/java/org/argeo/eclipse/ui/specific/FileProvider.java @@ -0,0 +1,14 @@ +package org.argeo.eclipse.ui.specific; + +/** + * Used for file download : subclasses must implement model specific methods to + * get a byte array representing a file given is ID. + * + * @author bsinou + * + */ +public interface FileProvider { + + public byte[] getByteArrayFileFromId(String fileId); + +}