use of org.eclipse.ecf.example.collab.share.SharedObjectEventListener in project ecf by eclipse.
the class SharedObjectContainerUI method createAndAddSharedObject.
protected void createAndAddSharedObject(final ISharedObjectContainer soContainer, final ClientEntry client, final IResource proj, IUser user, String fileDir) throws Exception {
final EclipseCollabSharedObject sharedObject = new EclipseCollabSharedObject(soContainer, proj, user, fileDir);
sharedObject.setListener(new SharedObjectEventListener() {
public void memberRemoved(ID member) {
final ID groupID = client.getContainer().getConnectedID();
if (member.equals(groupID)) {
if (!client.isDisposed()) {
collabclient.disposeClient(proj, client);
}
}
}
public void memberAdded(ID member) {
}
public void otherActivated(ID other) {
}
public void otherDeactivated(ID other) {
}
public void windowClosing() {
final ID groupID = client.getContainer().getConnectedID();
CollabClient.removeClientForResource(proj, groupID);
}
});
final ID newID = IDFactory.getDefault().createStringID(COLLAB_SHARED_OBJECT_ID);
soContainer.getSharedObjectManager().addSharedObject(newID, sharedObject, new HashMap());
client.setSharedObject(sharedObject);
}
Aggregations