From 9a3a772961154978baa21b920209874e03f3a97d Mon Sep 17 00:00:00 2001 From: Francesco Mangiacrapa Date: Wed, 10 Oct 2018 16:42:44 +0000 Subject: [PATCH] working on copy git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@173230 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../user/workspace/client/AppController.java | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/AppController.java b/src/main/java/org/gcube/portlets/user/workspace/client/AppController.java index 3051186..2004648 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/AppController.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/AppController.java @@ -1960,28 +1960,28 @@ public class AppController implements SubscriberInterface { * @see org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface#pasteEventIsCompleted() */ @Override - public void moveEventIsCompleted(boolean refreshingTheTree, String parentId) { + public void moveEventIsCompleted(boolean refreshingTheTree, String destinationFolderId) { wsPortlet.getGridGroupContainer().unmask(); if(refreshingTheTree){ wsPortlet.getGridGroupContainer().unmask(); }else{ //FORCE GRID REFRESH - FileModel theFolder = wsPortlet.getToolBarPath().getParentFolder(parentId); + FileModel theFolder = wsPortlet.getToolBarPath().getParentFolder(destinationFolderId); GWT.log("moveEventIsCompleted tree is not refreshable"); if(theFolder!=null){ //THE FOLDER IS IN THE BREADCRUMB - GWT.log("Comparing breadcrumb id: "+theFolder.getIdentifier() + " and parent id: "+parentId); - if(theFolder.getIdentifier().compareToIgnoreCase(parentId)==0){ + GWT.log("Comparing breadcrumb id: "+theFolder.getIdentifier() + " and parent id: "+destinationFolderId); + if(theFolder.getIdentifier().compareToIgnoreCase(destinationFolderId)==0){ eventBus.fireEvent(new GridRefreshEvent()); } }else{ //MOVING HAS BEEN PERFORMED IN A FOLDER MISSING IN THE BREADCRUMB, SO LOADING IT A NEW ONE //FOR DISPLAYING - GWT.log("Loading grid on the parent folder of: "+parentId); + GWT.log("Loading grid on the parent folder of: "+destinationFolderId); - AppControllerExplorer.rpcWorkspaceService.getParentByItemId(parentId, new AsyncCallback() { + AppControllerExplorer.rpcWorkspaceService.getParentByItemId(destinationFolderId, new AsyncCallback() { @Override public void onFailure(Throwable caught) { @@ -2001,13 +2001,21 @@ public class AppController implements SubscriberInterface { } - /* (non-Javadoc) * @see org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface#copyEventIsCompleted() */ @Override - public void copyEventIsCompleted() { - //wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().activePasteButton(true); + public void copyEventIsCompleted(String destinationFolderId) { + + wsPortlet.getGridGroupContainer().unmask(); + FileModel theFolder = wsPortlet.getToolBarPath().getParentFolder(destinationFolderId); + if(theFolder!=null){ + //THE FOLDER IS IN THE BREADCRUMB + GWT.log("Comparing breadcrumb id: "+theFolder.getIdentifier() + " and destination folder id: "+destinationFolderId); + if(theFolder.getIdentifier().compareToIgnoreCase(destinationFolderId)==0){ + eventBus.fireEvent(new GridRefreshEvent()); + } + } }