Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/Copy.java')
-rw-r--r--extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/Copy.java31
1 files changed, 21 insertions, 10 deletions
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/Copy.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/Copy.java
index cabd3e7de20..8c571972136 100644
--- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/Copy.java
+++ b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/Copy.java
@@ -121,9 +121,11 @@ public class Copy extends Copier {
// original source package becomes a sub-package in the target model
Package newSourceRoot = target.createNestedPackage(source.getName());
put(source, newSourceRoot);
+ setStatus(newSourceRoot, CopyStatus.SHALLOW);
}
else {
put(source, target);
+ setStatus(target, CopyStatus.SHALLOW);
}
};
@@ -210,6 +212,19 @@ public class Copy extends Copier {
return null;
}
+ /**
+ * Put a pair into the copy map. Unlike the standard put operation,
+ * the target object is marked as full copy.
+ * Just using the put operation lead to bug 422899 - [QDesigner] Regression in
+ * template instantiation
+ * @return
+ */
+ public EObject putPair(EObject sourceEObj, EObject targetEObj) {
+ EObject target = put(sourceEObj, targetEObj);
+ setStatus(targetEObj, CopyStatus.FULL);
+ return target;
+ }
+
@Override
public boolean containsKey(Object sourceEObj) {
if(sourceEObj instanceof EObject) {
@@ -228,6 +243,11 @@ public class Copy extends Copier {
return null;
}
+ /**
+ * Set the status of a copy object
+ * @param targetEObj
+ * @param status
+ */
public void setStatus(EObject targetEObj, CopyStatus status) {
statusMap.put(targetEObj, status);
}
@@ -239,11 +259,6 @@ public class Copy extends Copier {
* @return
*/
public CopyStatus getStatus(EObject targetEObj) {
- /*
- if (targetEObj instanceof Package) {
- return true;
- }
- */
if (targetEObj != null) {
CopyStatus status = statusMap.get(targetEObj);
if(status != null) {
@@ -253,10 +268,6 @@ public class Copy extends Copier {
return CopyStatus.UNKNOWN;
}
- // public Namespace getPackageTemplate() {
- // return null;
- // }
-
/**
* Set the reference of a bound package template. It must be a member of the target model.
* Setting the package template is required to assure that elements that are part of a different
@@ -931,7 +942,7 @@ public class Copy extends Copier {
* corresponding target model element
*/
public static void copyID(EObject source, EObject target) {
- copyID(source, target, "");
+ copyID(source, target, ""); //$NON-NLS-1$
}
/**

Back to the top