summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-10-11 15:40:34 (EDT)
committerEike Stepper2007-10-11 15:40:34 (EDT)
commiteba16b81592cc34ebe5419c1be72543aaf361762 (patch)
tree5d3a0c188ca9bd6d8d2ae8b307d4869ed62e216e
parentb7716052b137cda7b49ddc53b4addaef67884400 (diff)
downloadcdo-eba16b81592cc34ebe5419c1be72543aaf361762.zip
cdo-eba16b81592cc34ebe5419c1be72543aaf361762.tar.gz
cdo-eba16b81592cc34ebe5419c1be72543aaf361762.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/BuddiesItemProvider.java7
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsPane.java18
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/views/CollaborationsView.java23
-rw-r--r--plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerView.java8
4 files changed, 44 insertions, 12 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 b163798..cc993bc 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
@@ -34,7 +34,7 @@ import org.eclipse.swt.graphics.Image;
*/
public class BuddiesItemProvider extends ContainerItemProvider<IContainer<Object>>
{
- private static final Color GRAY = UIUtil.getDisplay().getSystemColor(SWT.COLOR_GRAY);
+ public static final Color GRAY = UIUtil.getDisplay().getSystemColor(SWT.COLOR_GRAY);
private Font bold;
@@ -54,6 +54,11 @@ public class BuddiesItemProvider extends ContainerItemProvider<IContainer<Object
super.dispose();
}
+ public Font getBold()
+ {
+ return bold;
+ }
+
@Override
public String getText(Object obj)
{
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 3c851a9..6a1a636 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
@@ -113,6 +113,11 @@ public class CollaborationsPane extends Composite implements IListener
updateState();
}
+ public IBuddyCollaboration getActiveCollaboration()
+ {
+ return activeCollaboration;
+ }
+
public void setActiveCollaboration(IBuddyCollaboration collaboration)
{
if (activeCollaboration != collaboration)
@@ -120,9 +125,9 @@ public class CollaborationsPane extends Composite implements IListener
activeCollaboration = collaboration;
IFacility facility = activeFacilities.get(collaboration);
setActiveFacility(collaboration, facility);
+ updateState();
+ collaborationsView.refreshViewer(true);
}
-
- updateState();
}
public void setActiveFacility(IBuddyCollaboration collaboration, IFacility facility)
@@ -132,9 +137,8 @@ public class CollaborationsPane extends Composite implements IListener
{
FacilityPane facilityPane = facilityPanes.get(facility);
setActiveFacilityPane(facilityPane);
+ updateState();
}
-
- updateState();
}
protected void setActiveFacilityPane(FacilityPane newPane)
@@ -153,9 +157,9 @@ public class CollaborationsPane extends Composite implements IListener
{
newPane.showed(oldPane);
}
- }
- updateState();
+ updateState();
+ }
}
public void fillActionBars(IActionBars bars)
@@ -235,7 +239,7 @@ public class CollaborationsPane extends Composite implements IListener
{
try
{
- getDisplay().syncExec(new Runnable()
+ getDisplay().asyncExec(new Runnable()
{
public void run()
{
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 a910c83..25972ff 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
@@ -17,6 +17,7 @@ import org.eclipse.net4j.util.container.ContainerUtil;
import org.eclipse.net4j.util.container.IContainer;
import org.eclipse.net4j.util.event.IEvent;
import org.eclipse.net4j.util.ui.actions.SafeAction;
+import org.eclipse.net4j.util.ui.views.ContainerItemProvider;
import org.eclipse.net4j.util.ui.widgets.SashComposite;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -28,6 +29,7 @@ import org.eclipse.jface.action.Separator;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IActionBars;
@@ -133,6 +135,27 @@ public class CollaborationsView extends SessionManagerView
return getSession() != null ? getSession().getSelf() : ContainerUtil.emptyContainer();
}
+ @Override
+ protected ContainerItemProvider<IContainer<Object>> createContainerItemProvider()
+ {
+ return new BuddiesItemProvider()
+ {
+ @Override
+ public Font getFont(Object obj)
+ {
+ if (obj instanceof IBuddyCollaboration)
+ {
+ if (obj == getCollaborationsPane().getActiveCollaboration())
+ {
+ return getBold();
+ }
+ }
+
+ return super.getFont(obj);
+ }
+ };
+ }
+
/**
* @author Eike Stepper
*/
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 1191de3..70228cc 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
@@ -304,12 +304,12 @@ public abstract class ContainerView extends ViewPart implements ISetSelectionTar
}
}
- protected void refreshViewer(boolean updateLabels)
+ public void refreshViewer(boolean updateLabels)
{
refreshElement(null, updateLabels);
}
- protected void refreshElement(final Object element, final boolean updateLabels)
+ public void refreshElement(final Object element, final boolean updateLabels)
{
try
{
@@ -339,7 +339,7 @@ public abstract class ContainerView extends ViewPart implements ISetSelectionTar
}
}
- protected void updateLabels(final Object element)
+ public void updateLabels(final Object element)
{
try
{
@@ -362,7 +362,7 @@ public abstract class ContainerView extends ViewPart implements ISetSelectionTar
}
}
- protected void revealElement(final Object element)
+ public void revealElement(final Object element)
{
try
{