From d5968130c0131e58a1dfb8fec0a4f6d1cbebe908 Mon Sep 17 00:00:00 2001 From: Francesco Mangiacrapa Date: Mon, 17 Feb 2014 10:15:20 +0000 Subject: [PATCH] added panel permissions in New Shared Folder git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@91748 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../view/sharing/DialogShareFolder.java | 53 ++++++++----------- 1 file changed, 21 insertions(+), 32 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/sharing/DialogShareFolder.java b/src/main/java/org/gcube/portlets/user/workspace/client/view/sharing/DialogShareFolder.java index 9cad4bd..2ee6ddc 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/view/sharing/DialogShareFolder.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/sharing/DialogShareFolder.java @@ -50,7 +50,7 @@ public class DialogShareFolder extends Dialog { private Button buttonMultiDrag = new Button("Choose Contacts"); private TextField txtOwner; private PanelTogglePermission permission; - private HorizontalPanel vpPermission = null; + private HorizontalPanel hpPermission = null; private List listAlreadyShared = new ArrayList(){ @@ -115,9 +115,6 @@ public class DialogShareFolder extends Dialog { textAreaDescription.setHeight(heightTextArea); textAreaDescription.setWidth(380); - //TODO REMOVE -// System.out.println("folder description: "+folder.getDescription()); - textAreaDescription.setValue(folder.getDescription()); // textAreaDescription.setReadOnly(true); @@ -143,43 +140,38 @@ public class DialogShareFolder extends Dialog { flexTable.setWidget(2, 1, textAreaDescription); - if(!folder.isShared()){ //SETTABLE PERMISSION ONLY IF FOLDER IS NOT ALREADY SHARED - vpPermission = new HorizontalPanel(); - vpPermission.setVerticalAlign(VerticalAlignment.MIDDLE); +// if(!folder.isShared()){ //SETTABLE PERMISSION ONLY IF FOLDER IS NOT ALREADY SHARED + hpPermission = new HorizontalPanel(); + hpPermission.setVerticalAlign(VerticalAlignment.MIDDLE); Label labelProperty = new Label("Permissions"); // final ToggleButton togglePermission = new ToggleButton("Set Permissions"); // flexTable.setWidget(3, 0, labelProperty); // flexTable.setWidget(3, 1, Resources.getIconLoading().createImage()); - vpPermission.add(labelProperty); + hpPermission.add(labelProperty); AppControllerExplorer.rpcWorkspaceService.getACLs(new AsyncCallback>() { @Override public void onSuccess(List result) { permission = new PanelTogglePermission(result); -// flexTable.setWidget(3, 1, permission); -// lc.layout(); - vpPermission.add(permission); - vpPermission.layout(); + hpPermission.add(permission); + hpPermission.layout(); layout(); } @Override public void onFailure(Throwable caught) { - -// flexTable.setWidget(3, 1, new Label("Error on recovering ACLs")); - - vpPermission.add(new Label("Error on recovering ACLs")); - vpPermission.layout(); + hpPermission.add(new Label("Error on recovering ACLs")); + hpPermission.layout(); layout(); } }); - } +// } lc.add(flexTable); - if(vpPermission!=null) - lc.add(vpPermission); + if(hpPermission!=null) + lc.add(hpPermission); lc.mask(); userStore.getListSharedUserByFolderId(folder.getIdentifier(), new AsyncCallback>() { @@ -316,40 +308,37 @@ public class DialogShareFolder extends Dialog { flexTable.setWidget(2, 1, textAreaDescription); - vpPermission = new HorizontalPanel(); - vpPermission.setVerticalAlign(VerticalAlignment.MIDDLE); + hpPermission = new HorizontalPanel(); + hpPermission.setVerticalAlign(VerticalAlignment.MIDDLE); Label labelProperty = new Label("Permissions"); // final ToggleButton togglePermission = new ToggleButton("Set Permissions"); // flexTable.setWidget(3, 0, labelProperty); // flexTable.setWidget(3, 1, Resources.getIconLoading().createImage()); - vpPermission.add(labelProperty); + hpPermission.add(labelProperty); + AppControllerExplorer.rpcWorkspaceService.getACLs(new AsyncCallback>() { @Override public void onSuccess(List result) { permission = new PanelTogglePermission(result); -// flexTable.setWidget(3, 1, permission); -// lc.layout(); - vpPermission.add(permission); - vpPermission.layout(); + hpPermission.add(permission); + hpPermission.layout(); layout(); } @Override public void onFailure(Throwable caught) { - -// flexTable.setWidget(3, 1, new Label("Error on recovering ACLs")); - - vpPermission.add(new Label("Error on recovering ACLs")); - vpPermission.layout(); + hpPermission.add(new Label("Error on recovering ACLs")); + hpPermission.layout(); layout(); } }); lc.add(flexTable); + lc.add(hpPermission); setFocusWidget(txtName); add(txtName);