Search in sources :

Example 1 with SharedObjectEventListener

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);
}
Also used : EclipseCollabSharedObject(org.eclipse.ecf.example.collab.share.EclipseCollabSharedObject) SharedObjectEventListener(org.eclipse.ecf.example.collab.share.SharedObjectEventListener) ID(org.eclipse.ecf.core.identity.ID)

Aggregations

ID (org.eclipse.ecf.core.identity.ID)1 EclipseCollabSharedObject (org.eclipse.ecf.example.collab.share.EclipseCollabSharedObject)1 SharedObjectEventListener (org.eclipse.ecf.example.collab.share.SharedObjectEventListener)1