summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-11-12 06:30:48 (EST)
committerEike Stepper2007-11-12 06:30:48 (EST)
commit7a6b61767e984fd82d2ec58ef890ed58536bc302 (patch)
tree66de968a13c597926edd582bb845c194eaf01d9c
parent8dd25fd9067322ce2dab81b248b6bf3dc15eef31 (diff)
downloadcdo-7a6b61767e984fd82d2ec58ef890ed58536bc302.zip
cdo-7a6b61767e984fd82d2ec58ef890ed58536bc302.tar.gz
cdo-7a6b61767e984fd82d2ec58ef890ed58536bc302.tar.bz2
[209380] Add invitation capability for multi buddy collaborations
https://bugs.eclipse.org/bugs/show_bug.cgi?id=209380
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/CollaborationsItemProvider.java26
-rw-r--r--plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/ClientCollaborationLeftIndication.java10
-rw-r--r--plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerItemProvider.java1
3 files changed, 25 insertions, 12 deletions
diff --git a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/CollaborationsItemProvider.java b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/CollaborationsItemProvider.java
index ef27016..01138b2 100644
--- a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/CollaborationsItemProvider.java
+++ b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/CollaborationsItemProvider.java
@@ -10,8 +10,12 @@
**************************************************************************/
package org.eclipse.net4j.buddies.internal.ui;
+import org.eclipse.net4j.buddies.protocol.ICollaboration;
import org.eclipse.net4j.buddies.protocol.IMembership;
import org.eclipse.net4j.internal.buddies.Self;
+import org.eclipse.net4j.util.event.IEvent;
+import org.eclipse.net4j.util.event.IListener;
+import org.eclipse.net4j.util.lifecycle.ILifecycleEvent;
import org.eclipse.net4j.util.ui.views.IElementFilter;
import org.eclipse.swt.graphics.Image;
@@ -79,7 +83,7 @@ public class CollaborationsItemProvider extends AbstractItemProvider
/**
* @author Eike Stepper
*/
- private class SelfNode extends AbstractContainerNode
+ private class SelfNode extends AbstractContainerNode implements IListener
{
private Self self;
@@ -104,10 +108,30 @@ public class CollaborationsItemProvider extends AbstractItemProvider
return self;
}
+ public void notifyEvent(IEvent event)
+ {
+ IMembership membership = (IMembership)event.getSource();
+ if (event instanceof ILifecycleEvent)
+ {
+ ILifecycleEvent e = (ILifecycleEvent)event;
+ if (e.getKind() == ILifecycleEvent.Kind.DEACTIVATED)
+ {
+ membership.removeListener(this);
+ ICollaboration collaboration = membership.getCollaboration();
+ Node node = getNode(collaboration);
+ if (node != null)
+ {
+ node.dispose();
+ }
+ }
+ }
+ }
+
@Override
protected Node addChild(Collection<Node> children, Object element)
{
IMembership membership = (IMembership)element;
+ membership.addListener(this);
return super.addChild(children, membership.getCollaboration());
}
}
diff --git a/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/ClientCollaborationLeftIndication.java b/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/ClientCollaborationLeftIndication.java
index cb98d4b..4286280 100644
--- a/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/ClientCollaborationLeftIndication.java
+++ b/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/ClientCollaborationLeftIndication.java
@@ -10,8 +10,6 @@
**************************************************************************/
package org.eclipse.net4j.internal.buddies.protocol;
-import org.eclipse.net4j.buddies.internal.protocol.Buddy;
-import org.eclipse.net4j.buddies.internal.protocol.Collaboration;
import org.eclipse.net4j.buddies.internal.protocol.CollaborationLeftIndication;
import org.eclipse.net4j.internal.buddies.Self;
@@ -24,12 +22,4 @@ public class ClientCollaborationLeftIndication extends CollaborationLeftIndicati
{
super(self.getSession(), self);
}
-
- @Override
- protected void collaborationLeft(Buddy buddy, Collaboration collaboration)
- {
- buddy.removeMembership(collaboration);
- collaboration.removeMembership(buddy);
- super.collaborationLeft(buddy, collaboration);
- }
}
diff --git a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerItemProvider.java b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerItemProvider.java
index d66edf6..a917e7c 100644
--- a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerItemProvider.java
+++ b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerItemProvider.java
@@ -456,7 +456,6 @@ public class ContainerItemProvider<CONTAINER extends IContainer<Object>> extends
public Object getElement()
{
- checkNotDisposed();
return container;
}
}