Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoracuccuru2013-06-03 12:12:05 +0000
committeracuccuru2013-06-03 12:12:05 +0000
commit899e80868333f8df2d2c85c64c2682faabf04d58 (patch)
tree6c0e85b62b7ebebe345681573b8e3f8dd3c80545 /extraplugins/uml
parent0ba5dde6173cbb0675ba9f37a84d2e6f103bee4a (diff)
downloadorg.eclipse.papyrus-899e80868333f8df2d2c85c64c2682faabf04d58.tar.gz
org.eclipse.papyrus-899e80868333f8df2d2c85c64c2682faabf04d58.tar.xz
org.eclipse.papyrus-899e80868333f8df2d2c85c64c2682faabf04d58.zip
409711: [Compare 2] Papyrus shall provide a PostProcessor for Compare 2
https://bugs.eclipse.org/bugs/show_bug.cgi?id=409711
Diffstat (limited to 'extraplugins/uml')
-rw-r--r--extraplugins/uml/compare2/org.eclipse.papyrus.compare/.classpath7
-rw-r--r--extraplugins/uml/compare2/org.eclipse.papyrus.compare/.project28
-rw-r--r--extraplugins/uml/compare2/org.eclipse.papyrus.compare/META-INF/MANIFEST.MF22
-rw-r--r--extraplugins/uml/compare2/org.eclipse.papyrus.compare/build.properties10
-rw-r--r--extraplugins/uml/compare2/org.eclipse.papyrus.compare/model/papyrusCompare.ecore11
-rw-r--r--extraplugins/uml/compare2/org.eclipse.papyrus.compare/model/papyrusCompare.genmodel16
-rw-r--r--extraplugins/uml/compare2/org.eclipse.papyrus.compare/plugin.properties4
-rw-r--r--extraplugins/uml/compare2/org.eclipse.papyrus.compare/plugin.xml34
-rw-r--r--extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/ExtensionsFactory.java53
-rw-r--r--extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/ExtensionsPackage.java481
-rw-r--r--extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/PapyrusDiff.java29
-rw-r--r--extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/PapyrusGeneralizationChange.java90
-rw-r--r--extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/impl/ExtensionsFactoryImpl.java104
-rw-r--r--extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/impl/ExtensionsPackageImpl.java231
-rw-r--r--extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/impl/PapyrusDiffImpl.java51
-rw-r--r--extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/impl/PapyrusGeneralizationChangeImpl.java227
-rw-r--r--extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/util/ExtensionsAdapterFactory.java166
-rw-r--r--extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/util/ExtensionsSwitch.java160
-rw-r--r--extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/merge/PapyrusMerger.java111
-rw-r--r--extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/org/eclipse/papyrus/compare/postprocessor/PapyrusPostProcessor.java141
-rw-r--r--extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/org/eclipse/papyrus/compare/utils/GeneralizationChangesHelper.java310
21 files changed, 2286 insertions, 0 deletions
diff --git a/extraplugins/uml/compare2/org.eclipse.papyrus.compare/.classpath b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/.classpath
new file mode 100644
index 00000000000..3d1f8e3a126
--- /dev/null
+++ b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/extraplugins/uml/compare2/org.eclipse.papyrus.compare/.project b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/.project
new file mode 100644
index 00000000000..d0011a64e3b
--- /dev/null
+++ b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.compare</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/extraplugins/uml/compare2/org.eclipse.papyrus.compare/META-INF/MANIFEST.MF b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..1846bae1843
--- /dev/null
+++ b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/META-INF/MANIFEST.MF
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.compare;singleton:=true
+Bundle-Version: 0.1.0.qualifier
+Bundle-ClassPath: .
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Export-Package: extensions,
+ extensions.impl,
+ extensions.util,
+ merge,
+ org.eclipse.papyrus.compare.postprocessor
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.ecore,
+ org.eclipse.emf.compare;visibility:=reexport,
+ org.eclipse.emf.compare.diagram;visibility:=reexport,
+ org.eclipse.uml2.uml;bundle-version="4.1.0",
+ org.eclipse.gmf.runtime.notation;bundle-version="1.5.0",
+ org.eclipse.emf.compare.rcp;bundle-version="2.1.0"
+Bundle-ActivationPolicy: lazy
diff --git a/extraplugins/uml/compare2/org.eclipse.papyrus.compare/build.properties b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/build.properties
new file mode 100644
index 00000000000..4d3b18277b9
--- /dev/null
+++ b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/build.properties
@@ -0,0 +1,10 @@
+#
+
+bin.includes = .,\
+ model/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties
+jars.compile.order = .
+source.. = src/
+output.. = bin/
diff --git a/extraplugins/uml/compare2/org.eclipse.papyrus.compare/model/papyrusCompare.ecore b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/model/papyrusCompare.ecore
new file mode 100644
index 00000000000..54bd1745f63
--- /dev/null
+++ b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/model/papyrusCompare.ecore
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="extensions" nsURI="http://www.eclipse.org/emf/compare/papyrus"
+ nsPrefix="papyruscompare">
+ <eClassifiers xsi:type="ecore:EClass" name="PapyrusDiff" abstract="true" eSuperTypes="../../org.eclipse.emf.compare/model/compare.ecore#//Diff"/>
+ <eClassifiers xsi:type="ecore:EClass" name="PapyrusGeneralizationChange" eSuperTypes="#//PapyrusDiff">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="generalizationChange" eType="ecore:EClass ../../org.eclipse.emf.compare/model/compare.ecore#//ReferenceChange"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="inheritedFeatureNodeChange"
+ eType="ecore:EClass ../../org.eclipse.emf.compare.diagram/model/diagramCompare.ecore#//NodeChange"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/extraplugins/uml/compare2/org.eclipse.papyrus.compare/model/papyrusCompare.genmodel b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/model/papyrusCompare.genmodel
new file mode 100644
index 00000000000..5244396ee61
--- /dev/null
+++ b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/model/papyrusCompare.genmodel
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.emf.compare.papyrus/src" modelPluginID="org.eclipse.emf.compare.papyrus"
+ modelName="PapyrusCompare" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
+ importerID="org.eclipse.emf.importer.ecore" complianceLevel="7.0" copyrightFields="false"
+ usedGenPackages="../../org.eclipse.emf.compare/model/compare.genmodel#//compare ../../org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore ../../org.eclipse.emf.compare.diagram/model/diagramCompare.genmodel#//extensions"
+ operationReflection="true" importOrganizing="true">
+ <foreignModel>papyrusCompare.ecore</foreignModel>
+ <genPackages prefix="Extensions" disposableProviderFactory="true" ecorePackage="papyrusCompare.ecore#/">
+ <genClasses image="false" ecoreClass="papyrusCompare.ecore#//PapyrusDiff"/>
+ <genClasses ecoreClass="papyrusCompare.ecore#//PapyrusGeneralizationChange">
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference papyrusCompare.ecore#//PapyrusGeneralizationChange/generalizationChange"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference papyrusCompare.ecore#//PapyrusGeneralizationChange/inheritedFeatureNodeChange"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/extraplugins/uml/compare2/org.eclipse.papyrus.compare/plugin.properties b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/plugin.properties
new file mode 100644
index 00000000000..c070153c433
--- /dev/null
+++ b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/plugin.properties
@@ -0,0 +1,4 @@
+#
+
+pluginName = PapyrusCompare Model
+providerName = www.example.org
diff --git a/extraplugins/uml/compare2/org.eclipse.papyrus.compare/plugin.xml b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/plugin.xml
new file mode 100644
index 00000000000..da060dcfcb9
--- /dev/null
+++ b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/plugin.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <!-- @generated papyrusCompare -->
+ <package
+ uri="http://www.eclipse.org/emf/compare/papyrus"
+ class="extensions.ExtensionsPackage"
+ genModel="model/papyrusCompare.genmodel"/>
+ </extension>
+ <extension
+ point="org.eclipse.emf.compare.rcp.postProcessor">
+ <processor
+ class="org.eclipse.papyrus.compare.postprocessor.PapyrusPostProcessor"
+ ordinal="31">
+ <nsURI
+ value="http://www.eclipse.org/gmf/runtime/\d.\d.\d/notation">
+ </nsURI>
+ </processor>
+ </extension>
+ <extension
+ point="org.eclipse.emf.compare.rcp.merger">
+ <merger
+ class="merge.PapyrusMerger"
+ ranking="21">
+ </merger>
+ </extension>
+
+</plugin>
diff --git a/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/ExtensionsFactory.java b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/ExtensionsFactory.java
new file mode 100644
index 00000000000..30211055001
--- /dev/null
+++ b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/ExtensionsFactory.java
@@ -0,0 +1,53 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package extensions;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see extensions.ExtensionsPackage
+ * @generated
+ */
+public interface ExtensionsFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ ExtensionsFactory eINSTANCE = extensions.impl.ExtensionsFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Papyrus Generalization Change</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Papyrus Generalization Change</em>'.
+ * @generated
+ */
+ PapyrusGeneralizationChange createPapyrusGeneralizationChange();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ ExtensionsPackage getExtensionsPackage();
+
+} //ExtensionsFactory
diff --git a/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/ExtensionsPackage.java b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/ExtensionsPackage.java
new file mode 100644
index 00000000000..3a14294a8a1
--- /dev/null
+++ b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/ExtensionsPackage.java
@@ -0,0 +1,481 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package extensions;
+
+import org.eclipse.emf.compare.ComparePackage;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see extensions.ExtensionsFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface ExtensionsPackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "extensions";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.eclipse.org/emf/compare/papyrus";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "papyruscompare";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ ExtensionsPackage eINSTANCE = extensions.impl.ExtensionsPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link extensions.impl.PapyrusDiffImpl <em>Papyrus Diff</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see extensions.impl.PapyrusDiffImpl
+ * @see extensions.impl.ExtensionsPackageImpl#getPapyrusDiff()
+ * @generated
+ */
+ int PAPYRUS_DIFF = 0;
+
+ /**
+ * The feature id for the '<em><b>Match</b></em>' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_DIFF__MATCH = ComparePackage.DIFF__MATCH;
+
+ /**
+ * The feature id for the '<em><b>Requires</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_DIFF__REQUIRES = ComparePackage.DIFF__REQUIRES;
+
+ /**
+ * The feature id for the '<em><b>Required By</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_DIFF__REQUIRED_BY = ComparePackage.DIFF__REQUIRED_BY;
+
+ /**
+ * The feature id for the '<em><b>Refines</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_DIFF__REFINES = ComparePackage.DIFF__REFINES;
+
+ /**
+ * The feature id for the '<em><b>Refined By</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_DIFF__REFINED_BY = ComparePackage.DIFF__REFINED_BY;
+
+ /**
+ * The feature id for the '<em><b>Kind</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_DIFF__KIND = ComparePackage.DIFF__KIND;
+
+ /**
+ * The feature id for the '<em><b>Source</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_DIFF__SOURCE = ComparePackage.DIFF__SOURCE;
+
+ /**
+ * The feature id for the '<em><b>State</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_DIFF__STATE = ComparePackage.DIFF__STATE;
+
+ /**
+ * The feature id for the '<em><b>Equivalence</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_DIFF__EQUIVALENCE = ComparePackage.DIFF__EQUIVALENCE;
+
+ /**
+ * The feature id for the '<em><b>Conflict</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_DIFF__CONFLICT = ComparePackage.DIFF__CONFLICT;
+
+ /**
+ * The number of structural features of the '<em>Papyrus Diff</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_DIFF_FEATURE_COUNT = ComparePackage.DIFF_FEATURE_COUNT + 0;
+
+
+// /**
+// * The operation id for the '<em>Copy Right To Left</em>' operation.
+// * <!-- begin-user-doc -->
+// * <!-- end-user-doc -->
+// * @generated
+// * @ordered
+// */
+// int PAPYRUS_DIFF___COPY_RIGHT_TO_LEFT = ComparePackage.DIFF___COPY_RIGHT_TO_LEFT;
+//
+// /**
+// * The operation id for the '<em>Copy Left To Right</em>' operation.
+// * <!-- begin-user-doc -->
+// * <!-- end-user-doc -->
+// * @generated
+// * @ordered
+// */
+// int PAPYRUS_DIFF___COPY_LEFT_TO_RIGHT = ComparePackage.DIFF___COPY_LEFT_TO_RIGHT;
+//
+// /**
+// * The operation id for the '<em>Discard</em>' operation.
+// * <!-- begin-user-doc -->
+// * <!-- end-user-doc -->
+// * @generated
+// * @ordered
+// */
+// int PAPYRUS_DIFF___DISCARD = ComparePackage.DIFF___DISCARD;
+//
+// /**
+// * The number of operations of the '<em>Papyrus Diff</em>' class.
+// * <!-- begin-user-doc -->
+// * <!-- end-user-doc -->
+// * @generated
+// * @ordered
+// */
+// int PAPYRUS_DIFF_OPERATION_COUNT = ComparePackage.DIFF_OPERATION_COUNT + 0;
+
+ /**
+ * The meta object id for the '{@link extensions.impl.PapyrusGeneralizationChangeImpl <em>Papyrus Generalization Change</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see extensions.impl.PapyrusGeneralizationChangeImpl
+ * @see extensions.impl.ExtensionsPackageImpl#getPapyrusGeneralizationChange()
+ * @generated
+ */
+ int PAPYRUS_GENERALIZATION_CHANGE = 1;
+
+ /**
+ * The feature id for the '<em><b>Match</b></em>' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_GENERALIZATION_CHANGE__MATCH = PAPYRUS_DIFF__MATCH;
+
+ /**
+ * The feature id for the '<em><b>Requires</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_GENERALIZATION_CHANGE__REQUIRES = PAPYRUS_DIFF__REQUIRES;
+
+ /**
+ * The feature id for the '<em><b>Required By</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_GENERALIZATION_CHANGE__REQUIRED_BY = PAPYRUS_DIFF__REQUIRED_BY;
+
+ /**
+ * The feature id for the '<em><b>Refines</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_GENERALIZATION_CHANGE__REFINES = PAPYRUS_DIFF__REFINES;
+
+ /**
+ * The feature id for the '<em><b>Refined By</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_GENERALIZATION_CHANGE__REFINED_BY = PAPYRUS_DIFF__REFINED_BY;
+
+ /**
+ * The feature id for the '<em><b>Kind</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_GENERALIZATION_CHANGE__KIND = PAPYRUS_DIFF__KIND;
+
+ /**
+ * The feature id for the '<em><b>Source</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_GENERALIZATION_CHANGE__SOURCE = PAPYRUS_DIFF__SOURCE;
+
+ /**
+ * The feature id for the '<em><b>State</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_GENERALIZATION_CHANGE__STATE = PAPYRUS_DIFF__STATE;
+
+ /**
+ * The feature id for the '<em><b>Equivalence</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_GENERALIZATION_CHANGE__EQUIVALENCE = PAPYRUS_DIFF__EQUIVALENCE;
+
+ /**
+ * The feature id for the '<em><b>Conflict</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_GENERALIZATION_CHANGE__CONFLICT = PAPYRUS_DIFF__CONFLICT;
+
+ /**
+ * The feature id for the '<em><b>Generalization Change</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_GENERALIZATION_CHANGE__GENERALIZATION_CHANGE = PAPYRUS_DIFF_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Inherited Feature Node Change</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_GENERALIZATION_CHANGE__INHERITED_FEATURE_NODE_CHANGE = PAPYRUS_DIFF_FEATURE_COUNT + 1;
+
+ /**
+ * The number of structural features of the '<em>Papyrus Generalization Change</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_GENERALIZATION_CHANGE_FEATURE_COUNT = PAPYRUS_DIFF_FEATURE_COUNT + 2;
+
+// /**
+// * The operation id for the '<em>Copy Right To Left</em>' operation.
+// * <!-- begin-user-doc -->
+// * <!-- end-user-doc -->
+// * @generated
+// * @ordered
+// */
+// int PAPYRUS_GENERALIZATION_CHANGE___COPY_RIGHT_TO_LEFT = PAPYRUS_DIFF___COPY_RIGHT_TO_LEFT;
+//
+// /**
+// * The operation id for the '<em>Copy Left To Right</em>' operation.
+// * <!-- begin-user-doc -->
+// * <!-- end-user-doc -->
+// * @generated
+// * @ordered
+// */
+// int PAPYRUS_GENERALIZATION_CHANGE___COPY_LEFT_TO_RIGHT = PAPYRUS_DIFF___COPY_LEFT_TO_RIGHT;
+//
+// /**
+// * The operation id for the '<em>Discard</em>' operation.
+// * <!-- begin-user-doc -->
+// * <!-- end-user-doc -->
+// * @generated
+// * @ordered
+// */
+// int PAPYRUS_GENERALIZATION_CHANGE___DISCARD = PAPYRUS_DIFF___DISCARD;
+//
+// /**
+// * The number of operations of the '<em>Papyrus Generalization Change</em>' class.
+// * <!-- begin-user-doc -->
+// * <!-- end-user-doc -->
+// * @generated
+// * @ordered
+// */
+// int PAPYRUS_GENERALIZATION_CHANGE_OPERATION_COUNT = PAPYRUS_DIFF_OPERATION_COUNT + 0;
+
+
+ /**
+ * Returns the meta object for class '{@link extensions.PapyrusDiff <em>Papyrus Diff</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Papyrus Diff</em>'.
+ * @see extensions.PapyrusDiff
+ * @generated
+ */
+ EClass getPapyrusDiff();
+
+ /**
+ * Returns the meta object for class '{@link extensions.PapyrusGeneralizationChange <em>Papyrus Generalization Change</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Papyrus Generalization Change</em>'.
+ * @see extensions.PapyrusGeneralizationChange
+ * @generated
+ */
+ EClass getPapyrusGeneralizationChange();
+
+ /**
+ * Returns the meta object for the reference '{@link extensions.PapyrusGeneralizationChange#getGeneralizationChange <em>Generalization Change</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Generalization Change</em>'.
+ * @see extensions.PapyrusGeneralizationChange#getGeneralizationChange()
+ * @see #getPapyrusGeneralizationChange()
+ * @generated
+ */
+ EReference getPapyrusGeneralizationChange_GeneralizationChange();
+
+ /**
+ * Returns the meta object for the reference '{@link extensions.PapyrusGeneralizationChange#getInheritedFeatureNodeChange <em>Inherited Feature Node Change</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Inherited Feature Node Change</em>'.
+ * @see extensions.PapyrusGeneralizationChange#getInheritedFeatureNodeChange()
+ * @see #getPapyrusGeneralizationChange()
+ * @generated
+ */
+ EReference getPapyrusGeneralizationChange_InheritedFeatureNodeChange();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ ExtensionsFactory getExtensionsFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '{@link extensions.impl.PapyrusDiffImpl <em>Papyrus Diff</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see extensions.impl.PapyrusDiffImpl
+ * @see extensions.impl.ExtensionsPackageImpl#getPapyrusDiff()
+ * @generated
+ */
+ EClass PAPYRUS_DIFF = eINSTANCE.getPapyrusDiff();
+ /**
+ * The meta object literal for the '{@link extensions.impl.PapyrusGeneralizationChangeImpl <em>Papyrus Generalization Change</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see extensions.impl.PapyrusGeneralizationChangeImpl
+ * @see extensions.impl.ExtensionsPackageImpl#getPapyrusGeneralizationChange()
+ * @generated
+ */
+ EClass PAPYRUS_GENERALIZATION_CHANGE = eINSTANCE.getPapyrusGeneralizationChange();
+ /**
+ * The meta object literal for the '<em><b>Generalization Change</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PAPYRUS_GENERALIZATION_CHANGE__GENERALIZATION_CHANGE = eINSTANCE.getPapyrusGeneralizationChange_GeneralizationChange();
+ /**
+ * The meta object literal for the '<em><b>Inherited Feature Node Change</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PAPYRUS_GENERALIZATION_CHANGE__INHERITED_FEATURE_NODE_CHANGE = eINSTANCE.getPapyrusGeneralizationChange_InheritedFeatureNodeChange();
+
+ }
+
+} //ExtensionsPackage
diff --git a/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/PapyrusDiff.java b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/PapyrusDiff.java
new file mode 100644
index 00000000000..9b8b878fd46
--- /dev/null
+++ b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/PapyrusDiff.java
@@ -0,0 +1,29 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package extensions;
+
+import org.eclipse.emf.compare.Diff;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Papyrus Diff</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see extensions.ExtensionsPackage#getPapyrusDiff()
+ * @model abstract="true"
+ * @generated
+ */
+public interface PapyrusDiff extends Diff {
+} // PapyrusDiff
diff --git a/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/PapyrusGeneralizationChange.java b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/PapyrusGeneralizationChange.java
new file mode 100644
index 00000000000..da81ff03e7b
--- /dev/null
+++ b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/PapyrusGeneralizationChange.java
@@ -0,0 +1,90 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package extensions;
+
+import org.eclipse.emf.compare.ReferenceChange;
+import org.eclipse.emf.compare.diagram.internal.extensions.NodeChange;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Papyrus Generalization Change</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link extensions.PapyrusGeneralizationChange#getGeneralizationChange <em>Generalization Change</em>}</li>
+ * <li>{@link extensions.PapyrusGeneralizationChange#getInheritedFeatureNodeChange <em>Inherited Feature Node Change</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see extensions.ExtensionsPackage#getPapyrusGeneralizationChange()
+ * @model
+ * @generated
+ */
+@SuppressWarnings("restriction")
+public interface PapyrusGeneralizationChange extends PapyrusDiff {
+ /**
+ * Returns the value of the '<em><b>Generalization Change</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Generalization Change</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Generalization Change</em>' reference.
+ * @see #setGeneralizationChange(ReferenceChange)
+ * @see extensions.ExtensionsPackage#getPapyrusGeneralizationChange_GeneralizationChange()
+ * @model
+ * @generated
+ */
+ ReferenceChange getGeneralizationChange();
+
+ /**
+ * Sets the value of the '{@link extensions.PapyrusGeneralizationChange#getGeneralizationChange <em>Generalization Change</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Generalization Change</em>' reference.
+ * @see #getGeneralizationChange()
+ * @generated
+ */
+ void setGeneralizationChange(ReferenceChange value);
+
+ /**
+ * Returns the value of the '<em><b>Inherited Feature Node Change</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Inherited Feature Node Change</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Inherited Feature Node Change</em>' reference.
+ * @see #setInheritedFeatureNodeChange(NodeChange)
+ * @see extensions.ExtensionsPackage#getPapyrusGeneralizationChange_InheritedFeatureNodeChange()
+ * @model
+ * @generated
+ */
+ NodeChange getInheritedFeatureNodeChange();
+
+ /**
+ * Sets the value of the '{@link extensions.PapyrusGeneralizationChange#getInheritedFeatureNodeChange <em>Inherited Feature Node Change</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Inherited Feature Node Change</em>' reference.
+ * @see #getInheritedFeatureNodeChange()
+ * @generated
+ */
+ void setInheritedFeatureNodeChange(NodeChange value);
+
+} // PapyrusGeneralizationChange
diff --git a/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/impl/ExtensionsFactoryImpl.java b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/impl/ExtensionsFactoryImpl.java
new file mode 100644
index 00000000000..8b708b9c5c6
--- /dev/null
+++ b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/impl/ExtensionsFactoryImpl.java
@@ -0,0 +1,104 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package extensions.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+import extensions.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class ExtensionsFactoryImpl extends EFactoryImpl implements ExtensionsFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static ExtensionsFactory init() {
+ try {
+ ExtensionsFactory theExtensionsFactory = (ExtensionsFactory)EPackage.Registry.INSTANCE.getEFactory(ExtensionsPackage.eNS_URI);
+ if (theExtensionsFactory != null) {
+ return theExtensionsFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new ExtensionsFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ExtensionsFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case ExtensionsPackage.PAPYRUS_GENERALIZATION_CHANGE: return createPapyrusGeneralizationChange();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrusGeneralizationChange createPapyrusGeneralizationChange() {
+ PapyrusGeneralizationChangeImpl papyrusGeneralizationChange = new PapyrusGeneralizationChangeImpl();
+ return papyrusGeneralizationChange;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ExtensionsPackage getExtensionsPackage() {
+ return (ExtensionsPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static ExtensionsPackage getPackage() {
+ return ExtensionsPackage.eINSTANCE;
+ }
+
+} //ExtensionsFactoryImpl
diff --git a/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/impl/ExtensionsPackageImpl.java b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/impl/ExtensionsPackageImpl.java
new file mode 100644
index 00000000000..b9e1c2e67f3
--- /dev/null
+++ b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/impl/ExtensionsPackageImpl.java
@@ -0,0 +1,231 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package extensions.impl;
+
+import org.eclipse.emf.compare.ComparePackage;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import extensions.ExtensionsFactory;
+import extensions.ExtensionsPackage;
+import extensions.PapyrusDiff;
+import extensions.PapyrusGeneralizationChange;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class ExtensionsPackageImpl extends EPackageImpl implements ExtensionsPackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass papyrusDiffEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass papyrusGeneralizationChangeEClass = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * <p>Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see extensions.ExtensionsPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private ExtensionsPackageImpl() {
+ super(eNS_URI, ExtensionsFactory.eINSTANCE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
+ *
+ * <p>This method is used to initialize {@link ExtensionsPackage#eINSTANCE} when that field is accessed.
+ * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ @SuppressWarnings("restriction")
+ public static ExtensionsPackage init() {
+ if (isInited) return (ExtensionsPackage)EPackage.Registry.INSTANCE.getEPackage(ExtensionsPackage.eNS_URI);
+
+ // Obtain or create and register package
+ ExtensionsPackageImpl theExtensionsPackage = (ExtensionsPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ExtensionsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ExtensionsPackageImpl());
+
+ isInited = true;
+
+ // Initialize simple dependencies
+ org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage.eINSTANCE.eClass();
+
+ // Create package meta-data objects
+ theExtensionsPackage.createPackageContents();
+
+ // Initialize created meta-data
+ theExtensionsPackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theExtensionsPackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(ExtensionsPackage.eNS_URI, theExtensionsPackage);
+ return theExtensionsPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getPapyrusDiff() {
+ return papyrusDiffEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getPapyrusGeneralizationChange() {
+ return papyrusGeneralizationChangeEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPapyrusGeneralizationChange_GeneralizationChange() {
+ return (EReference)papyrusGeneralizationChangeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPapyrusGeneralizationChange_InheritedFeatureNodeChange() {
+ return (EReference)papyrusGeneralizationChangeEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ExtensionsFactory getExtensionsFactory() {
+ return (ExtensionsFactory)getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createPackageContents() {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ papyrusDiffEClass = createEClass(PAPYRUS_DIFF);
+
+ papyrusGeneralizationChangeEClass = createEClass(PAPYRUS_GENERALIZATION_CHANGE);
+ createEReference(papyrusGeneralizationChangeEClass, PAPYRUS_GENERALIZATION_CHANGE__GENERALIZATION_CHANGE);
+ createEReference(papyrusGeneralizationChangeEClass, PAPYRUS_GENERALIZATION_CHANGE__INHERITED_FEATURE_NODE_CHANGE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("restriction")
+ public void initializePackageContents() {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Obtain other dependent packages
+ ComparePackage theComparePackage = (ComparePackage)EPackage.Registry.INSTANCE.getEPackage(ComparePackage.eNS_URI);
+ org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage theExtensionsPackage_1 = (org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage)EPackage.Registry.INSTANCE.getEPackage(org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+ papyrusDiffEClass.getESuperTypes().add(theComparePackage.getDiff());
+ papyrusGeneralizationChangeEClass.getESuperTypes().add(this.getPapyrusDiff());
+
+ // Initialize classes, features, and operations; add parameters
+ initEClass(papyrusDiffEClass, PapyrusDiff.class, "PapyrusDiff", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+
+ initEClass(papyrusGeneralizationChangeEClass, PapyrusGeneralizationChange.class, "PapyrusGeneralizationChange", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getPapyrusGeneralizationChange_GeneralizationChange(), theComparePackage.getReferenceChange(), null, "generalizationChange", null, 0, 1, PapyrusGeneralizationChange.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getPapyrusGeneralizationChange_InheritedFeatureNodeChange(), theExtensionsPackage_1.getNodeChange(), null, "inheritedFeatureNodeChange", null, 0, 1, PapyrusGeneralizationChange.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Create resource
+ createResource(eNS_URI);
+ }
+
+} //ExtensionsPackageImpl
diff --git a/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/impl/PapyrusDiffImpl.java b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/impl/PapyrusDiffImpl.java
new file mode 100644
index 00000000000..8b33d167b89
--- /dev/null
+++ b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/impl/PapyrusDiffImpl.java
@@ -0,0 +1,51 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package extensions.impl;
+
+import org.eclipse.emf.compare.impl.DiffImpl;
+import org.eclipse.emf.ecore.EClass;
+
+import extensions.ExtensionsPackage;
+import extensions.PapyrusDiff;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Papyrus Diff</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * </p>
+ *
+ * @generated
+ */
+public abstract class PapyrusDiffImpl extends DiffImpl implements PapyrusDiff {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrusDiffImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return ExtensionsPackage.Literals.PAPYRUS_DIFF;
+ }
+
+} //PapyrusDiffImpl
diff --git a/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/impl/PapyrusGeneralizationChangeImpl.java b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/impl/PapyrusGeneralizationChangeImpl.java
new file mode 100644
index 00000000000..15d1d72a20a
--- /dev/null
+++ b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/impl/PapyrusGeneralizationChangeImpl.java
@@ -0,0 +1,227 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package extensions.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.compare.ReferenceChange;
+import org.eclipse.emf.compare.diagram.internal.extensions.NodeChange;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import extensions.ExtensionsPackage;
+import extensions.PapyrusGeneralizationChange;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Papyrus Generalization Change</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link extensions.impl.PapyrusGeneralizationChangeImpl#getGeneralizationChange <em>Generalization Change</em>}</li>
+ * <li>{@link extensions.impl.PapyrusGeneralizationChangeImpl#getInheritedFeatureNodeChange <em>Inherited Feature Node Change</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+@SuppressWarnings("restriction")
+public class PapyrusGeneralizationChangeImpl extends PapyrusDiffImpl implements PapyrusGeneralizationChange {
+ /**
+ * The cached value of the '{@link #getGeneralizationChange() <em>Generalization Change</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getGeneralizationChange()
+ * @generated
+ * @ordered
+ */
+ protected ReferenceChange generalizationChange;
+
+ /**
+ * The cached value of the '{@link #getInheritedFeatureNodeChange() <em>Inherited Feature Node Change</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getInheritedFeatureNodeChange()
+ * @generated
+ * @ordered
+ */
+ protected NodeChange inheritedFeatureNodeChange;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrusGeneralizationChangeImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return ExtensionsPackage.Literals.PAPYRUS_GENERALIZATION_CHANGE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ReferenceChange getGeneralizationChange() {
+ if (generalizationChange != null && generalizationChange.eIsProxy()) {
+ InternalEObject oldGeneralizationChange = (InternalEObject)generalizationChange;
+ generalizationChange = (ReferenceChange)eResolveProxy(oldGeneralizationChange);
+ if (generalizationChange != oldGeneralizationChange) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, ExtensionsPackage.PAPYRUS_GENERALIZATION_CHANGE__GENERALIZATION_CHANGE, oldGeneralizationChange, generalizationChange));
+ }
+ }
+ return generalizationChange;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ReferenceChange basicGetGeneralizationChange() {
+ return generalizationChange;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setGeneralizationChange(ReferenceChange newGeneralizationChange) {
+ ReferenceChange oldGeneralizationChange = generalizationChange;
+ generalizationChange = newGeneralizationChange;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ExtensionsPackage.PAPYRUS_GENERALIZATION_CHANGE__GENERALIZATION_CHANGE, oldGeneralizationChange, generalizationChange));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NodeChange getInheritedFeatureNodeChange() {
+ if (inheritedFeatureNodeChange != null && inheritedFeatureNodeChange.eIsProxy()) {
+ InternalEObject oldInheritedFeatureNodeChange = (InternalEObject)inheritedFeatureNodeChange;
+ inheritedFeatureNodeChange = (NodeChange)eResolveProxy(oldInheritedFeatureNodeChange);
+ if (inheritedFeatureNodeChange != oldInheritedFeatureNodeChange) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, ExtensionsPackage.PAPYRUS_GENERALIZATION_CHANGE__INHERITED_FEATURE_NODE_CHANGE, oldInheritedFeatureNodeChange, inheritedFeatureNodeChange));
+ }
+ }
+ return inheritedFeatureNodeChange;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NodeChange basicGetInheritedFeatureNodeChange() {
+ return inheritedFeatureNodeChange;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setInheritedFeatureNodeChange(NodeChange newInheritedFeatureNodeChange) {
+ NodeChange oldInheritedFeatureNodeChange = inheritedFeatureNodeChange;
+ inheritedFeatureNodeChange = newInheritedFeatureNodeChange;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ExtensionsPackage.PAPYRUS_GENERALIZATION_CHANGE__INHERITED_FEATURE_NODE_CHANGE, oldInheritedFeatureNodeChange, inheritedFeatureNodeChange));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case ExtensionsPackage.PAPYRUS_GENERALIZATION_CHANGE__GENERALIZATION_CHANGE:
+ if (resolve) return getGeneralizationChange();
+ return basicGetGeneralizationChange();
+ case ExtensionsPackage.PAPYRUS_GENERALIZATION_CHANGE__INHERITED_FEATURE_NODE_CHANGE:
+ if (resolve) return getInheritedFeatureNodeChange();
+ return basicGetInheritedFeatureNodeChange();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case ExtensionsPackage.PAPYRUS_GENERALIZATION_CHANGE__GENERALIZATION_CHANGE:
+ setGeneralizationChange((ReferenceChange)newValue);
+ return;
+ case ExtensionsPackage.PAPYRUS_GENERALIZATION_CHANGE__INHERITED_FEATURE_NODE_CHANGE:
+ setInheritedFeatureNodeChange((NodeChange)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case ExtensionsPackage.PAPYRUS_GENERALIZATION_CHANGE__GENERALIZATION_CHANGE:
+ setGeneralizationChange((ReferenceChange)null);
+ return;
+ case ExtensionsPackage.PAPYRUS_GENERALIZATION_CHANGE__INHERITED_FEATURE_NODE_CHANGE:
+ setInheritedFeatureNodeChange((NodeChange)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case ExtensionsPackage.PAPYRUS_GENERALIZATION_CHANGE__GENERALIZATION_CHANGE:
+ return generalizationChange != null;
+ case ExtensionsPackage.PAPYRUS_GENERALIZATION_CHANGE__INHERITED_FEATURE_NODE_CHANGE:
+ return inheritedFeatureNodeChange != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //PapyrusGeneralizationChangeImpl
diff --git a/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/util/ExtensionsAdapterFactory.java b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/util/ExtensionsAdapterFactory.java
new file mode 100644
index 00000000000..7ede6935a2d
--- /dev/null
+++ b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/util/ExtensionsAdapterFactory.java
@@ -0,0 +1,166 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package extensions.util;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.ecore.EObject;
+
+import extensions.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see extensions.ExtensionsPackage
+ * @generated
+ */
+public class ExtensionsAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static ExtensionsPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ExtensionsAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = ExtensionsPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ExtensionsSwitch<Adapter> modelSwitch =
+ new ExtensionsSwitch<Adapter>() {
+ @Override
+ public Adapter casePapyrusDiff(PapyrusDiff object) {
+ return createPapyrusDiffAdapter();
+ }
+ @Override
+ public Adapter casePapyrusGeneralizationChange(PapyrusGeneralizationChange object) {
+ return createPapyrusGeneralizationChangeAdapter();
+ }
+ @Override
+ public Adapter caseDiff(Diff object) {
+ return createDiffAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link extensions.PapyrusDiff <em>Papyrus Diff</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see extensions.PapyrusDiff
+ * @generated
+ */
+ public Adapter createPapyrusDiffAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link extensions.PapyrusGeneralizationChange <em>Papyrus Generalization Change</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see extensions.PapyrusGeneralizationChange
+ * @generated
+ */
+ public Adapter createPapyrusGeneralizationChangeAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.compare.Diff <em>Diff</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.emf.compare.Diff
+ * @generated
+ */
+ public Adapter createDiffAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //ExtensionsAdapterFactory
diff --git a/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/util/ExtensionsSwitch.java b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/util/ExtensionsSwitch.java
new file mode 100644
index 00000000000..bee23f8230e
--- /dev/null
+++ b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/extensions/util/ExtensionsSwitch.java
@@ -0,0 +1,160 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package extensions.util;
+
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.util.Switch;
+
+import extensions.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see extensions.ExtensionsPackage
+ * @generated
+ */
+public class ExtensionsSwitch<T> extends Switch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static ExtensionsPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ExtensionsSwitch() {
+ if (modelPackage == null) {
+ modelPackage = ExtensionsPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Checks whether this is a switch for the given package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @parameter ePackage the package in question.
+ * @return whether this is a switch for the given package.
+ * @generated
+ */
+ @Override
+ protected boolean isSwitchFor(EPackage ePackage) {
+ return ePackage == modelPackage;
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ @Override
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case ExtensionsPackage.PAPYRUS_DIFF: {
+ PapyrusDiff papyrusDiff = (PapyrusDiff)theEObject;
+ T result = casePapyrusDiff(papyrusDiff);
+ if (result == null) result = caseDiff(papyrusDiff);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case ExtensionsPackage.PAPYRUS_GENERALIZATION_CHANGE: {
+ PapyrusGeneralizationChange papyrusGeneralizationChange = (PapyrusGeneralizationChange)theEObject;
+ T result = casePapyrusGeneralizationChange(papyrusGeneralizationChange);
+ if (result == null) result = casePapyrusDiff(papyrusGeneralizationChange);
+ if (result == null) result = caseDiff(papyrusGeneralizationChange);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Papyrus Diff</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Papyrus Diff</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T casePapyrusDiff(PapyrusDiff object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Papyrus Generalization Change</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Papyrus Generalization Change</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T casePapyrusGeneralizationChange(PapyrusGeneralizationChange object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Diff</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Diff</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseDiff(Diff object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ @Override
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //ExtensionsSwitch
diff --git a/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/merge/PapyrusMerger.java b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/merge/PapyrusMerger.java
new file mode 100644
index 00000000000..9447a0f78a8
--- /dev/null
+++ b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/merge/PapyrusMerger.java
@@ -0,0 +1,111 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package merge;
+
+import org.eclipse.emf.common.util.Monitor;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.DifferenceSource;
+import org.eclipse.emf.compare.DifferenceState;
+import org.eclipse.emf.compare.merge.AbstractMerger;
+
+import extensions.PapyrusDiff;
+
+
+public class PapyrusMerger extends AbstractMerger {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.merge.IMerger#isMergerFor(org.eclipse.emf.compare.Diff)
+ */
+ public boolean isMergerFor(Diff target) {
+ return target instanceof PapyrusDiff;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.merge.IMerger#copyLeftToRight(org.eclipse.emf.compare.Diff,
+ * org.eclipse.emf.common.util.Monitor)
+ */
+ public void copyLeftToRight(Diff target, Monitor monitor) {
+ // Don't merge an already merged (or discarded) diff
+ if (target.getState() != DifferenceState.UNRESOLVED) {
+ return;
+ }
+ final PapyrusDiff diff = (PapyrusDiff)target;
+
+ setEquivalentDiffAsMerged(diff);
+
+ // Change the diff's state before we actually merge it : this allows us to avoid requirement cycles.
+ diff.setState(DifferenceState.MERGED);
+ // for (Diff refining : diff.getRefinedBy()) {
+ // mergeDiff(refining, false, monitor);
+ // }
+
+ if (diff.getSource() == DifferenceSource.LEFT) {
+ // merge all "requires" diffs
+ mergeRequires(diff, false, monitor);
+ } else {
+ // merge all "required by" diffs
+ mergeRequiredBy(diff, false, monitor);
+ }
+
+ for (Diff refining : diff.getRefinedBy()) {
+ mergeDiff(refining, false, monitor);
+ }
+ }
+
+ public void copyRightToLeft(Diff target, Monitor monitor) {
+ // Don't merge an already merged (or discarded) diff
+ if (target.getState() != DifferenceState.UNRESOLVED) {
+ return;
+ }
+ final PapyrusDiff diff = (PapyrusDiff)target;
+
+ setEquivalentDiffAsMerged(diff);
+
+ // Change the diff's state before we actually merge it : this allows us to avoid requirement cycles.
+ diff.setState(DifferenceState.MERGED);
+ // for (Diff refining : diff.getRefinedBy()) {
+ // mergeDiff(refining, true, monitor);
+ // }
+
+ if (diff.getSource() == DifferenceSource.LEFT) {
+ // merge all "required by" diffs
+ mergeRequiredBy(diff, true, monitor);
+ } else {
+ mergeRequires(diff, true, monitor);
+ }
+
+ for (Diff refining : diff.getRefinedBy()) {
+ mergeDiff(refining, true, monitor);
+ }
+ }
+
+ /**
+ * Iterates over the differences equivalent to {@code diff} and sets them as
+ * {@link DifferenceState#MERGED}.
+ *
+ * @param diff
+ * Diff which equivalences are to be considered merged.
+ */
+ private void setEquivalentDiffAsMerged(PapyrusDiff diff) {
+ if (diff.getEquivalence() != null) {
+ for (Diff equivalent : diff.getEquivalence().getDifferences()) {
+ equivalent.setState(DifferenceState.MERGED);
+ }
+ }
+ }
+}
diff --git a/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/org/eclipse/papyrus/compare/postprocessor/PapyrusPostProcessor.java b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/org/eclipse/papyrus/compare/postprocessor/PapyrusPostProcessor.java
new file mode 100644
index 00000000000..9d57c0ef802
--- /dev/null
+++ b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/org/eclipse/papyrus/compare/postprocessor/PapyrusPostProcessor.java
@@ -0,0 +1,141 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.compare.postprocessor;
+
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.emf.common.util.Monitor;
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.DifferenceKind;
+import org.eclipse.emf.compare.ReferenceChange;
+import org.eclipse.emf.compare.diagram.internal.extensions.NodeChange;
+import org.eclipse.emf.compare.postprocessor.IPostProcessor;
+import org.eclipse.papyrus.compare.utils.GeneralizationChangesHelper;
+import org.eclipse.uml2.uml.Class ;
+import org.eclipse.uml2.uml.Feature;
+import org.eclipse.uml2.uml.Generalization;
+
+/**
+ * PostProcessor specific to integration with Papyrus.
+ * Creates needed requirements between Diffs implying addition/deletion of Generalizations in a .uml model,
+ * and Diffs implying addition/deletion of graphical nodes for inherited features.
+ *
+ */
+@SuppressWarnings("restriction")
+public class PapyrusPostProcessor implements IPostProcessor {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postMatch(org.eclipse.emf.compare.Comparison, org.eclipse.emf.common.util.Monitor)
+ */
+ @Override
+ public void postMatch(Comparison comparison, Monitor monitor) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postDiff(org.eclipse.emf.compare.Comparison, org.eclipse.emf.common.util.Monitor)
+ */
+ @Override
+ public void postDiff(Comparison comparison, Monitor monitor) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postRequirements(org.eclipse.emf.compare.Comparison, org.eclipse.emf.common.util.Monitor)
+ */
+ @Override
+ public void postRequirements(Comparison comparison, Monitor monitor) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postEquivalences(org.eclipse.emf.compare.Comparison, org.eclipse.emf.common.util.Monitor)
+ */
+ @Override
+ public void postEquivalences(Comparison comparison, Monitor monitor) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postConflicts(org.eclipse.emf.compare.Comparison, org.eclipse.emf.common.util.Monitor)
+ */
+ @Override
+ public void postConflicts(Comparison comparison, Monitor monitor) {
+ }
+
+ /**
+ * This post comparison consists in computing additional requirements between Diffs contained in the given comparison,
+ * for Diffs implying addition/deletion of Generalizations in a .uml model, and Diffs implying addition/deletion of
+ * graphical nodes for inherited features.
+ * Requirements between those Diffs are added so that:
+ * - When a merge implies deletion of a Generalization, Diffs corresponding to deletion of nodes for inherited features (requiring this Generalization) are also merged
+ * - When a merge implies addition of a node for an inherited feature, Diffs corresponding to addition of a Generalization (required for the inheritance of this feature) are also merged
+ *
+ * It means that merging the deletion of a node for an inherited feature does not imply merging the deletion of a Generalization (required for this inheritance), if any.
+ *
+ * (non-Javadoc)
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postComparison(org.eclipse.emf.compare.Comparison, org.eclipse.emf.common.util.Monitor)
+ */
+ @Override
+ public void postComparison(Comparison comparison, Monitor monitor) {
+ // Construct a GeneralizationChangesHelper from the given comparison
+ GeneralizationChangesHelper helper = new GeneralizationChangesHelper(comparison) ;
+ // Use this helper to compute requirements
+ this.computeRequirements(helper);
+ }
+
+ /**
+ * Adds additional requirements between Diffs classified by the given helper.
+ * Requirements are added when required between Diffs implying addition/deletion of Generalizations in a .uml model,
+ * and Diffs implying addition/deletion of graphical nodes for inherited features.
+ *
+ * @param helper A GeneralizationChangesHelper containing a pre-classification of Diffs
+ */
+ protected void computeRequirements(GeneralizationChangesHelper helper) {
+ // Compute diff requirements related to additions of graphical nodes for inherited features
+ List<Class> classesWIthNodesForInheritedFeatures_ADDED = helper.getClassesWithInheritedPropertyNode(DifferenceKind.ADD) ;
+ for (Class c : classesWIthNodesForInheritedFeatures_ADDED) {
+ Set<Feature> features = helper.getInheritedFeaturesWithNodeChange(c) ;
+ for (Feature f : features) {
+ for (Generalization generalization : helper.getGeneralizationPath(c, f)) {
+ ReferenceChange generalizationAdded = helper.getGeneralizationChange(generalization) ;
+ if (generalizationAdded != null) {
+ NodeChange nodeAdded = helper.getFeatureNodeChange(f) ;
+ if (nodeAdded != null) {
+ nodeAdded.getRequires().add(generalizationAdded) ;
+ generalizationAdded.getRequiredBy().add(nodeAdded) ;
+ }
+ }
+ }
+ }
+ }
+
+ // Compute diff requirements related to deletions of nodes for inherited features
+ List<Class> classesWIthNodesForInheritedFeatures_DELETED = helper.getClassesWithInheritedPropertyNode(DifferenceKind.DELETE) ;
+ for (Class c : classesWIthNodesForInheritedFeatures_DELETED) {
+ Set<Feature> features = helper.getInheritedFeaturesWithNodeChange(c) ;
+ for (Feature f : features) {
+ for (Generalization generalization : helper.getGeneralizationPath(c, f)) {
+ ReferenceChange generalizationDeleted = helper.getGeneralizationChange(generalization) ;
+ if (generalizationDeleted != null) {
+ NodeChange nodeDeleted = helper.getFeatureNodeChange(f) ;
+ if (nodeDeleted != null) {
+ nodeDeleted.getRequiredBy().add(generalizationDeleted) ;
+ generalizationDeleted.getRequires().add(nodeDeleted) ;
+ }
+ }
+ }
+ }
+ }
+ }
+
+}
diff --git a/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/org/eclipse/papyrus/compare/utils/GeneralizationChangesHelper.java b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/org/eclipse/papyrus/compare/utils/GeneralizationChangesHelper.java
new file mode 100644
index 00000000000..7473800ddd7
--- /dev/null
+++ b/extraplugins/uml/compare2/org.eclipse.papyrus.compare/src/org/eclipse/papyrus/compare/utils/GeneralizationChangesHelper.java
@@ -0,0 +1,310 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.compare.utils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.DifferenceKind;
+import org.eclipse.emf.compare.ReferenceChange;
+import org.eclipse.emf.compare.diagram.internal.extensions.NodeChange;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.Feature;
+import org.eclipse.uml2.uml.Generalization;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Helper for extracting information used by the ComparePapyrusDiagramPostProcessor,
+ * in order to establish requirements between Diffs representing changes on Generalization in a .uml model,
+ * and Diffs representing changes on nodes for inherited features in .notation model.
+ *
+ */
+@SuppressWarnings("restriction")
+public class GeneralizationChangesHelper {
+
+ /**
+ * The Comparison analyzed by this GeneralizationChangesHelper
+ */
+ protected Comparison comparison ;
+
+ /**
+ * A mapping between Features and Diffs representing changes for corresponding graphical nodes,
+ * in the case where these graphical nodes represent inherited features, in the context of a node
+ * for an inheriting classifier.
+ */
+ protected Map<Feature, NodeChange> displayedInheritedFeatureToNodeChange = new HashMap<Feature, NodeChange>() ;
+
+ /**
+ * A mapping between Generalizations and Diffs representing addition or deletion of this generalization.
+ */
+ protected Map<Generalization, ReferenceChange> generalizationToReferenceChange = new HashMap<Generalization, ReferenceChange>() ;
+
+ /**
+ * A mapping between pairings of Classifier/Feature to Generalization path, where a path is a List<Generalization>,
+ * and represents the list of Generalization required by a given Classifier to inherit from a given Feature
+ */
+ protected Map<Classifier, Map<Feature, List<Generalization>>> classifierAndFeatureToGeneralizationPath = new HashMap<Classifier, Map<Feature, List<Generalization>>>() ;
+
+ /**
+ * The list of Classes for which there exists a Diff implying addition of a node for an inherited Feature.
+ * FIXME Shall work for Classifiers in general
+ */
+ protected List<Class> classesWithNodeForInheritedFeature_ADDED = new ArrayList<Class>() ;
+
+ /**
+ * The list of Classes for which there exists a Diff implying deletion of a node for an inherited Feature.
+ * FIXME Shall work for Classifiers in general
+ */
+ protected List<Class> classesWithNodeForInheritedFeature_DELETED = new ArrayList<Class>() ;
+
+ /**
+ * Constructor for this helper. Instantiation of this helper implies classification of Diffs associated with the given comparison.
+ *
+ * @param comparison
+ */
+ public GeneralizationChangesHelper(Comparison comparison) {
+ this.comparison = comparison ;
+ this.classifyDiffs();
+ }
+
+ /**
+ * Classify Diffs related to the context Comparison.
+ * Classification consists in:
+ * - Identifying Diffs corresponding to changes on Generalizations in the .uml model
+ * - identifying Diffs corresponding to changes on nodes representing inherited features in the .notation model
+ * - Constructing local maps and lists to ease navigation between semantic elements and classified diffs
+ * (c.f., displayedInheritedFeatureToNodeChange, generalizationToReferenceChange, classifierAndFeatureToGeneralizationPath,
+ * classesWithNodeForInheritedFeature_ADDED, classesWithNodeForInheritedFeature_DELETED)
+ */
+ protected void classifyDiffs() {
+ for (Diff difference : this.comparison.getDifferences()) {
+ if (difference instanceof ReferenceChange) {
+ this.evaluateGeneralizationChange((ReferenceChange)difference) ;
+ }
+ else if (difference instanceof NodeChange) {
+ this.evaluateNodeForInheritedFeatureChange((NodeChange)difference) ;
+ }
+ }
+ }
+
+ /**
+ * Evaluates if the given difference concerns a change on a Generalization,
+ * and classifies it accordingly.
+ *
+ * @param difference The difference being evaluated
+ */
+ protected void evaluateGeneralizationChange(ReferenceChange difference) {
+ // difference is a generalization if the associated eReference is Classifier.generalization
+ if (difference.getReference().equals(UMLPackage.eINSTANCE.getClassifier_Generalization())) {
+ this.generalizationToReferenceChange.put((Generalization)difference.getValue(), difference) ;
+ }
+ }
+
+ /**
+ * Evaluates if the given difference concerns a change on a node (in the .notation)
+ * representing an inherited feature, and classifies it accordingly.
+ *
+ * @param difference The difference being evaluated
+ */
+ protected void evaluateNodeForInheritedFeatureChange(NodeChange difference) {
+ Feature feature = null ;
+ View view = null ;
+ // Determines if the NodeChange concerns a View for a Feature
+ if (difference.getView() != null && (difference.getView() instanceof View)) {
+ view = (View)difference.getView() ;
+ EObject semanticElement = view.getElement() ;
+ if (semanticElement == null || ! (semanticElement instanceof Feature)) {
+ return ;
+ }
+ else {
+ feature = (Feature)semanticElement ;
+ }
+ }
+ // Determines if the View corresponds to an inherited Feature.
+ // Requires to retrieve the View for the Class containing this Feature
+ Class class_ = null ;
+ EObject viewContainer = view.eContainer() ;
+ while (viewContainer != null && class_ == null) {
+ if (viewContainer instanceof View) {
+ EObject semanticElement = ((View)viewContainer).getElement() ;
+ if (semanticElement != null && semanticElement instanceof Class) {
+ class_ = (Class)semanticElement ;
+ }
+ }
+ viewContainer = viewContainer.eContainer() ;
+ }
+ if (class_ == null) {
+ return ;
+ }
+ // The difference is added to the appropriate collections if the
+ // corresponding feature is an inherited member of the Class
+ if (class_.getInheritedMembers().contains(feature)) {
+ if (difference.getKind() == DifferenceKind.ADD) {
+ if (! this.classesWithNodeForInheritedFeature_ADDED.contains(class_)) {
+ this.classesWithNodeForInheritedFeature_ADDED.add(class_) ;
+ }
+ }
+ else if (difference.getKind() == DifferenceKind.DELETE) {
+ if (! this.classesWithNodeForInheritedFeature_DELETED.contains(class_)) {
+ this.classesWithNodeForInheritedFeature_DELETED.add(class_) ;
+ }
+ }
+ List<Generalization> path = this.computeGeneralizationPath(class_, feature) ;
+ this.insertGeneralizationPath(class_, feature, path);
+ this.displayedInheritedFeatureToNodeChange.put(feature, difference) ;
+ }
+ }
+
+ /**
+ * Returns Classes for which there are changes on nodes representing inherited properties,
+ * with the given difference kind.
+ *
+ * @param kind The DifferenceKind for changes on nodes representing inherited properties
+ * @return Classes for which there are changes on nodes representing inherited properties, with the given DifferenceKind
+ */
+ public List<Class> getClassesWithInheritedPropertyNode(DifferenceKind kind) {
+ if (kind == DifferenceKind.ADD) {
+ return this.classesWithNodeForInheritedFeature_ADDED ;
+ }
+ else if (kind == DifferenceKind.DELETE) {
+ return this.classesWithNodeForInheritedFeature_DELETED ;
+ }
+ // Not supposed to happen
+ return new ArrayList<Class>() ;
+ }
+
+ /**
+ * Returns the Generalization path which enables the given classifier to inherit from the given feature.
+ * If no generalization path is found, returns an empty list
+ *
+ * FIXME Currently returns the first Generalization path that matches. Since multiple inheritance is allowed in UML, there can be multiple paths
+ *
+ * @param classifier
+ * @param inherited
+ * @return the Generalization path which enables the given classifier to inherit from the given feature.
+ */
+ public List<Generalization> getGeneralizationPath(Classifier classifier, Feature inherited) {
+ List<Generalization> path = null ;
+ Map<Feature, List<Generalization>> inheritedFeatureToPath = this.classifierAndFeatureToGeneralizationPath.get(classifier) ;
+ if (inheritedFeatureToPath != null) {
+ path = inheritedFeatureToPath.get(inherited) ;
+ }
+ return path != null ? path : new ArrayList<Generalization>() ;
+ }
+
+ /**
+ * From the inherited features of the given classifier, returns those for which the inherited features of
+ * the given classifier that are related to changes on graphical nodes.
+ *
+ * @param classifier
+ * @return the inherited features of the given classifier that are related to change on graphical nodes
+ */
+ public Set<Feature> getInheritedFeaturesWithNodeChange(Classifier classifier) {
+ Set<Feature> inheritedFeatures = null ;
+ Map<Feature, List<Generalization>> inheritedFeatureToPath = this.classifierAndFeatureToGeneralizationPath.get(classifier) ;
+ if (inheritedFeatureToPath != null) {
+ inheritedFeatures = inheritedFeatureToPath.keySet() ;
+ }
+ if (inheritedFeatures == null)
+ inheritedFeatures = new HashSet<Feature>() ;
+ return inheritedFeatures ;
+ }
+
+ /**
+ * Returns the generalization path that enables the given classifier to inherit from the given feature.
+ *
+ * FIXME Currently returns the first Generalization path that matches. Since multiple inheritance is allowed in UML, there can be multiple paths
+ *
+ * @param classifier
+ * @param inherited
+ * @return the generalization path that enables the given classifier to inherit from the given feature.
+ */
+ protected List<Generalization> computeGeneralizationPath(Classifier classifier, Feature inherited) {
+ Classifier featuringClassifier = inherited.getFeaturingClassifiers().get(0) ; // There is always 1 and only 1 featuring classifier
+ Generalization match = null ;
+ for (int i = 0 ; i < classifier.getGeneralizations().size() && match == null ; i++) {
+ Generalization generalization = classifier.getGeneralizations().get(i) ;
+ if (generalization.getGeneral() == featuringClassifier) {
+ match = generalization ;
+ }
+ }
+ List<Generalization> path = new ArrayList<>() ;
+ // if no match found, it means that the feature is not directly inherited.
+ // Repeat recursively on general classifiers of the classifier to construct the generalization path
+ if (match == null) {
+ for (int i = 0 ; i < classifier.getGeneralizations().size() && path.size() == 0 ; i++) {
+ Generalization generalization = classifier.getGeneralizations().get(i) ;
+ Classifier general = generalization.getGeneral() ;
+ List<Generalization> remaining = this.computeGeneralizationPath(general, inherited) ;
+ if (remaining.size() != 0) {
+ path.add(generalization) ;
+ path.addAll(remaining) ;
+ }
+ }
+ }
+ else {
+ path = new ArrayList<Generalization>() ;
+ path.add(match) ;
+ }
+ return path ;
+ }
+
+ /**
+ * Inserts a generalization path in the local map inheritedFeatureToGeneralizationPath,
+ * in the context of a specific classifier (cf. classifierAndFeatureToGeneralizationPath)
+ *
+ * @param classifier The context classifier that inherits the given feature
+ * @param inherited The feature inherited following the given path, in the context of the given classifier
+ * @param path The generalization path (as a List) enabling the given classifier to inherit from the given feature
+ */
+ protected void insertGeneralizationPath(Classifier classifier, Feature inherited, List<Generalization> path) {
+ Map<Feature, List<Generalization>> inheritedFeatureToGeneralizationPath = this.classifierAndFeatureToGeneralizationPath.get(classifier) ;
+ if (inheritedFeatureToGeneralizationPath == null) {
+ inheritedFeatureToGeneralizationPath = new HashMap<Feature, List<Generalization>>() ;
+ }
+ inheritedFeatureToGeneralizationPath.put(inherited, path) ;
+ this.classifierAndFeatureToGeneralizationPath.put(classifier, inheritedFeatureToGeneralizationPath) ;
+ }
+
+ /**
+ * From the comparison object from which this helper was constructed,
+ * returns the ReferenceChange diff corresponding to the given Generalization, if any.
+ *
+ * @param generalization
+ * @return the ReferenceChange diff corresponding to the given Generalization, if any.
+ */
+ public ReferenceChange getGeneralizationChange(Generalization generalization) {
+ return this.generalizationToReferenceChange.get(generalization) ;
+ }
+
+ /**
+ * From the comparison object from which this helper was constructed,
+ * returns the NodeChange diff corresponding to the given feature, if any.
+ *
+ * @param feature
+ * @return
+ */
+ public NodeChange getFeatureNodeChange(Feature feature) {
+ return this.displayedInheritedFeatureToNodeChange.get(feature) ;
+ }
+}

Back to the top