removed unused code
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@115353 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
f8fec4df8f
commit
66672aa9e8
|
@ -53,9 +53,6 @@ public class DialogShareFolder extends Dialog {
|
|||
|
||||
private List<InfoContactModel> listAlreadyShared = new ArrayList<InfoContactModel>(){
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
@ -75,10 +72,7 @@ public class DialogShareFolder extends Dialog {
|
|||
}
|
||||
|
||||
return false;
|
||||
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -130,7 +124,6 @@ public class DialogShareFolder extends Dialog {
|
|||
|
||||
buttonMultiDrag.setStyleName("wizardButton");
|
||||
|
||||
// buttonMultiDrag.setIcon(Resources.getIconUsers());
|
||||
flexTable.setWidget(1, 0, new Label("Add more"));
|
||||
flexTable.setWidget(1, 1, buttonMultiDrag);
|
||||
|
||||
|
@ -138,40 +131,33 @@ public class DialogShareFolder extends Dialog {
|
|||
flexTable.setWidget(2, 0, labelDescription);
|
||||
flexTable.setWidget(2, 1, textAreaDescription);
|
||||
|
||||
hpPermission = new HorizontalPanel();
|
||||
hpPermission.setVerticalAlign(VerticalAlignment.MIDDLE);
|
||||
Label labelProperty = new Label("Permissions");
|
||||
hpPermission.add(labelProperty);
|
||||
|
||||
AppControllerExplorer.rpcWorkspaceService.getACLs(new AsyncCallback<List<WorkspaceACL>>() {
|
||||
|
||||
// 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());
|
||||
hpPermission.add(labelProperty);
|
||||
|
||||
AppControllerExplorer.rpcWorkspaceService.getACLs(new AsyncCallback<List<WorkspaceACL>>() {
|
||||
@Override
|
||||
public void onSuccess(List<WorkspaceACL> result) {
|
||||
permission = new PanelTogglePermission(result);
|
||||
|
||||
//ONLY IF FOLDER IS ALREADY SHARED, LOOADING CURRENT ACL FROM HL
|
||||
if(folder.isShared())
|
||||
selectAclForFolder(folder);
|
||||
|
||||
hpPermission.add(permission);
|
||||
hpPermission.layout();
|
||||
layout();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(List<WorkspaceACL> result) {
|
||||
permission = new PanelTogglePermission(result);
|
||||
|
||||
//ONLY IF FOLDER IS ALREADY SHARED, LOOADING CURRENT ACL FROM HL
|
||||
if(folder.isShared())
|
||||
selectAclForFolder(folder);
|
||||
|
||||
hpPermission.add(permission);
|
||||
hpPermission.layout();
|
||||
layout();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
hpPermission.add(new Label("Error on recovering ACLs"));
|
||||
hpPermission.layout();
|
||||
layout();
|
||||
}
|
||||
});
|
||||
// }
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
hpPermission.add(new Label("Error on recovering ACLs"));
|
||||
hpPermission.layout();
|
||||
layout();
|
||||
}
|
||||
});
|
||||
|
||||
lc.add(flexTable);
|
||||
if(hpPermission!=null)
|
||||
|
@ -184,14 +170,13 @@ public class DialogShareFolder extends Dialog {
|
|||
|
||||
if(listContacts!=null){
|
||||
for (InfoContactModel infoContactModel : listContacts) {
|
||||
System.out.println(infoContactModel);
|
||||
// System.out.println(infoContactModel);
|
||||
if(infoContactModel!=null && infoContactModel.getName()!=null){
|
||||
listAlreadyShared.add(infoContactModel);
|
||||
suggestPanel.addRecipient(infoContactModel.getName(),false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lc.unmask();
|
||||
}
|
||||
|
||||
|
@ -202,7 +187,7 @@ public class DialogShareFolder extends Dialog {
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
userStore.getOwner(folder.getIdentifier(), new AsyncCallback<InfoContactModel>() {
|
||||
|
||||
@Override
|
||||
|
@ -245,9 +230,7 @@ public class DialogShareFolder extends Dialog {
|
|||
textAreaDescription.setEnabled(bool);
|
||||
if(permission!=null)
|
||||
permission.setEnabled(bool);
|
||||
|
||||
// setEnabled(bool);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public FileModel getParentFolder() {
|
||||
|
@ -306,7 +289,6 @@ public class DialogShareFolder extends Dialog {
|
|||
|
||||
buttonMultiDrag.setStyleName("wizardButton");
|
||||
|
||||
// buttonMultiDrag.setIcon(Resources.getIconUsers());
|
||||
flexTable.setWidget(1, 0, new Label("Add more"));
|
||||
flexTable.setWidget(1, 1, buttonMultiDrag);
|
||||
|
||||
|
@ -314,16 +296,10 @@ public class DialogShareFolder extends Dialog {
|
|||
flexTable.setWidget(2, 0, labelDescription);
|
||||
flexTable.setWidget(2, 1, textAreaDescription);
|
||||
|
||||
|
||||
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());
|
||||
hpPermission.add(labelProperty);
|
||||
|
||||
|
||||
AppControllerExplorer.rpcWorkspaceService.getACLs(new AsyncCallback<List<WorkspaceACL>>() {
|
||||
|
||||
|
@ -342,8 +318,7 @@ public class DialogShareFolder extends Dialog {
|
|||
layout();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
lc.add(flexTable);
|
||||
lc.add(hpPermission);
|
||||
|
||||
|
@ -400,28 +375,16 @@ public class DialogShareFolder extends Dialog {
|
|||
}
|
||||
|
||||
multiDrag.addAlreadySharedContacts(suggestPanel.getSelectedUser());
|
||||
|
||||
// multiDrag.addTargetContacts(suggestPanel.getSelectedUser());
|
||||
|
||||
|
||||
multiDrag.getButtonById(Dialog.OK).addSelectionListener(new SelectionListener<ButtonEvent>() {
|
||||
|
||||
@Override
|
||||
public void componentSelected(ButtonEvent ce) {
|
||||
|
||||
initSuggestContacts();
|
||||
|
||||
for (InfoContactModel infoContactModel : multiDrag.getTargetListContact()) {
|
||||
suggestPanel.addRecipient(infoContactModel.getName(),true);
|
||||
}
|
||||
|
||||
// for (InfoContactModel infoContactModel : multiDrag.getTargetListContact()) {
|
||||
//
|
||||
// if(!listAlreadySharedContains(infoContactModel))
|
||||
// suggestPanel.addRecipient(infoContactModel.getName(),true);
|
||||
// }
|
||||
|
||||
suggestPanel.boxSetFocus();
|
||||
|
||||
// printSelectedUser();
|
||||
}
|
||||
});
|
||||
|
@ -435,16 +398,10 @@ public class DialogShareFolder extends Dialog {
|
|||
return false;
|
||||
|
||||
for (InfoContactModel ct : listAlreadyShared) {
|
||||
|
||||
if(ct.getLogin().compareTo(contact.getLogin())==0){
|
||||
|
||||
if(ct.getLogin().compareTo(contact.getLogin())==0)
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
//DEBUG
|
||||
|
@ -456,14 +413,9 @@ public class DialogShareFolder extends Dialog {
|
|||
}
|
||||
|
||||
private void initSuggestContacts(){
|
||||
|
||||
suggestPanel.resetItemSelected();
|
||||
|
||||
for (InfoContactModel contact : listAlreadyShared) {
|
||||
for (InfoContactModel contact : listAlreadyShared)
|
||||
suggestPanel.addRecipient(contact.getName(), false);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
|
Loading…
Reference in New Issue