Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMélanie Bats2017-07-21 08:36:48 +0000
committerPierre-Charles David2017-08-16 09:02:42 +0000
commitb1c1fbf639eec60e6fef58d482e0b7b48d33f8c0 (patch)
tree142c1e2e580f50d6fdc369a458ce1681440274e1
parentc9766c5c3c431ff4773e8448250f48cd34b14270 (diff)
downloadorg.eclipse.sirius-b1c1fbf639eec60e6fef58d482e0b7b48d33f8c0.tar.gz
org.eclipse.sirius-b1c1fbf639eec60e6fef58d482e0b7b48d33f8c0.tar.xz
org.eclipse.sirius-b1c1fbf639eec60e6fef58d482e0b7b48d33f8c0.zip
[520572] Converter does not translate Sirius name to EEF identifier
Bug: 520572 Change-Id: I57803cfc22cfd742e1722b809c446ad6d0fc51e2 Cherry-picked-from: 519552 Signed-off-by: Mélanie Bats <melanie.bats@obeo.fr> Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.properties.core/src/org/eclipse/sirius/properties/core/api/DefaultDescriptionConverter.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/plugins/org.eclipse.sirius.properties.core/src/org/eclipse/sirius/properties/core/api/DefaultDescriptionConverter.java b/plugins/org.eclipse.sirius.properties.core/src/org/eclipse/sirius/properties/core/api/DefaultDescriptionConverter.java
index 09228ee93e..e0063fd35c 100644
--- a/plugins/org.eclipse.sirius.properties.core/src/org/eclipse/sirius/properties/core/api/DefaultDescriptionConverter.java
+++ b/plugins/org.eclipse.sirius.properties.core/src/org/eclipse/sirius/properties/core/api/DefaultDescriptionConverter.java
@@ -25,10 +25,11 @@ import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.sirius.properties.core.internal.Messages;
+import org.eclipse.sirius.viewpoint.description.DescriptionPackage;
/**
- * This class can be used to convert any kind of Sirius object to an EEF one
- * using the name of their structural features.
+ * This class can be used to convert any kind of Sirius object to an EEF one using the name of their structural
+ * features.
*
* @author sbegaudeau
*
@@ -97,8 +98,7 @@ public class DefaultDescriptionConverter<SIRIUS extends EObject> extends Abstrac
}
/**
- * Converts the value of the given Sirius EAttribute from the Sirius EObject
- * to the given EEF EObject.
+ * Converts the value of the given Sirius EAttribute from the Sirius EObject to the given EEF EObject.
*
* @param siriusEObject
* The Sirius EObject
@@ -118,12 +118,16 @@ public class DefaultDescriptionConverter<SIRIUS extends EObject> extends Abstrac
Object value = siriusEObject.eGet(eAttribute);
eefEObject.eSet(eefEStructuralFeature, Integer.toString(Integer.valueOf(value.toString())));
}
+ } else {
+ eefEStructuralFeature = eefEObject.eClass().getEStructuralFeature("identifier"); //$NON-NLS-1$
+ if (eAttribute.equals(DescriptionPackage.Literals.IDENTIFIED_ELEMENT__NAME) && eefEStructuralFeature instanceof EAttribute) {
+ eefEObject.eSet(eefEStructuralFeature, siriusEObject.eGet(DescriptionPackage.Literals.IDENTIFIED_ELEMENT__NAME));
+ }
}
}
/**
- * Converts the value of the given Sirius EReference from the Sirius EObject
- * to the given EEF EObject.
+ * Converts the value of the given Sirius EReference from the Sirius EObject to the given EEF EObject.
*
* @param siriusEObject
* The Sirius EObject

Back to the top