Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime PORHEL2014-02-05 15:52:03 +0000
committerMaxime PORHEL2014-02-05 15:52:03 +0000
commit09f32482aa24937d71645ae53c3de541c74f58b9 (patch)
tree29613af7b4e3b9227f7cc589230a74ab64b2c1e6
parentfcd88555a0db42e5e9fca0b7e662891fec89a0a7 (diff)
downloadorg.eclipse.sirius-09f32482aa24937d71645ae53c3de541c74f58b9.tar.gz
org.eclipse.sirius-09f32482aa24937d71645ae53c3de541c74f58b9.tar.xz
org.eclipse.sirius-09f32482aa24937d71645ae53c3de541c74f58b9.zip
[423052] Update migration participant
This commit add the ability to migrate VSM and representation files with ContainerDropDescription, DragAndDropTarget, DragAndDroptTargetDescription. Change-Id: I4f9694f2a871b8effebdc9605c30b4288ab14b34 Signed-off-by: Maxime PORHEL <maxime.porhel@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/DiagramSplitMigrationParticipant.java35
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/NsURIMigrationParticipant.java7
2 files changed, 33 insertions, 9 deletions
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/DiagramSplitMigrationParticipant.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/DiagramSplitMigrationParticipant.java
index bc74e42394..1c404f2090 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/DiagramSplitMigrationParticipant.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/DiagramSplitMigrationParticipant.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.sirius.business.internal.migration;
+import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.sirius.business.api.migration.AbstractMigrationParticipant;
@@ -26,21 +27,28 @@ import org.osgi.framework.Version;
public class DiagramSplitMigrationParticipant extends AbstractMigrationParticipant {
/**
- * The version 8.0.0 corresponds to the file format of Sirius 1.0.0 M5.
+ * The version 8.0.0 corresponds to the file format of Sirius 1.0.0 M5.
*/
- private static final Version MIGRATION_VERSION = new Version("8.0.0");
+ private static final Version SIRIUS_1_0_0_M5_VERSION = new Version("8.0.0");
+
+ /**
+ * The version 8.1.0 corresponds to the file format of Sirius 1.0.0 M6.
+ */
+ private static final Version SIRIUS_1_0_0_M6_VERSION = new Version("8.1.0");
public Version getMigrationVersion() {
- return MIGRATION_VERSION;
+ return SIRIUS_1_0_0_M6_VERSION;
}
@Override
public EClassifier getType(EPackage ePackage, String name, String loadedVersion) {
EClassifier type = null;
- if (Version.parseVersion(loadedVersion).compareTo(MIGRATION_VERSION) < 0) {
- // org.eclipse.emf.ecore.EPackage.getEClassifier(String) will return
- // null if not found.
- // A map name -> classifier is populated once.
+
+ // org.eclipse.emf.ecore.EPackage.getEClassifier(String) will return
+ // null if not found.
+ // A map name -> classifier is populated once.
+
+ if (Version.parseVersion(loadedVersion).compareTo(SIRIUS_1_0_0_M5_VERSION) < 0) {
if (org.eclipse.sirius.viewpoint.ViewpointPackage.eINSTANCE.equals(ePackage)) {
type = org.eclipse.sirius.diagram.DiagramPackage.eINSTANCE.getEClassifier(name);
} else if (org.eclipse.sirius.viewpoint.description.DescriptionPackage.eINSTANCE.equals(ePackage)) {
@@ -50,6 +58,19 @@ public class DiagramSplitMigrationParticipant extends AbstractMigrationParticipa
} else if (org.eclipse.sirius.viewpoint.description.style.StylePackage.eINSTANCE.equals(ePackage)) {
type = org.eclipse.sirius.diagram.description.style.StylePackage.eINSTANCE.getEClassifier(name);
}
+ } else if (Version.parseVersion(loadedVersion).compareTo(SIRIUS_1_0_0_M6_VERSION) < 0) {
+ // Moved EClasses:
+ EClass containerDropDescription = org.eclipse.sirius.diagram.description.tool.ToolPackage.eINSTANCE.getContainerDropDescription();
+ EClass dragAndDropTarget = org.eclipse.sirius.diagram.DiagramPackage.eINSTANCE.getDragAndDropTarget();
+ EClass dragAndDropTargetDescription = org.eclipse.sirius.diagram.description.DescriptionPackage.eINSTANCE.getDragAndDropTargetDescription();
+
+ if (org.eclipse.sirius.viewpoint.description.tool.ToolPackage.eINSTANCE.equals(ePackage) && containerDropDescription.getName().equals(name)) {
+ type = containerDropDescription;
+ } else if (org.eclipse.sirius.viewpoint.ViewpointPackage.eINSTANCE.equals(ePackage) && dragAndDropTarget.getName().equals(name)) {
+ type = dragAndDropTarget;
+ } else if (org.eclipse.sirius.viewpoint.description.DescriptionPackage.eINSTANCE.equals(ePackage) && dragAndDropTargetDescription.getName().equals(name)) {
+ type = dragAndDropTargetDescription;
+ }
}
return type;
}
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/NsURIMigrationParticipant.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/NsURIMigrationParticipant.java
index 432f39bdef..4c40fa86b0 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/NsURIMigrationParticipant.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/NsURIMigrationParticipant.java
@@ -50,6 +50,9 @@ public class NsURIMigrationParticipant extends AbstractMigrationParticipant {
*/
private static final Version SIRIUS_1_0_0_M5_VERSION = new Version("8.0.0");
+ /**
+ * The version 8.1.0 corresponds to the file format of Sirius 1.0.0 M6.
+ */
private static final Version SIRIUS_1_0_0_M6_VERSION = new Version("8.1.0");
private static final Map<String, String> FROM_VIEWPOINT_NS_URI_MAPPINGS = ImmutableMap.<String, String> builder()
@@ -73,8 +76,8 @@ public class NsURIMigrationParticipant extends AbstractMigrationParticipant {
.put("http://www.obeo.fr/dsl/viewpoint/description/filter/1.1.0", SIRIUS_DIAGRAM_DESCRIPTION_FILTER_1_1_0)
.put("http://www.obeo.fr/dsl/viewpoint/description/validation/1.1.0", SIRIUS_DESCRIPTION_VALIDATION_1_1_0).build();
- private static final Map<String, String> FROM_SIRIUS_0_9_NS_URI_MAPPINGS = ImmutableMap.<String, String> builder()
- .put(SIRIUS_DESCRIPTION_CONCERN_1_1_0, SIRIUS_DIAGRAM_DESCRIPTION_CONCERN_1_1_0).put(SIRIUS_DESCRIPTION_FILTER_1_1_0, SIRIUS_DIAGRAM_DESCRIPTION_FILTER_1_1_0).build();
+ private static final Map<String, String> FROM_SIRIUS_0_9_NS_URI_MAPPINGS = ImmutableMap.<String, String> builder().put(SIRIUS_DESCRIPTION_CONCERN_1_1_0, SIRIUS_DIAGRAM_DESCRIPTION_CONCERN_1_1_0)
+ .put(SIRIUS_DESCRIPTION_FILTER_1_1_0, SIRIUS_DIAGRAM_DESCRIPTION_FILTER_1_1_0).build();
private static final Map<String, String> FROM_SIRIUS_1_0_0_M5_NS_URI_MAPPINGS = ImmutableMap.<String, String> builder()
.put(SIRIUS_DIAGRAM_DESCRIPTION_VALIDATION_1_1_0, SIRIUS_DESCRIPTION_VALIDATION_1_1_0).build();

Back to the top