added confirm message on unsharing

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@87271 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2013-12-20 16:05:40 +00:00
parent f6dcb10a5c
commit 35fcf2c995
2 changed files with 38 additions and 19 deletions

View File

@ -203,8 +203,22 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
folderId = source.getIdentifier();
if(folderId!=null){
String msg = "Unsharing the folder, the files will be removed from your workspace. Continue?";
MessageBoxConfirm mbc = new MessageBoxConfirm("Confirm Unshare?", msg);
rpcWorkspaceService.unSharedFolderByFolderSharedId(folderId, new AsyncCallback<Boolean>() {
final String folderIdentification = folderId;
mbc.getMessageBoxConfirm().addCallback(new Listener<MessageBoxEvent>() {
public void handleEvent(MessageBoxEvent be) {
// eventBus.fireEvent(new DeleteItemEvent(sel));
//IF NOT CANCELLED
String clickedButton = be.getButtonClicked().getItemId();
if(clickedButton.equals(Dialog.YES)){
rpcWorkspaceService.unSharedFolderByFolderSharedId(folderIdentification, new AsyncCallback<Boolean>() {
@Override
public void onFailure(Throwable caught) {
@ -220,6 +234,9 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
}
});
}
}
});
}
}
});

View File

@ -1841,10 +1841,12 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
WorkspaceSharedFolder wsFolder = (WorkspaceSharedFolder) wsItem;
WorkspaceFolder unSharedFolder = wsFolder.unShare();
unShared = unSharedFolder==null?false:true;
// WorkspaceFolder unSharedFolder = wsFolder.unShare();
// unShared = unSharedFolder==null?false:true;
//TEMPORARY SOLUTION
wsFolder.unShare();
unShared = true;
// System.out.println("unShared is "+unShared);
workspaceLogger.trace("unShared is "+ unShared);