summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-10-07 07:04:25 (EDT)
committerEike Stepper2007-10-07 07:04:25 (EDT)
commit5bdad8cc81d0b3c51a3a8620231c2e15489f8923 (patch)
tree163f5b93d9bc63cacadf2ec1eebc75fbe648576d
parent102ad89288640631d184a59e81c64a2d0a2f32d4 (diff)
downloadcdo-5bdad8cc81d0b3c51a3a8620231c2e15489f8923.zip
cdo-5bdad8cc81d0b3c51a3a8620231c2e15489f8923.tar.gz
cdo-5bdad8cc81d0b3c51a3a8620231c2e15489f8923.tar.bz2
[205661] Use colors in CDOEditor to show dirty objects and conflicts
https://bugs.eclipse.org/bugs/show_bug.cgi?id=205661
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/ItemsProcessor.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOLabelProvider.java27
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOEventHandler.java36
3 files changed, 44 insertions, 24 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/ItemsProcessor.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/ItemsProcessor.java
index caffb35..947e443 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/ItemsProcessor.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/ItemsProcessor.java
@@ -105,11 +105,6 @@ public abstract class ItemsProcessor
if (ids == null || ids.contains(cdoObject.cdoID()))
{
processCDOObject(viewer, cdoObject);
- // InternalCDOObject container = getCDOObject(cdoObject.eContainer());
- // if (container != null)
- // {
- // processCDOObject(viewer, container);
- // }
}
}
}
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOLabelProvider.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOLabelProvider.java
index 3d3dbb7..003f21d 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOLabelProvider.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOLabelProvider.java
@@ -3,6 +3,7 @@ package org.eclipse.emf.cdo.internal.ui.editor;
import org.eclipse.emf.cdo.CDOView;
import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
import org.eclipse.emf.internal.cdo.InternalCDOObject;
import org.eclipse.emf.internal.cdo.util.FSMUtil;
@@ -65,6 +66,32 @@ public class CDOLabelProvider extends AdapterFactoryLabelProvider implements ICo
}
@Override
+ public void notifyChanged(final Notification notification)
+ {
+ super.notifyChanged(notification);
+
+ try
+ {
+ viewer.getControl().getDisplay().syncExec(new Runnable()
+ {
+ public void run()
+ {
+ try
+ {
+ viewer.refresh(notification.getNotifier(), true);
+ }
+ catch (Exception ignore)
+ {
+ }
+ }
+ });
+ }
+ catch (Exception ignore)
+ {
+ }
+ }
+
+ @Override
public String getColumnText(Object object, int columnIndex)
{
try
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOEventHandler.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOEventHandler.java
index fc6068c..0b3a4e5 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOEventHandler.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOEventHandler.java
@@ -17,18 +17,16 @@ import org.eclipse.emf.cdo.CDOView;
import org.eclipse.emf.cdo.internal.ui.ItemsProcessor;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.internal.cdo.InternalCDOObject;
+
import org.eclipse.net4j.util.container.IContainerDelta;
import org.eclipse.net4j.util.container.IContainerEvent;
import org.eclipse.net4j.util.event.IEvent;
import org.eclipse.net4j.util.event.IListener;
import org.eclipse.net4j.util.lifecycle.ILifecycleEvent;
-import org.eclipse.emf.internal.cdo.InternalCDOObject;
-
import org.eclipse.jface.viewers.TreeViewer;
-import java.util.HashSet;
-import java.util.Map;
import java.util.Set;
/**
@@ -77,21 +75,21 @@ public class CDOEventHandler
{
if (event instanceof CDOTransactionFinishedEvent)
{
- CDOTransactionFinishedEvent e = (CDOTransactionFinishedEvent)event;
- if (e.getType() == CDOTransactionFinishedEvent.Type.COMMITTED)
- {
- Map<CDOID, CDOID> idMappings = e.getIDMappings();
- HashSet<CDOID> newOIDs = new HashSet<CDOID>(idMappings.values());
- new ItemsProcessor(view)
- {
- @Override
- protected void processCDOObject(TreeViewer viewer, InternalCDOObject cdoObject)
- {
- viewer.update(cdoObject.cdoInternalInstance(), null);
- }
- }.processCDOObjects(treeViewer, newOIDs);
- }
- else
+ // CDOTransactionFinishedEvent e = (CDOTransactionFinishedEvent)event;
+ // if (e.getType() == CDOTransactionFinishedEvent.Type.COMMITTED)
+ // {
+ // Map<CDOID, CDOID> idMappings = e.getIDMappings();
+ // HashSet<CDOID> newOIDs = new HashSet<CDOID>(idMappings.values());
+ // new ItemsProcessor(view)
+ // {
+ // @Override
+ // protected void processCDOObject(TreeViewer viewer, InternalCDOObject cdoObject)
+ // {
+ // viewer.update(cdoObject.cdoInternalInstance(), null);
+ // }
+ // }.processCDOObjects(treeViewer, newOIDs);
+ // }
+ // else
{
try
{