diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesListViewDetailPanel.java b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesListViewDetailPanel.java index f960529..c512807 100644 --- a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesListViewDetailPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesListViewDetailPanel.java @@ -1,5 +1,7 @@ package org.gcube.portlets.user.td.resourceswidget.client; +import java.util.ArrayList; + import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.InternalURITD; import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.ResourceTD; import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.ResourceTDDescriptor; @@ -315,7 +317,9 @@ public class ResourcesListViewDetailPanel extends SimpleContainer { } private void requestRemove() { - parent.requestRemove(descriptor); + ArrayList resources=new ArrayList(); + resources.add(descriptor); + parent.requestRemove(resources); } diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesListViewPanel.java b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesListViewPanel.java index 9fa40f5..4584536 100644 --- a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesListViewPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesListViewPanel.java @@ -382,7 +382,7 @@ public class ResourcesListViewPanel extends FramedPanel { } })); - listView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE); + listView.getSelectionModel().setSelectionMode(SelectionMode.MULTI); listView.getSelectionModel().addSelectionChangedHandler( new SelectionChangedHandler() { @Override @@ -569,8 +569,12 @@ public class ResourcesListViewPanel extends FramedPanel { @Override public void onSelection(SelectionEvent event) { - ResourceTDDescriptor selected = listView.getSelectionModel() - .getSelectedItem(); + List resources= listView.getSelectionModel() + .getSelectedItems(); + ResourceTDDescriptor selected=null; + if(resources!=null&&resources.size()>0){ + selected=resources.get(0); + } Log.debug("selected: " + selected); requestOpen(selected); } @@ -584,8 +588,12 @@ public class ResourcesListViewPanel extends FramedPanel { @Override public void onSelection(SelectionEvent event) { - ResourceTDDescriptor selected = listView.getSelectionModel() - .getSelectedItem(); + List resources= listView.getSelectionModel() + .getSelectedItems(); + ResourceTDDescriptor selected=null; + if(resources!=null&&resources.size()>0){ + selected=resources.get(0); + } Log.debug("selected: " + selected); requestSave(selected); } @@ -599,10 +607,11 @@ public class ResourcesListViewPanel extends FramedPanel { @Override public void onSelection(SelectionEvent event) { - ResourceTDDescriptor selected = listView.getSelectionModel() - .getSelectedItem(); + List selected= listView.getSelectionModel() + .getSelectedItems(); Log.debug("selected: " + selected); - requestRemove(selected); + ArrayList resources=new ArrayList(selected); + requestRemove(resources); } }); @@ -770,10 +779,11 @@ public class ResourcesListViewPanel extends FramedPanel { }); } - protected void requestRemove(ResourceTDDescriptor resourceTDDescriptor) { - + protected void requestRemove(ArrayList resourcesList) { + ArrayList resources=new ArrayList(resourcesList); + removeResourceSession = new RemoveResourceSession(trId, - resourceTDDescriptor); + resources); TDGWTServiceAsync.INSTANCE.removeResource(removeResourceSession, new AsyncCallback() { diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesPanel.java b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesPanel.java index d02dd50..f317e16 100644 --- a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesPanel.java @@ -601,9 +601,12 @@ public class ResourcesPanel extends FramedPanel { } protected void requestRemove(ResourceTDDescriptor resourceTDDescriptor) { - + ArrayList resources=new ArrayList(); + resources.add(resourceTDDescriptor); + + removeResourceSession = new RemoveResourceSession(trId, - resourceTDDescriptor); + resources); TDGWTServiceAsync.INSTANCE.removeResource(removeResourceSession, new AsyncCallback() {