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
This commit is contained in:
parent
d0bcd5d4da
commit
d5968130c0
|
@ -50,7 +50,7 @@ public class DialogShareFolder extends Dialog {
|
|||
private Button buttonMultiDrag = new Button("Choose Contacts");
|
||||
private TextField<String> txtOwner;
|
||||
private PanelTogglePermission permission;
|
||||
private HorizontalPanel vpPermission = null;
|
||||
private HorizontalPanel hpPermission = null;
|
||||
|
||||
private List<InfoContactModel> listAlreadyShared = new ArrayList<InfoContactModel>(){
|
||||
|
||||
|
@ -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<List<WorkspaceACL>>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(List<WorkspaceACL> 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<List<InfoContactModel>>() {
|
||||
|
||||
|
@ -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<List<WorkspaceACL>>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(List<WorkspaceACL> 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);
|
||||
|
|
Loading…
Reference in New Issue