summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-10-11 04:58:00 (EDT)
committerEike Stepper2007-10-11 04:58:00 (EDT)
commit12dabc41dc458511e8cb87114ce5ccc4dc8dbc58 (patch)
tree2fe385a791f2471a655435952c950c92a0d7d385
parenta66e12937fc443375d62523bbda17253d375ee62 (diff)
downloadcdo-12dabc41dc458511e8cb87114ce5ccc4dc8dbc58.zip
cdo-12dabc41dc458511e8cb87114ce5ccc4dc8dbc58.tar.gz
cdo-12dabc41dc458511e8cb87114ce5ccc4dc8dbc58.tar.bz2
[205668] Provide buddies example
https://bugs.eclipse.org/bugs/show_bug.cgi?id=205668
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsPane.java45
-rw-r--r--plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerView.java5
2 files changed, 40 insertions, 10 deletions
diff --git a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsPane.java b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsPane.java
index 063f7b3..6f76c20 100644
--- a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsPane.java
+++ b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsPane.java
@@ -10,12 +10,17 @@
**************************************************************************/
package org.eclipse.net4j.buddies.internal.ui.views;
-import org.eclipse.net4j.buddies.BuddiesUtil;
+import org.eclipse.net4j.buddies.IBuddyCollaboration;
+import org.eclipse.net4j.buddies.protocol.IFacility;
import org.eclipse.net4j.util.ui.UIUtil;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.List;
+
+import java.util.HashMap;
+import java.util.Map;
/**
* @author Eike Stepper
@@ -24,22 +29,42 @@ public class CollaborationsPane extends Composite
{
private CollaborationsView collaborationsView;
- public CollaborationsPane(CollaborationsView collaborationsView, Composite parent)
+ private ISelectionChangedListener collaborationsViewerListener = new ISelectionChangedListener()
+ {
+ public void selectionChanged(SelectionChangedEvent event)
+ {
+ }
+ };
+
+ private Map<IFacility, FacilityPane> facilityPanes = new HashMap<IFacility, FacilityPane>();
+
+ private Map<IBuddyCollaboration, IFacility> activeFacilities = new HashMap<IBuddyCollaboration, IFacility>();
+
+ public CollaborationsPane(Composite parent, CollaborationsView collaborationsView)
{
super(parent, SWT.NONE);
- this.collaborationsView = collaborationsView;
setLayout(UIUtil.createGridLayout(1));
- List list = new List(this, SWT.NONE);
- list.setLayoutData(UIUtil.createGridData());
- for (String facilityType : BuddiesUtil.getFacilityTypes())
- {
- list.add(facilityType);
- }
+ this.collaborationsView = collaborationsView;
+ collaborationsView.getViewer().addSelectionChangedListener(collaborationsViewerListener);
+
+ // List list = new List(this, SWT.NONE);
+ // list.setLayoutData(UIUtil.createGridData());
+ // for (String facilityType : BuddiesUtil.getFacilityTypes())
+ // {
+ // list.add(facilityType);
+ // }
}
public CollaborationsView getCollaborationsView()
{
return collaborationsView;
}
+
+ @Override
+ public void dispose()
+ {
+ collaborationsView.getViewer().removeSelectionChangedListener(collaborationsViewerListener);
+ super.dispose();
+ }
}
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 9c5f6ab..91e08a2 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
@@ -61,6 +61,11 @@ public abstract class ContainerView extends ViewPart implements ISetSelectionTar
return shell;
}
+ public TreeViewer getViewer()
+ {
+ return viewer;
+ }
+
@Override
public void setFocus()
{