summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-08 05:56:47 (EDT)
committerEike Stepper2007-08-08 05:56:47 (EDT)
commit7f0ca4d50d0f1114b33e43e0fd5fab7fd948ce61 (patch)
tree7ef5b0e9a027d7f1df066b057085ced781cfc0d1
parent436516eae026e2938d7db0ca1ce6dc075fd60cb1 (diff)
downloadcdo-7f0ca4d50d0f1114b33e43e0fd5fab7fd948ce61.zip
cdo-7f0ca4d50d0f1114b33e43e0fd5fab7fd948ce61.tar.gz
cdo-7f0ca4d50d0f1114b33e43e0fd5fab7fd948ce61.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java30
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOCallbackImpl.java44
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java33
-rw-r--r--plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/views/IntrospectorView.java68
4 files changed, 97 insertions, 78 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java
index 6a0fe52..19c84a3 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java
@@ -14,6 +14,7 @@ import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.internal.cdo.bundle.OM;
/**
* @author Eike Stepper
@@ -63,22 +64,29 @@ public class CDOAdapterImpl extends CDOLegacyImpl implements Adapter.Internal
public void notifyChanged(Notification msg)
{
- if (msg.getNotifier() == instance)
+ try
{
- switch (msg.getEventType())
+ if (msg.getNotifier() == instance)
{
- case Notification.ADD:
- case Notification.ADD_MANY:
- case Notification.REMOVE:
- case Notification.REMOVE_MANY:
- case Notification.MOVE:
- case Notification.SET:
- case Notification.UNSET:
- if (!instance.eIsProxy())
+ switch (msg.getEventType())
{
- CDOStateMachine.INSTANCE.write(this);
+ case Notification.ADD:
+ case Notification.ADD_MANY:
+ case Notification.REMOVE:
+ case Notification.REMOVE_MANY:
+ case Notification.MOVE:
+ case Notification.SET:
+ case Notification.UNSET:
+ if (!instance.eIsProxy())
+ {
+ CDOStateMachine.INSTANCE.write(this);
+ }
}
}
}
+ catch (RuntimeException ex)
+ {
+ OM.LOG.error(ex);
+ }
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOCallbackImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOCallbackImpl.java
index fd22c24..65c31b5 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOCallbackImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOCallbackImpl.java
@@ -16,6 +16,7 @@ import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.CDOCallback;
import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.emf.internal.cdo.bundle.OM;
import org.eclipse.emf.internal.cdo.util.FSMUtil;
/**
@@ -41,35 +42,42 @@ public class CDOCallbackImpl extends CDOAdapterImpl implements CDOCallback
@Override
public void notifyChanged(Notification msg)
{
- if (msg.getNotifier() == instance)
+ try
{
- Object feature = msg.getFeature();
- if (feature instanceof EReference)
+ if (msg.getNotifier() == instance)
{
- EReference reference = (EReference)feature;
- if (reference.isContainment())
+ Object feature = msg.getFeature();
+ if (feature instanceof EReference)
{
- switch (msg.getEventType())
+ EReference reference = (EReference)feature;
+ if (reference.isContainment())
{
- case Notification.ADD:
- notifyAdd((InternalEObject)msg.getNewValue());
- break;
+ switch (msg.getEventType())
+ {
+ case Notification.ADD:
+ notifyAdd((InternalEObject)msg.getNewValue());
+ break;
- case Notification.ADD_MANY:
- notifyAddMany(msg);
- break;
+ case Notification.ADD_MANY:
+ notifyAddMany(msg);
+ break;
- case Notification.REMOVE:
- notifyRemove((InternalEObject)msg.getOldValue());
- break;
+ case Notification.REMOVE:
+ notifyRemove((InternalEObject)msg.getOldValue());
+ break;
- case Notification.REMOVE_MANY:
- notifyRemoveMany(msg);
- break;
+ case Notification.REMOVE_MANY:
+ notifyRemoveMany(msg);
+ break;
+ }
}
}
}
}
+ catch (RuntimeException ex)
+ {
+ OM.LOG.error(ex);
+ }
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
index b87b97e..34a5323 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
@@ -586,23 +586,30 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
public void notifyChanged(Notification msg)
{
- switch (msg.getEventType())
+ try
{
- case Notification.ADD:
- notifyAdd(msg);
- break;
+ switch (msg.getEventType())
+ {
+ case Notification.ADD:
+ notifyAdd(msg);
+ break;
- case Notification.ADD_MANY:
- notifyAddMany(msg);
- break;
+ case Notification.ADD_MANY:
+ notifyAddMany(msg);
+ break;
- case Notification.REMOVE:
- notifyRemove(msg);
- break;
+ case Notification.REMOVE:
+ notifyRemove(msg);
+ break;
- case Notification.REMOVE_MANY:
- notifyRemoveMany(msg);
- break;
+ case Notification.REMOVE_MANY:
+ notifyRemoveMany(msg);
+ break;
+ }
+ }
+ catch (RuntimeException ex)
+ {
+ OM.LOG.error(ex);
}
}
diff --git a/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/views/IntrospectorView.java b/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/views/IntrospectorView.java
index 00b62b5..160f277 100644
--- a/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/views/IntrospectorView.java
+++ b/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/views/IntrospectorView.java
@@ -54,7 +54,7 @@ import java.util.Stack;
/**
* @author Eike Stepper
*/
-public class IntrospectorView extends ViewPart implements ISelectionListener
+public class IntrospectorView extends ViewPart implements ISelectionListener, IDoubleClickListener
{
private static final Object[] NO_ELEMENTS = {};
@@ -76,37 +76,6 @@ public class IntrospectorView extends ViewPart implements ISelectionListener
private IAction backAction = new BackAction();
- private IDoubleClickListener doubleClickListener = new IDoubleClickListener()
- {
- public void doubleClick(DoubleClickEvent event)
- {
- ISelection sel = event.getSelection();
- if (sel instanceof IStructuredSelection)
- {
- IStructuredSelection ssel = (IStructuredSelection)sel;
- Object element = ssel.getFirstElement();
- if (currentViewer == objectViewer && element instanceof Pair)
- {
- Pair<Field, Object> pair = (Pair)element;
- Field field = pair.getElement1();
- if (!field.getType().isPrimitive())
- {
- setObject(pair.getElement2());
- }
- }
- else if (currentViewer == mapViewer && element instanceof Map.Entry)
- {
- Map.Entry entry = (Map.Entry)element;
- setObject(entry.getValue());
- }
- else if (currentViewer == iterableViewer)
- {
- setObject(element);
- }
- }
- }
- };
-
private StackLayout stackLayout;
private Composite stacked;
@@ -151,7 +120,7 @@ public class IntrospectorView extends ViewPart implements ISelectionListener
objectViewer = createViewer(stacked);
createObjectColmuns();
- objectViewer.addDoubleClickListener(doubleClickListener);
+ objectViewer.addDoubleClickListener(this);
objectViewer.setContentProvider(new ObjectContentProvider());
objectViewer.setLabelProvider(new ObjectLabelProvider());
objectViewer.setSorter(new NameSorter());
@@ -159,15 +128,14 @@ public class IntrospectorView extends ViewPart implements ISelectionListener
iterableViewer = createViewer(stacked);
createIterableColmuns();
- iterableViewer.addDoubleClickListener(doubleClickListener);
+ iterableViewer.addDoubleClickListener(this);
iterableViewer.setContentProvider(new IterableContentProvider());
iterableViewer.setLabelProvider(new IterableLabelProvider());
- iterableViewer.setSorter(new NameSorter());
iterableViewer.setInput(getViewSite());
mapViewer = createViewer(stacked);
createMapColmuns();
- mapViewer.addDoubleClickListener(doubleClickListener);
+ mapViewer.addDoubleClickListener(this);
mapViewer.setContentProvider(new MapContentProvider());
mapViewer.setLabelProvider(new MapLabelProvider());
mapViewer.setSorter(new NameSorter());
@@ -238,6 +206,34 @@ public class IntrospectorView extends ViewPart implements ISelectionListener
}
}
+ public void doubleClick(DoubleClickEvent event)
+ {
+ ISelection sel = event.getSelection();
+ if (sel instanceof IStructuredSelection)
+ {
+ IStructuredSelection ssel = (IStructuredSelection)sel;
+ Object element = ssel.getFirstElement();
+ if (currentViewer == objectViewer && element instanceof Pair)
+ {
+ Pair<Field, Object> pair = (Pair)element;
+ Field field = pair.getElement1();
+ if (!field.getType().isPrimitive())
+ {
+ setObject(pair.getElement2());
+ }
+ }
+ else if (currentViewer == mapViewer && element instanceof Map.Entry)
+ {
+ Map.Entry entry = (Map.Entry)element;
+ setObject(entry.getValue());
+ }
+ else if (currentViewer == iterableViewer)
+ {
+ setObject(element);
+ }
+ }
+ }
+
/**
* Passing the focus request to the viewer's control.
*/