summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-10-08 03:30:16 (EDT)
committerEike Stepper2007-10-08 03:30:16 (EDT)
commit3f2fa2c6a6a58b40e7531ac07869ddaae78e5839 (patch)
treef6d661d991643c7b2fe5f25a44c189fe42a0b270
parentce9ee11e8f91b86f97c2c6a68874042fb37f6b3f (diff)
downloadcdo-3f2fa2c6a6a58b40e7531ac07869ddaae78e5839.zip
cdo-3f2fa2c6a6a58b40e7531ac07869ddaae78e5839.tar.gz
cdo-3f2fa2c6a6a58b40e7531ac07869ddaae78e5839.tar.bz2
[205668] Provide buddies example
https://bugs.eclipse.org/bugs/show_bug.cgi?id=205668
-rw-r--r--plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/Buddy.java4
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/SharedIcons.java4
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesItemProvider.java12
-rw-r--r--plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/Buddy.java4
-rw-r--r--plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/Self.java4
5 files changed, 21 insertions, 7 deletions
diff --git a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/Buddy.java b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/Buddy.java
index 128be57..ec3e66c 100644
--- a/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/Buddy.java
+++ b/plugins/org.eclipse.net4j.buddies.server/src/org/eclipse/net4j/buddies/internal/server/Buddy.java
@@ -10,13 +10,13 @@
**************************************************************************/
package org.eclipse.net4j.buddies.internal.server;
-import org.eclipse.net4j.buddies.protocol.IBuddy;
+import org.eclipse.net4j.buddies.internal.protocol.AbstractBuddy;
import org.eclipse.net4j.buddies.protocol.IBuddyAccount;
/**
* @author Eike Stepper
*/
-public class Buddy implements IBuddy
+public class Buddy extends AbstractBuddy
{
private IBuddyAccount account;
diff --git a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/SharedIcons.java b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/SharedIcons.java
index 7337043..aee44cd 100644
--- a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/SharedIcons.java
+++ b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/SharedIcons.java
@@ -39,6 +39,10 @@ public class SharedIcons
public static final String OBJ_BUDDY = OBJ + "buddy";
+ public static final String OBJ_BUDDY_AWAY = OBJ + "buddy_away";
+
+ public static final String OBJ_BUDDY_DO_NOT_DISTURB = OBJ + "buddy_do_not_disturb";
+
public static Image getImage(String key)
{
key = mangleKey(key);
diff --git a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesItemProvider.java b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesItemProvider.java
index 8234665..d9830e0 100644
--- a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesItemProvider.java
+++ b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesItemProvider.java
@@ -55,7 +55,17 @@ public class BuddiesItemProvider extends ContainerItemProvider<IContainer<Object
if (obj instanceof IBuddy)
{
IBuddy buddy = (IBuddy)obj;
- return SharedIcons.getImage(SharedIcons.OBJ_BUDDY);
+ switch (buddy.getState())
+ {
+ case AVAILABLE:
+ return SharedIcons.getImage(SharedIcons.OBJ_BUDDY);
+
+ case AWAY:
+ return SharedIcons.getImage(SharedIcons.OBJ_BUDDY_AWAY);
+
+ case DO_NOT_DISTURB:
+ return SharedIcons.getImage(SharedIcons.OBJ_BUDDY_DO_NOT_DISTURB);
+ }
}
return super.getImage(obj);
diff --git a/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/Buddy.java b/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/Buddy.java
index e2959bd..1228c27 100644
--- a/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/Buddy.java
+++ b/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/Buddy.java
@@ -10,13 +10,13 @@
**************************************************************************/
package org.eclipse.net4j.internal.buddies;
-import org.eclipse.net4j.buddies.protocol.IBuddy;
+import org.eclipse.net4j.buddies.internal.protocol.AbstractBuddy;
import org.eclipse.net4j.buddies.protocol.IBuddyAccount;
/**
* @author Eike Stepper
*/
-public class Buddy implements IBuddy
+public class Buddy extends AbstractBuddy
{
private BuddySession session;
diff --git a/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/Self.java b/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/Self.java
index 76288e2..cb47fe2 100644
--- a/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/Self.java
+++ b/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/Self.java
@@ -10,13 +10,13 @@
**************************************************************************/
package org.eclipse.net4j.internal.buddies;
-import org.eclipse.net4j.buddies.protocol.IBuddy;
+import org.eclipse.net4j.buddies.internal.protocol.AbstractBuddy;
import org.eclipse.net4j.buddies.protocol.IBuddyAccount;
/**
* @author Eike Stepper
*/
-public class Self implements IBuddy
+public class Self extends AbstractBuddy
{
private BuddySession session;