summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-10-17 05:49:44 (EDT)
committerEike Stepper2007-10-17 05:49:44 (EDT)
commitf8bc634aba00f3915334e9adae9afcd647dae71d (patch)
tree63e438c45dca6854ae6176ff63bc5e2b7bcf71b5
parent0e387ca27e2110cf18da08c00d354ac4820b6306 (diff)
downloadcdo-f8bc634aba00f3915334e9adae9afcd647dae71d.zip
cdo-f8bc634aba00f3915334e9adae9afcd647dae71d.tar.gz
cdo-f8bc634aba00f3915334e9adae9afcd647dae71d.tar.bz2
[206224] Provide chat example
https://bugs.eclipse.org/bugs/show_bug.cgi?id=206224
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/BuddiesItemProvider.java16
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsView.java16
-rw-r--r--plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerView.java2
3 files changed, 20 insertions, 14 deletions
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 cc993bc..b3eff49 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
@@ -10,6 +10,7 @@
**************************************************************************/
package org.eclipse.net4j.buddies.internal.ui.views;
+import org.eclipse.net4j.buddies.IBuddyCollaboration;
import org.eclipse.net4j.buddies.internal.ui.SharedIcons;
import org.eclipse.net4j.buddies.protocol.IBuddy;
import org.eclipse.net4j.buddies.protocol.ICollaboration;
@@ -17,11 +18,13 @@ import org.eclipse.net4j.util.container.IContainer;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.net4j.util.ui.UIUtil;
import org.eclipse.net4j.util.ui.actions.LongRunningAction;
+import org.eclipse.net4j.util.ui.actions.SafeAction;
import org.eclipse.net4j.util.ui.views.ContainerItemProvider;
import org.eclipse.net4j.util.ui.views.ContainerView;
import org.eclipse.net4j.util.ui.views.IElementFilter;
import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.Separator;
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
@@ -143,6 +146,7 @@ public class BuddiesItemProvider extends ContainerItemProvider<IContainer<Object
@Override
protected void fillContextMenu(IMenuManager manager, ITreeSelection selection)
{
+ manager.add(new Separator());
if (selection.size() == 1)
{
Object obj = selection.getFirstElement();
@@ -150,6 +154,18 @@ public class BuddiesItemProvider extends ContainerItemProvider<IContainer<Object
{
manager.add(new RemoveAction(obj));
}
+ else if (obj instanceof IBuddyCollaboration)
+ {
+ final IBuddyCollaboration collaboration = (IBuddyCollaboration)obj;
+ manager.add(new SafeAction("Leave", "Leave this collaboration")
+ {
+ @Override
+ protected void safeRun() throws Exception
+ {
+ collaboration.leave();
+ }
+ });
+ }
}
}
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 229e151..4b942e9 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
@@ -36,6 +36,7 @@ import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbenchActionConstants;
import java.util.HashMap;
import java.util.Map;
@@ -117,27 +118,16 @@ public class CollaborationsView extends SessionManagerView
final IBuddyCollaboration collaboration = (IBuddyCollaboration)selection.getFirstElement();
if (collaboration != null)
{
- manager.add(new Separator());
+ manager.insertBefore(IWorkbenchActionConstants.MB_ADDITIONS, new Separator());
for (IFacilityPaneCreator c : facilityPaneCreators.values())
{
String type = c.getType();
if (collaboration.getFacility(type) == null)
{
IAction action = new StartFacilityAction(collaboration, type, c.getImageDescriptor());
- manager.add(action);
+ manager.insertBefore(IWorkbenchActionConstants.MB_ADDITIONS, action);
}
}
-
- manager.add(new Separator());
- manager.add(new SafeAction("Leave", "Leave this collaboration")
- {
- @Override
- protected void safeRun() throws Exception
- {
- collaboration.leave();
- }
- });
-
}
}
}
diff --git a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerView.java b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerView.java
index 70228cc..8699560 100644
--- a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerView.java
+++ b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerView.java
@@ -225,8 +225,8 @@ public abstract class ContainerView extends ViewPart implements ISetSelectionTar
protected void fillContextMenu(IMenuManager manager, ITreeSelection selection)
{
- itemProvider.fillContextMenu(manager, selection);
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ itemProvider.fillContextMenu(manager, selection);
}
protected void selectionChanged(IActionBars bars, ITreeSelection selection)