68 lines
1.6 KiB
Java
68 lines
1.6 KiB
Java
package org.gcube.portlets.user.td.sharewidget.client;
|
|
|
|
|
|
public class TRShare {
|
|
public TRShare() {
|
|
//FileModel file = new FileModel("id", "filename", false);
|
|
|
|
/**
|
|
* This controller instance the smart sharing dialog
|
|
*
|
|
* @param file
|
|
* - a fake file to display the field name ("filename") into
|
|
* dialog
|
|
* @param listAlreadySharedContact
|
|
*/
|
|
/*
|
|
WorkspaceSmartSharingController controller = new WorkspaceSmartSharingController(
|
|
file, null);
|
|
|
|
final Dialog sharingWindow = controller.getSharingDialog();
|
|
|
|
Button openSharingWindow = new Button("Show Sharing Window",
|
|
new ClickHandler() {
|
|
public void onClick(ClickEvent event) {
|
|
sharingWindow.show();
|
|
}
|
|
});
|
|
|
|
sharingWindow.getButtonById(Dialog.OK).addListener(Events.Select,
|
|
new Listener<BaseEvent>() {
|
|
|
|
@Override
|
|
public void handleEvent(BaseEvent be) {
|
|
|
|
if (smartShare.isValidForm(true)) {
|
|
// THAT'S OK
|
|
|
|
sharingWindow.getSharedListUsers(); // @return the
|
|
// selected
|
|
// contacts (as
|
|
// InfoContactModel)
|
|
|
|
sharingWindow.getSharedListUsersCredential(); // @return
|
|
// the
|
|
// selected
|
|
// contacts
|
|
// (as
|
|
// CredentialModel)
|
|
|
|
for (InfoContactModel contact : sharingWindow
|
|
.getSharedListUsers()) {
|
|
System.out.println(contact);
|
|
}
|
|
|
|
for (CredentialModel credential : sharingWindow
|
|
.getSharedListUsersCredential()) {
|
|
System.out.println(credential);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
});
|
|
*/
|
|
}
|
|
|
|
}
|