summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorChristoph Keimel2013-07-10 05:09:22 (EDT)
committer Christoph Keimel2013-07-19 04:50:34 (EDT)
commit89472f2da05022ddb83f2d943909f73e888d94a5 (patch)
tree283567f7005110b617e7172b03309ad237e4be20
parentf2fbd43ff1b20deea217bffbf4d31ab5e2fff506 (diff)
downloadeclipse.platform.ui-89472f2da05022ddb83f2d943909f73e888d94a5.zip
eclipse.platform.ui-89472f2da05022ddb83f2d943909f73e888d94a5.tar.gz
eclipse.platform.ui-89472f2da05022ddb83f2d943909f73e888d94a5.tar.bz2
Fixed bug 389624 using UsageCrossReferencerrefs/changes/85/14685/1
Bug: #389624 Change-Id: Ife6c7cab76fc5a818419680d0ed4fecb433356bd Signed-off-by: Christoph Keimel <c.keimel@emsw.de>
-rw-r--r--bundles/org.eclipse.e4.ui.model.workbench/src/org/eclipse/e4/ui/model/internal/ModelUtils.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/bundles/org.eclipse.e4.ui.model.workbench/src/org/eclipse/e4/ui/model/internal/ModelUtils.java b/bundles/org.eclipse.e4.ui.model.workbench/src/org/eclipse/e4/ui/model/internal/ModelUtils.java
index f48146f..f96b4e5 100644
--- a/bundles/org.eclipse.e4.ui.model.workbench/src/org/eclipse/e4/ui/model/internal/ModelUtils.java
+++ b/bundles/org.eclipse.e4.ui.model.workbench/src/org/eclipse/e4/ui/model/internal/ModelUtils.java
@@ -10,9 +10,8 @@
*******************************************************************************/
package org.eclipse.e4.ui.model.internal;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.eclipse.e4.core.contexts.IEclipseContext;
@@ -25,7 +24,10 @@ import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EGenericType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EStructuralFeature.Setting;
import org.eclipse.emf.ecore.ETypeParameter;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.EcoreUtil.UsageCrossReferencer;
public class ModelUtils {
//public static final String CONTAINING_CONTEXT = "ModelUtils.containingContext";
@@ -162,7 +164,14 @@ public class ModelUtils {
found = true; // skip
break;
} else { // replace
+ EObject root = EcoreUtil.getRootContainer((EObject) existingEObject);
+ // Replacing the object in the container
EcoreUtil.replace((EObject)existingEObject, (EObject)element);
+ // Replacing the object in other references than the container.
+ Collection<Setting> settings = UsageCrossReferencer.find((EObject) existingEObject, root);
+ for (Setting setting : settings) {
+ setting.set(element);
+ }
found = true;
}
}