summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-11-10 03:19:02 (EST)
committerEike Stepper2007-11-10 03:19:02 (EST)
commit1f56c2e90579798c8a922db1a3d7cacd26348fd3 (patch)
tree55cabeeb397f4d44cfcde895bd532c74e616f64a
parent3f84f8dfc10de7660802999e3d31b19c2995d3d8 (diff)
downloadcdo-1f56c2e90579798c8a922db1a3d7cacd26348fd3.zip
cdo-1f56c2e90579798c8a922db1a3d7cacd26348fd3.tar.gz
cdo-1f56c2e90579798c8a922db1a3d7cacd26348fd3.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/views/BuddiesDragListener.java9
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesDropAdapter.java9
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesView.java9
-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/BuddyCollaboration.java5
5 files changed, 25 insertions, 16 deletions
diff --git a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesDragListener.java b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesDragListener.java
index 1c64745..ce20f67 100644
--- a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesDragListener.java
+++ b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesDragListener.java
@@ -16,6 +16,8 @@ import org.eclipse.net4j.util.ui.dnd.DNDDragListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.Transfer;
import java.util.ArrayList;
import java.util.Collection;
@@ -26,6 +28,8 @@ import java.util.Iterator;
*/
public class BuddiesDragListener extends DNDDragListener<IBuddy[]>
{
+ private static final Transfer[] TRANSFERS = new Transfer[] { BuddiesTransfer.INSTANCE };
+
public BuddiesDragListener(StructuredViewer viewer)
{
super(BuddiesTransfer.INSTANCE, viewer);
@@ -52,4 +56,9 @@ public class BuddiesDragListener extends DNDDragListener<IBuddy[]>
return buddies.toArray(new IBuddy[buddies.size()]);
}
+
+ public static void support(StructuredViewer viewer)
+ {
+ viewer.addDragSupport(DND.DROP_MOVE, TRANSFERS, new BuddiesDragListener(viewer));
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesDropAdapter.java b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesDropAdapter.java
index d62bc80..c823720 100644
--- a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesDropAdapter.java
+++ b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesDropAdapter.java
@@ -16,12 +16,16 @@ import org.eclipse.net4j.buddies.protocol.IBuddy;
import org.eclipse.net4j.util.ui.dnd.DNDDropAdapter;
import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.Transfer;
/**
* @author Eike Stepper
*/
public class BuddiesDropAdapter extends DNDDropAdapter<IBuddy[]>
{
+ private static final Transfer[] TRANSFERS = new Transfer[] { BuddiesTransfer.INSTANCE };
+
public BuddiesDropAdapter(StructuredViewer viewer)
{
super(BuddiesTransfer.INSTANCE, viewer);
@@ -41,4 +45,9 @@ public class BuddiesDropAdapter extends DNDDropAdapter<IBuddy[]>
{
return target instanceof IBuddyCollaboration;
}
+
+ public static void support(StructuredViewer viewer)
+ {
+ viewer.addDropSupport(DND.DROP_MOVE, TRANSFERS, new BuddiesDropAdapter(viewer));
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesView.java b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesView.java
index fdc12db..8af47fd 100644
--- a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesView.java
+++ b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesView.java
@@ -11,15 +11,11 @@
package org.eclipse.net4j.buddies.internal.ui.views;
import org.eclipse.net4j.buddies.IBuddyCollaboration;
-import org.eclipse.net4j.buddies.internal.ui.dnd.BuddiesTransfer;
import org.eclipse.net4j.buddies.protocol.IBuddy;
import org.eclipse.net4j.buddies.protocol.ICollaboration;
import org.eclipse.net4j.util.container.ContainerUtil;
import org.eclipse.net4j.util.container.IContainer;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
@@ -39,9 +35,8 @@ public class BuddiesView extends SessionManagerView
protected Control createControl(Composite parent)
{
Control control = super.createControl(parent);
- TreeViewer viewer = getViewer();
- Transfer[] transfers = new Transfer[] { BuddiesTransfer.INSTANCE };
- viewer.addDragSupport(DND.DROP_MOVE, transfers, new BuddiesDragListener(viewer));
+ BuddiesDragListener.support(getViewer());
+ BuddiesDropAdapter.support(getViewer());
return control;
}
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 0977621..c7ee766 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
@@ -12,7 +12,6 @@ package org.eclipse.net4j.buddies.internal.ui.views;
import org.eclipse.net4j.buddies.IBuddyCollaboration;
import org.eclipse.net4j.buddies.internal.ui.bundle.OM;
-import org.eclipse.net4j.buddies.internal.ui.dnd.BuddiesTransfer;
import org.eclipse.net4j.buddies.ui.IFacilityPaneCreator;
import org.eclipse.net4j.internal.buddies.ClientBuddy;
import org.eclipse.net4j.util.StringUtil;
@@ -32,10 +31,7 @@ import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
@@ -89,10 +85,7 @@ public class CollaborationsView extends SessionManagerView
bars.getToolBarManager().add(new Separator());
getCollaborationsPane().fillActionBars(bars);
- TreeViewer viewer = getViewer();
- Transfer[] transfers = new Transfer[] { BuddiesTransfer.INSTANCE };
- viewer.addDropSupport(DND.DROP_MOVE, transfers, new BuddiesDropAdapter(viewer));
-
+ BuddiesDropAdapter.support(getViewer());
return sashComposite;
}
diff --git a/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/BuddyCollaboration.java b/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/BuddyCollaboration.java
index 8d957b6..c81a30a 100644
--- a/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/BuddyCollaboration.java
+++ b/plugins/org.eclipse.net4j.buddies/src/org/eclipse/net4j/internal/buddies/BuddyCollaboration.java
@@ -114,7 +114,10 @@ public class BuddyCollaboration extends Collaboration implements IBuddyCollabora
{
for (IBuddy buddy : buddies)
{
- System.out.println("INVITING: " + buddy);
+ if (getBuddy(buddy.getUserID()) == null)
+ {
+ System.out.println("INVITING: " + buddy);
+ }
}
}