summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-11-10 03:08:40 (EST)
committerEike Stepper2007-11-10 03:08:40 (EST)
commit3f84f8dfc10de7660802999e3d31b19c2995d3d8 (patch)
treea26f2b31dd34040fb48e3fa768de02e316e7e275
parent0159f38d7e02ba4498ef8c4c84b0343d0d85c1c1 (diff)
downloadcdo-3f84f8dfc10de7660802999e3d31b19c2995d3d8.zip
cdo-3f84f8dfc10de7660802999e3d31b19c2995d3d8.tar.gz
cdo-3f84f8dfc10de7660802999e3d31b19c2995d3d8.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/BuddiesDropAdapter.java3
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesView.java2
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsView.java2
-rw-r--r--plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/dnd/DNDDropAdapter.java28
4 files changed, 32 insertions, 3 deletions
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 d8dd67c..d62bc80 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
@@ -25,6 +25,7 @@ public class BuddiesDropAdapter extends DNDDropAdapter<IBuddy[]>
public BuddiesDropAdapter(StructuredViewer viewer)
{
super(BuddiesTransfer.INSTANCE, viewer);
+ setExpandEnabled(false);
}
@Override
@@ -38,6 +39,6 @@ public class BuddiesDropAdapter extends DNDDropAdapter<IBuddy[]>
@Override
protected boolean validateTarget(Object target, int operation)
{
- return true;// target instanceof IBuddyCollaboration;
+ return target instanceof IBuddyCollaboration;
}
} \ 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 294d6e4..fdc12db 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
@@ -41,7 +41,7 @@ public class BuddiesView extends SessionManagerView
Control control = super.createControl(parent);
TreeViewer viewer = getViewer();
Transfer[] transfers = new Transfer[] { BuddiesTransfer.INSTANCE };
- viewer.addDragSupport(DND.DROP_LINK, transfers, new BuddiesDragListener(viewer));
+ viewer.addDragSupport(DND.DROP_MOVE, transfers, new BuddiesDragListener(viewer));
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 521e402..0977621 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
@@ -91,7 +91,7 @@ public class CollaborationsView extends SessionManagerView
TreeViewer viewer = getViewer();
Transfer[] transfers = new Transfer[] { BuddiesTransfer.INSTANCE };
- viewer.addDropSupport(DND.DROP_LINK, transfers, new BuddiesDropAdapter(viewer));
+ viewer.addDropSupport(DND.DROP_MOVE, transfers, new BuddiesDropAdapter(viewer));
return sashComposite;
}
diff --git a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/dnd/DNDDropAdapter.java b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/dnd/DNDDropAdapter.java
index 7d79125..5d67bff 100644
--- a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/dnd/DNDDropAdapter.java
+++ b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/dnd/DNDDropAdapter.java
@@ -12,6 +12,7 @@ package org.eclipse.net4j.util.ui.dnd;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.ViewerDropAdapter;
+import org.eclipse.swt.dnd.DropTargetEvent;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.dnd.TransferData;
@@ -22,6 +23,8 @@ public abstract class DNDDropAdapter<TYPE> extends ViewerDropAdapter
{
private Transfer transfer;
+ private boolean dropBetweenEnabled;
+
protected DNDDropAdapter(Transfer transfer, StructuredViewer viewer)
{
super(viewer);
@@ -39,6 +42,31 @@ public abstract class DNDDropAdapter<TYPE> extends ViewerDropAdapter
return (StructuredViewer)super.getViewer();
}
+ public boolean isDropBetweenEnabled()
+ {
+ return dropBetweenEnabled;
+ }
+
+ public void setDropBetweenEnabled(boolean dropBetweenEnabled)
+ {
+ this.dropBetweenEnabled = dropBetweenEnabled;
+ }
+
+ @Override
+ protected int determineLocation(DropTargetEvent event)
+ {
+ int location = super.determineLocation(event);
+ if (location == LOCATION_BEFORE || location == LOCATION_AFTER)
+ {
+ if (!dropBetweenEnabled)
+ {
+ location = LOCATION_ON;
+ }
+ }
+
+ return location;
+ }
+
@Override
public boolean performDrop(Object data)
{