From 8ce1471696064b9b136c2973dda64701a008333b Mon Sep 17 00:00:00 2001 From: Francesco Mangiacrapa Date: Wed, 7 Mar 2018 16:46:01 +0000 Subject: [PATCH] Starting work on https://support.d4science.org/issues/11374 git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/workspace-explorer-app@164792 82a268e6-3cf1-43bd-a215-b396298e98cf --- .classpath | 6 +++--- distro/changelog.xml | 8 +++++++- pom.xml | 2 +- .../client/grid/AbstractItemsCellTable.java | 9 ++++++++- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.classpath b/.classpath index 9d55208..3754268 100644 --- a/.classpath +++ b/.classpath @@ -1,12 +1,12 @@ - + - + @@ -33,5 +33,5 @@ - + diff --git a/distro/changelog.xml b/distro/changelog.xml index 22cfedc..8e24c11 100644 --- a/distro/changelog.xml +++ b/distro/changelog.xml @@ -1,7 +1,13 @@ + + [Feature #11374] Download items with double click + + - [Feature #9926] read the scope from environment variable + [Feature #9926] read the scope from environment variable + diff --git a/pom.xml b/pom.xml index 3b2a8b9..7ec4a80 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ org.gcube.portlets.user workspace-explorer-app - 1.1.0-SNAPSHOT + 1.2.0-SNAPSHOT war diff --git a/src/main/java/org/gcube/portlets/user/workspaceexplorerapp/client/grid/AbstractItemsCellTable.java b/src/main/java/org/gcube/portlets/user/workspaceexplorerapp/client/grid/AbstractItemsCellTable.java index 4c2b199..89d73fc 100644 --- a/src/main/java/org/gcube/portlets/user/workspaceexplorerapp/client/grid/AbstractItemsCellTable.java +++ b/src/main/java/org/gcube/portlets/user/workspaceexplorerapp/client/grid/AbstractItemsCellTable.java @@ -3,7 +3,9 @@ package org.gcube.portlets.user.workspaceexplorerapp.client.grid; import java.util.List; import java.util.Set; +import org.gcube.portlets.user.workspaceexplorerapp.client.download.DownloadType; import org.gcube.portlets.user.workspaceexplorerapp.client.event.ClickItemEvent; +import org.gcube.portlets.user.workspaceexplorerapp.client.event.DownloadItemEvent; import org.gcube.portlets.user.workspaceexplorerapp.client.event.LoadFolderEvent; import org.gcube.portlets.user.workspaceexplorerapp.client.event.RightClickItemEvent; import org.gcube.portlets.user.workspaceexplorerapp.shared.Item; @@ -96,7 +98,12 @@ public abstract class AbstractItemsCellTable { Set selected = msm.getSelectedSet(); GWT.log("Double Click: "+selected); if (selected != null && !selected.isEmpty()) { - AbstractItemsCellTable.this.eventBus.fireEvent(new LoadFolderEvent(selected.iterator().next())); + Item item = selected.iterator().next(); + if(item.isFolder() || item.isRoot() || item.isSharedFolder() || item.isSpecialFolder()) + //IN CASE OF FOLDER OPEN IT + AbstractItemsCellTable.this.eventBus.fireEvent(new LoadFolderEvent(selected.iterator().next())); + else //IN CASE OF FILE DOWNLOAD IT... + AbstractItemsCellTable.this.eventBus.fireEvent(new DownloadItemEvent(item, DownloadType.DOWNLOAD)); } } },