Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2013-02-01 10:28:55 -0500
committerChristian W. Damus2013-02-01 10:32:01 -0500
commit4422ae0face4f8448bd9387d0711f0168f73def0 (patch)
tree95f87673d1e21f2dad3e54b7876515307a185da4
parent93c62bac2df25b38353e2e89b2f5cd91b75064f7 (diff)
downloadcdo-4422ae0face4f8448bd9387d0711f0168f73def0.tar.gz
cdo-4422ae0face4f8448bd9387d0711f0168f73def0.tar.xz
cdo-4422ae0face4f8448bd9387d0711f0168f73def0.zip
[399733] [Dawn] DawnDiagramUpdater doesn't handle diagrams having UML CacheAdapter attached
https://bugs.eclipse.org/bugs/show_bug.cgi?id=399733
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.gmf/src/org/eclipse/emf/cdo/dawn/gmf/util/DawnDiagramUpdater.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/org.eclipse.emf.cdo.dawn.gmf/src/org/eclipse/emf/cdo/dawn/gmf/util/DawnDiagramUpdater.java b/plugins/org.eclipse.emf.cdo.dawn.gmf/src/org/eclipse/emf/cdo/dawn/gmf/util/DawnDiagramUpdater.java
index bbe1638cb8..a78dd7e193 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.gmf/src/org/eclipse/emf/cdo/dawn/gmf/util/DawnDiagramUpdater.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.gmf/src/org/eclipse/emf/cdo/dawn/gmf/util/DawnDiagramUpdater.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Martin Fluegge - initial API and implementation
+ * Christian W. Damus (CEA) - bug 399733: tolerate UML CacheAdapter
*/
package org.eclipse.emf.cdo.dawn.gmf.util;
@@ -15,6 +16,7 @@ import org.eclipse.emf.cdo.dawn.internal.util.bundle.OM;
import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.util.ECrossReferenceAdapter;
import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
@@ -28,7 +30,6 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor;
import org.eclipse.gmf.runtime.diagram.ui.services.editpart.EditPartService;
-import org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.NotationPackage;
@@ -366,18 +367,17 @@ public class DawnDiagramUpdater
public static View findViewFromCrossReferences(EObject element)
{
- CrossReferenceAdapter crossreferenceAdapter = (CrossReferenceAdapter)ECrossReferenceAdapter
- .getCrossReferenceAdapter(element);// getCrossReferenceAdapter(element);
+ ECrossReferenceAdapter crossreferenceAdapter = ECrossReferenceAdapter.getCrossReferenceAdapter(element);
if (crossreferenceAdapter != null)
{
- Collection<?> iinverseReferences = crossreferenceAdapter.getInverseReferencers(element,
- NotationPackage.eINSTANCE.getView_Element(), null);
+ Collection<EStructuralFeature.Setting> iinverseReferences = crossreferenceAdapter
+ .getNonNavigableInverseReferences(element);
- for (Object f : iinverseReferences)
+ for (EStructuralFeature.Setting f : iinverseReferences)
{
- if (f instanceof View)
+ if (f.getEStructuralFeature() == NotationPackage.Literals.VIEW__ELEMENT)
{
- return (View)f;
+ return (View)f.getEObject();
}
}
}

Back to the top