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