summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-10-11 05:22:40 (EDT)
committerEike Stepper2007-10-11 05:22:40 (EDT)
commit1fc67683e7b590a543a3f21d4002db595717b434 (patch)
tree7d8c28db45447b8b4a01591499fbc5e5e709d390
parent81f9d19e07f8cfe46c5496000151d9bec4125d87 (diff)
downloadcdo-1fc67683e7b590a543a3f21d4002db595717b434.zip
cdo-1fc67683e7b590a543a3f21d4002db595717b434.tar.gz
cdo-1fc67683e7b590a543a3f21d4002db595717b434.tar.bz2
[205668] Provide buddies example
https://bugs.eclipse.org/bugs/show_bug.cgi?id=205668
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsPane.java13
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsView.java9
-rw-r--r--plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/ClientBuddyStateIndication.java2
-rw-r--r--plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/ClientMessageIndication.java2
-rw-r--r--plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/CollaborationInitiatedIndication.java2
5 files changed, 23 insertions, 5 deletions
diff --git a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsPane.java b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsPane.java
index d580b4d..364f2a2 100644
--- a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsPane.java
+++ b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsPane.java
@@ -11,6 +11,7 @@
package org.eclipse.net4j.buddies.internal.ui.views;
import org.eclipse.net4j.buddies.IBuddyCollaboration;
+import org.eclipse.net4j.buddies.IBuddySession;
import org.eclipse.net4j.buddies.protocol.IFacility;
import org.eclipse.net4j.util.ui.UIUtil;
@@ -36,6 +37,8 @@ public class CollaborationsPane extends Composite
}
};
+ private IBuddySession session;
+
private Map<IFacility, FacilityPane> facilityPanes = new HashMap<IFacility, FacilityPane>();
private Map<IBuddyCollaboration, IFacility> activeFacilities = new HashMap<IBuddyCollaboration, IFacility>();
@@ -54,6 +57,16 @@ public class CollaborationsPane extends Composite
return collaborationsView;
}
+ public IBuddySession getSession()
+ {
+ return session;
+ }
+
+ public void setSession(IBuddySession session)
+ {
+ this.session = session;
+ }
+
@Override
public void dispose()
{
diff --git a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsView.java b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsView.java
index 2f5d5a3..51f9ad0 100644
--- a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsView.java
+++ b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsView.java
@@ -55,13 +55,18 @@ public class CollaborationsView extends SessionManagerView
@Override
protected void fillLocalToolBar(IToolBarManager manager)
{
- // manager.add(new AvailableAction());
- // manager.add(new AwayAction());
manager.add(new Separator());
super.fillLocalToolBar(manager);
}
@Override
+ protected void queryBuddiesManager()
+ {
+ super.queryBuddiesManager();
+ getCollaborationsPane().setSession(getSession());
+ }
+
+ @Override
protected IContainer<?> getContainer()
{
return getSession() != null ? getSession().getSelf() : ContainerUtil.emptyContainer();
diff --git a/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/ClientBuddyStateIndication.java b/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/ClientBuddyStateIndication.java
index d6eb5e6..ec36325 100644
--- a/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/ClientBuddyStateIndication.java
+++ b/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/ClientBuddyStateIndication.java
@@ -27,7 +27,7 @@ public class ClientBuddyStateIndication extends BuddyStateIndication
}
else
{
- ClientBuddy buddy = (ClientBuddy)session.getBuddies().get(userID);
+ ClientBuddy buddy = (ClientBuddy)session.getBuddy(userID);
if (buddy != null)
{
buddy.setState(state);
diff --git a/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/ClientMessageIndication.java b/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/ClientMessageIndication.java
index 935997e..ea18964 100644
--- a/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/ClientMessageIndication.java
+++ b/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/ClientMessageIndication.java
@@ -31,7 +31,7 @@ public class ClientMessageIndication extends MessageIndication
Self self = session.getSelf();
long collaborationID = message.getCollaborationID();
- Collaboration collaboration = (Collaboration)self.getCollaborations().get(collaborationID);
+ Collaboration collaboration = (Collaboration)self.getCollaboration(collaborationID);
collaboration.notifyMessage(message);
break;
}
diff --git a/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/CollaborationInitiatedIndication.java b/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/CollaborationInitiatedIndication.java
index da6a26c..9ef2337 100644
--- a/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/CollaborationInitiatedIndication.java
+++ b/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/protocol/CollaborationInitiatedIndication.java
@@ -51,7 +51,7 @@ public class CollaborationInitiatedIndication extends Indication
for (int i = 0; i < size; i++)
{
String userID = in.readString();
- IBuddy buddy = session.getBuddies().get(userID);
+ IBuddy buddy = session.getBuddy(userID);
if (buddy != null)
{
buddies.add(buddy);