aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Keimel2013-07-10 05:09:22 (EDT)
committerPaul Elder2013-08-13 08:30:40 (EDT)
commit8466fc399e377ea2ced24a6506b9112a13bc1811 (patch)
tree11d1e901ba68e578c7db004525a14c4fb93e5316
parent35d39e91dc823222dff75b10ec726ffdedc37a65 (diff)
downloadeclipse.platform.ui-8466fc399e377ea2ced24a6506b9112a13bc1811.zip
eclipse.platform.ui-8466fc399e377ea2ced24a6506b9112a13bc1811.tar.gz
eclipse.platform.ui-8466fc399e377ea2ced24a6506b9112a13bc1811.tar.bz2
Fixed bug 389624 using UsageCrossReferencerrefs/changes/16/15416/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;
}
}