summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-11-10 02:37:00 (EST)
committerEike Stepper2007-11-10 02:37:00 (EST)
commit0159f38d7e02ba4498ef8c4c84b0343d0d85c1c1 (patch)
tree49b0173f00cfd3f42e8da8744c77fa3939844a2a
parentc1e3acb4f5f8b07bbc170567732c7940ba3b5c65 (diff)
downloadcdo-0159f38d7e02ba4498ef8c4c84b0343d0d85c1c1.zip
cdo-0159f38d7e02ba4498ef8c4c84b0343d0d85c1c1.tar.gz
cdo-0159f38d7e02ba4498ef8c4c84b0343d0d85c1c1.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/actions/ReconnectAction.java22
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesDropAdapter.java4
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/SessionManagerView.java5
-rw-r--r--plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/dnd/DNDDropAdapter.java6
4 files changed, 32 insertions, 5 deletions
diff --git a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/actions/ReconnectAction.java b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/actions/ReconnectAction.java
new file mode 100644
index 0000000..fee078f
--- /dev/null
+++ b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/actions/ReconnectAction.java
@@ -0,0 +1,22 @@
+package org.eclipse.net4j.buddies.internal.ui.actions;
+
+import org.eclipse.net4j.buddies.ui.ISessionManager;
+import org.eclipse.net4j.util.ui.actions.SafeAction;
+
+/**
+ * @author Eike Stepper
+ */
+public final class ReconnectAction extends SafeAction
+{
+ public ReconnectAction()
+ {
+ super("Reconnect", "Reconnect to buddies server");
+ }
+
+ @Override
+ protected void safeRun() throws Exception
+ {
+ ISessionManager.INSTANCE.disconnect();
+ ISessionManager.INSTANCE.connect();
+ }
+} \ 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 89d02e5..d8dd67c 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
@@ -36,8 +36,8 @@ public class BuddiesDropAdapter extends DNDDropAdapter<IBuddy[]>
}
@Override
- protected boolean validateTarget(Object target)
+ protected boolean validateTarget(Object target, int operation)
{
- return target instanceof IBuddyCollaboration;
+ return true;// 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/SessionManagerView.java b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/SessionManagerView.java
index 63a85c9..768994c 100644
--- a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/SessionManagerView.java
+++ b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/SessionManagerView.java
@@ -14,6 +14,7 @@ import org.eclipse.net4j.buddies.IBuddySession;
import org.eclipse.net4j.buddies.internal.ui.actions.ConnectAction;
import org.eclipse.net4j.buddies.internal.ui.actions.DisconnectAction;
import org.eclipse.net4j.buddies.internal.ui.actions.FlashAction;
+import org.eclipse.net4j.buddies.internal.ui.actions.ReconnectAction;
import org.eclipse.net4j.buddies.internal.ui.actions.StateAction.DropDownAction;
import org.eclipse.net4j.buddies.protocol.IBuddyStateEvent;
import org.eclipse.net4j.buddies.ui.ISessionManager;
@@ -38,6 +39,8 @@ public abstract class SessionManagerView extends ContainerView implements IListe
private DisconnectAction disconnectAction = new DisconnectAction();
+ private ReconnectAction reconnectAction = new ReconnectAction();
+
private FlashAction flashAction = new FlashAction();
private DropDownAction dropDownAction = new DropDownAction();
@@ -108,6 +111,7 @@ public abstract class SessionManagerView extends ContainerView implements IListe
{
manager.add(connectAction);
manager.add(disconnectAction);
+ manager.add(reconnectAction);
manager.add(new Separator());
manager.add(flashAction);
super.fillLocalPullDown(manager);
@@ -140,6 +144,7 @@ public abstract class SessionManagerView extends ContainerView implements IListe
{
connectAction.setEnabled(session == null);
disconnectAction.setEnabled(session != null);
+ reconnectAction.setEnabled(session != null);
flashAction.setEnabled(session != null && !ISessionManager.INSTANCE.isFlashing());
dropDownAction.updateState();
// control.setEnabled(session != null);
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 52ccc65..7d79125 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
@@ -52,12 +52,12 @@ public abstract class DNDDropAdapter<TYPE> extends ViewerDropAdapter
}
@Override
- public boolean validateDrop(Object target, int op, TransferData type)
+ public boolean validateDrop(Object target, int operation, TransferData type)
{
- return transfer.isSupportedType(type) && validateTarget(target);
+ return transfer.isSupportedType(type) && validateTarget(target, operation);
}
protected abstract boolean performDrop(TYPE data, Object target);
- protected abstract boolean validateTarget(Object target);
+ protected abstract boolean validateTarget(Object target, int operation);
} \ No newline at end of file