From 4ee5ece3d9292ea5a3f7703fbf060380e23b89cd Mon Sep 17 00:00:00 2001
From: Axel Richard
Date: Fri, 1 Feb 2013 16:08:06 +0100
Subject: [399456] Managed enhance readability of Resource Attachment Change
- The left and right content viewer parts are now displaying the content
of the fragmented resource in case of the resource attachment change
involved a fragmented resource.
- The resource attachment changes are now displayed under their
associated match resource.
- The filter Resource Mappings is now filtering out only match resources
which don't contain resource attachment changes.
- Add a new eOpposite reference (opposite of matchedResources of
Comparison) on the MatchResource eClass of the compare.ecore metamodel
Change-Id: Ide411601025101b1f93b22855e0c5668b5b8b79b---
.../org.eclipse.emf.compare.edit/plugin.properties | 167 +-
.../emf/compare/provider/EMFCompareEditPlugin.java | 202 +-
.../provider/spec/ComparisonItemProviderSpec.java | 6 +-
.../provider/spec/MatchItemProviderSpec.java | 546 +--
.../spec/MatchResourceItemProviderSpec.java | 312 +-
.../spec/ReferenceChangeItemProviderSpec.java | 529 +--
.../ResourceAttachmentChangeItemProviderSpec.java | 2 +-
plugins/org.eclipse.emf.compare.rcp.ui/plugin.xml | 4 +-
.../BasicResourceContentsAccessorImpl.java | 14 +-
.../filters/EmptyMatchedResourcesFilter.java | 135 +
.../filters/MatchedResourcesFilter.java | 112 -
.../filters/StructureMergeViewerFilter.java | 10 +-
.../org.eclipse.emf.compare/model/compare.ecore | 4 +-
.../org.eclipse.emf.compare/model/compare.genmodel | 5 +-
.../org/eclipse/emf/compare/ComparePackage.java | 3742 ++++++++++----------
.../org/eclipse/emf/compare/Comparison.java | 337 +-
.../org/eclipse/emf/compare/MatchResource.java | 427 +--
.../emf/compare/impl/ComparePackageImpl.java | 2032 ++++++-----
.../eclipse/emf/compare/impl/ComparisonImpl.java | 791 ++---
.../emf/compare/impl/MatchResourceImpl.java | 1020 +++---
20 files changed, 5279 insertions(+), 5118 deletions(-)
create mode 100644 plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/EmptyMatchedResourcesFilter.java
delete mode 100644 plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/MatchedResourcesFilter.java
diff --git a/plugins/org.eclipse.emf.compare.edit/plugin.properties b/plugins/org.eclipse.emf.compare.edit/plugin.properties
index cfc399b97..85f997260 100644
--- a/plugins/org.eclipse.emf.compare.edit/plugin.properties
+++ b/plugins/org.eclipse.emf.compare.edit/plugin.properties
@@ -1,83 +1,84 @@
-# Copyright (c) 2012 Obeo.
-# 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:
-# Obeo - initial API and implementation
-
-pluginName = Compare Edit Support
-providerName = Eclipse Modeling Project
-
-_UI_CreateChild_text = {0}
-_UI_CreateChild_text2 = {1} {0}
-_UI_CreateChild_text3 = {1}
-_UI_CreateChild_tooltip = Create New {0} Under {1} Feature
-_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}.
-_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent.
-
-_UI_PropertyDescriptor_description = The {0} of the {1}
-
-_UI_Comparison_type = Comparison
-_UI_MatchResource_type = Match Resource
-_UI_Match_type = Match
-_UI_Diff_type = Diff
-_UI_ResourceAttachmentChange_type = Resource Attachment Change
-_UI_ReferenceChange_type = Reference Change
-_UI_AttributeChange_type = Attribute Change
-_UI_Conflict_type = Conflict
-_UI_Equivalence_type = Equivalence
-_UI_Unknown_type = Object
-
-_UI_Unknown_datatype= Value
-
-_UI_Comparison_matchedResources_feature = Matched Resources
-_UI_Comparison_matches_feature = Matches
-_UI_Comparison_conflicts_feature = Conflicts
-_UI_MatchResource_leftURI_feature = Left URI
-_UI_MatchResource_rightURI_feature = Right URI
-_UI_MatchResource_originURI_feature = Origin URI
-_UI_Match_subMatches_feature = Sub Matches
-_UI_Match_differences_feature = Differences
-_UI_Match_left_feature = Left
-_UI_Match_right_feature = Right
-_UI_Match_origin_feature = Origin
-_UI_Diff_match_feature = Match
-_UI_Diff_requires_feature = Requires
-_UI_Diff_requiredBy_feature = Required By
-_UI_Diff_refines_feature = Refines
-_UI_Diff_refinedBy_feature = Refined By
-_UI_Diff_kind_feature = Kind
-_UI_Diff_equivalentDiffs_feature = Equivalent Diffs
-_UI_Diff_conflict_feature = Conflict
-_UI_ResourceAttachmentChange_resourceURI_feature = Resource URI
-_UI_ReferenceChange_reference_feature = Reference
-_UI_ReferenceChange_value_feature = Value
-_UI_AttributeChange_attribute_feature = Attribute
-_UI_AttributeChange_value_feature = Value
-_UI_Conflict_differences_feature = Differences
-_UI_Equivalence_differences_feature = Differences
-_UI_Unknown_feature = Unspecified
-
-_UI_DifferenceKind_ADD_literal = ADD
-_UI_DifferenceKind_DELETE_literal = DELETE
-_UI_DifferenceKind_CHANGE_literal = CHANGE
-_UI_DifferenceKind_MOVE_literal = MOVE
-_UI_DifferenceSource_LEFT_literal = LEFT
-_UI_DifferenceSource_RIGHT_literal = RIGHT
-_UI_Match_submatches_feature = Submatches
-_UI_Diff_source_feature = Source
-_UI_MatchResource_left_feature = Left
-_UI_MatchResource_right_feature = Right
-_UI_MatchResource_origin_feature = Origin
-_UI_Diff_equivalence_feature = Equivalence
-_UI_Conflict_kind_feature = Kind
-_UI_ConflictKind_REAL_literal = REAL
-_UI_ConflictKind_PSEUDO_literal = PSEUDO
-_UI_Comparison_equivalences_feature = Equivalences
-_UI_Diff_state_feature = State
-_UI_DifferenceState_UNRESOLVED_literal = UNRESOLVED
-_UI_DifferenceState_MERGED_literal = MERGED
-_UI_DifferenceState_DISCARDED_literal = DISCARDED
-_UI_Comparison_threeWay_feature = Three Way
+# Copyright (c) 2012 Obeo.
+# 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:
+# Obeo - initial API and implementation
+
+pluginName = Compare Edit Support
+providerName = Eclipse Modeling Project
+
+_UI_CreateChild_text = {0}
+_UI_CreateChild_text2 = {1} {0}
+_UI_CreateChild_text3 = {1}
+_UI_CreateChild_tooltip = Create New {0} Under {1} Feature
+_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}.
+_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent.
+
+_UI_PropertyDescriptor_description = The {0} of the {1}
+
+_UI_Comparison_type = Comparison
+_UI_MatchResource_type = Match Resource
+_UI_Match_type = Match
+_UI_Diff_type = Diff
+_UI_ResourceAttachmentChange_type = Resource Attachment Change
+_UI_ReferenceChange_type = Reference Change
+_UI_AttributeChange_type = Attribute Change
+_UI_Conflict_type = Conflict
+_UI_Equivalence_type = Equivalence
+_UI_Unknown_type = Object
+
+_UI_Unknown_datatype= Value
+
+_UI_Comparison_matchedResources_feature = Matched Resources
+_UI_Comparison_matches_feature = Matches
+_UI_Comparison_conflicts_feature = Conflicts
+_UI_MatchResource_leftURI_feature = Left URI
+_UI_MatchResource_rightURI_feature = Right URI
+_UI_MatchResource_originURI_feature = Origin URI
+_UI_Match_subMatches_feature = Sub Matches
+_UI_Match_differences_feature = Differences
+_UI_Match_left_feature = Left
+_UI_Match_right_feature = Right
+_UI_Match_origin_feature = Origin
+_UI_Diff_match_feature = Match
+_UI_Diff_requires_feature = Requires
+_UI_Diff_requiredBy_feature = Required By
+_UI_Diff_refines_feature = Refines
+_UI_Diff_refinedBy_feature = Refined By
+_UI_Diff_kind_feature = Kind
+_UI_Diff_equivalentDiffs_feature = Equivalent Diffs
+_UI_Diff_conflict_feature = Conflict
+_UI_ResourceAttachmentChange_resourceURI_feature = Resource URI
+_UI_ReferenceChange_reference_feature = Reference
+_UI_ReferenceChange_value_feature = Value
+_UI_AttributeChange_attribute_feature = Attribute
+_UI_AttributeChange_value_feature = Value
+_UI_Conflict_differences_feature = Differences
+_UI_Equivalence_differences_feature = Differences
+_UI_Unknown_feature = Unspecified
+
+_UI_DifferenceKind_ADD_literal = ADD
+_UI_DifferenceKind_DELETE_literal = DELETE
+_UI_DifferenceKind_CHANGE_literal = CHANGE
+_UI_DifferenceKind_MOVE_literal = MOVE
+_UI_DifferenceSource_LEFT_literal = LEFT
+_UI_DifferenceSource_RIGHT_literal = RIGHT
+_UI_Match_submatches_feature = Submatches
+_UI_Diff_source_feature = Source
+_UI_MatchResource_left_feature = Left
+_UI_MatchResource_right_feature = Right
+_UI_MatchResource_origin_feature = Origin
+_UI_Diff_equivalence_feature = Equivalence
+_UI_Conflict_kind_feature = Kind
+_UI_ConflictKind_REAL_literal = REAL
+_UI_ConflictKind_PSEUDO_literal = PSEUDO
+_UI_Comparison_equivalences_feature = Equivalences
+_UI_Diff_state_feature = State
+_UI_DifferenceState_UNRESOLVED_literal = UNRESOLVED
+_UI_DifferenceState_MERGED_literal = MERGED
+_UI_DifferenceState_DISCARDED_literal = DISCARDED
+_UI_Comparison_threeWay_feature = Three Way
+_UI_MatchResource_comparison_feature = Comparison
diff --git a/plugins/org.eclipse.emf.compare.edit/src-gen/org/eclipse/emf/compare/provider/EMFCompareEditPlugin.java b/plugins/org.eclipse.emf.compare.edit/src-gen/org/eclipse/emf/compare/provider/EMFCompareEditPlugin.java
index 4054e25cd..a998adfe2 100644
--- a/plugins/org.eclipse.emf.compare.edit/src-gen/org/eclipse/emf/compare/provider/EMFCompareEditPlugin.java
+++ b/plugins/org.eclipse.emf.compare.edit/src-gen/org/eclipse/emf/compare/provider/EMFCompareEditPlugin.java
@@ -1,101 +1,101 @@
-/**
- * Copyright (c) 2012 Obeo.
- * 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:
- * Obeo - initial API and implementation
- */
-package org.eclipse.emf.compare.provider;
-
-import org.eclipse.emf.common.EMFPlugin;
-import org.eclipse.emf.common.util.ResourceLocator;
-import org.eclipse.emf.ecore.provider.EcoreEditPlugin;
-
-/**
- * This is the central singleton for the Compare edit plugin.
- *
- * @generated
- */
-public final class EMFCompareEditPlugin extends EMFPlugin {
-
- /**
- * The plug-in ID.
- *
- * @since 3.0
- */
- public static final String PLUGIN_ID = "org.eclipse.emf.compare.edit"; //$NON-NLS-1$
-
- /**
- *
- * @generated
- */
- public static final String copyright = "Copyright (c) 2012 Obeo.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Obeo - initial API and implementation"; //$NON-NLS-1$
-
- /**
- * Keep track of the singleton.
- *
- * @generated
- */
- public static final EMFCompareEditPlugin INSTANCE = new EMFCompareEditPlugin();
-
- /**
- * Keep track of the singleton.
- *
- * @generated
- */
- private static Implementation plugin;
-
- /**
- * Create the instance.
- *
- * @generated
- */
- public EMFCompareEditPlugin() {
- super(new ResourceLocator[] {EcoreEditPlugin.INSTANCE, });
- }
-
- /**
- * Returns the singleton instance of the Eclipse plugin.
- *
- * @return the singleton instance.
- * @generated
- */
- @Override
- public ResourceLocator getPluginResourceLocator() {
- return plugin;
- }
-
- /**
- * Returns the singleton instance of the Eclipse plugin.
- *
- * @return the singleton instance.
- * @generated
- */
- public static Implementation getPlugin() {
- return plugin;
- }
-
- /**
- * The actual implementation of the Eclipse Plugin.
- *
- * @generated
- */
- public static class Implementation extends EclipsePlugin {
- /**
- * Creates an instance.
- *
- * @generated
- */
- public Implementation() {
- super();
-
- // Remember the static instance.
- //
- plugin = this;
- }
- }
-
-}
+/**
+ * Copyright (c) 2012 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ */
+package org.eclipse.emf.compare.provider;
+
+import org.eclipse.emf.common.EMFPlugin;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.provider.EcoreEditPlugin;
+
+/**
+ * This is the central singleton for the Compare edit plugin.
+ *
+ * @generated
+ */
+public final class EMFCompareEditPlugin extends EMFPlugin {
+
+ /**
+ * The plug-in ID.
+ *
+ * @since 3.0
+ */
+ public static final String PLUGIN_ID = "org.eclipse.emf.compare.edit"; //$NON-NLS-1$
+
+ /**
+ *
+ * @generated
+ */
+ public static final String copyright = "Copyright (c) 2012 Obeo.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Obeo - initial API and implementation"; //$NON-NLS-1$
+
+ /**
+ * Keep track of the singleton.
+ *
+ * @generated
+ */
+ public static final EMFCompareEditPlugin INSTANCE = new EMFCompareEditPlugin();
+
+ /**
+ * Keep track of the singleton.
+ *
+ * @generated
+ */
+ private static Implementation plugin;
+
+ /**
+ * Create the instance.
+ *
+ * @generated
+ */
+ public EMFCompareEditPlugin() {
+ super(new ResourceLocator[] {EcoreEditPlugin.INSTANCE, });
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ *
+ * @return the singleton instance.
+ * @generated
+ */
+ @Override
+ public ResourceLocator getPluginResourceLocator() {
+ return plugin;
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ *
+ * @return the singleton instance.
+ * @generated
+ */
+ public static Implementation getPlugin() {
+ return plugin;
+ }
+
+ /**
+ * The actual implementation of the Eclipse Plugin.
+ *
+ * @generated
+ */
+ public static class Implementation extends EclipsePlugin {
+ /**
+ * Creates an instance.
+ *
+ * @generated
+ */
+ public Implementation() {
+ super();
+
+ // Remember the static instance.
+ //
+ plugin = this;
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ComparisonItemProviderSpec.java b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ComparisonItemProviderSpec.java
index 9caf4a00e..8e4c1402d 100644
--- a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ComparisonItemProviderSpec.java
+++ b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ComparisonItemProviderSpec.java
@@ -16,7 +16,6 @@ import static com.google.common.collect.Iterables.isEmpty;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import java.util.Collection;
@@ -74,11 +73,8 @@ public class ComparisonItemProviderSpec extends ComparisonItemProvider implement
List
- * To get differences detected on the given EObject or one of its counterpart in left, right or origin, - * you should call the following code: - * - *
- * Match match = getMatch(eObject); - * if (match != null) { - * differences = match.getDifferences(); - * } - *- * - * @param element - * The EObject for which we seek all related differences. - * @model - * @generated - */ - EList
+ * The following features are supported: + *
+ * To get differences detected on the given EObject or one of its counterpart in left, right or origin, + * you should call the following code: + * + *
+ * Match match = getMatch(eObject); + * if (match != null) { + * differences = match.getDifferences(); + * } + *+ * + * @param element + * The EObject for which we seek all related differences. + * @model + * @generated + */ + EList
- * The following features are supported: - *
+ * The following features are supported: + *
+ * If the meaning of the 'Comparison' container reference isn't clear, + * there really should be more of a description here... + *
+ * + * @return the value of the 'Comparison' container reference. + * @see #setComparison(Comparison) + * @see org.eclipse.emf.compare.ComparePackage#getMatchResource_Comparison() + * @see org.eclipse.emf.compare.Comparison#getMatchedResources + * @model opposite="matchedResources" transient="false" + * @generated + */ + Comparison getComparison(); + + /** + * Sets the value of the '{@link org.eclipse.emf.compare.MatchResource#getComparison Comparison}' container reference. + * + * + * @param value the new value of the 'Comparison' container reference. + * @see #getComparison() + * @generated + */ + void setComparison(Comparison value); + +} // MatchResource diff --git a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/ComparePackageImpl.java b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/ComparePackageImpl.java index b0fcbd36e..e8715ef14 100644 --- a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/ComparePackageImpl.java +++ b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/ComparePackageImpl.java @@ -1,1045 +1,987 @@ -/** - * Copyright (c) 2012 Obeo. - * 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: - * Obeo - initial API and implementation - */ -package org.eclipse.emf.compare.impl; - -import org.eclipse.emf.compare.AttributeChange; -import org.eclipse.emf.compare.CompareFactory; -import org.eclipse.emf.compare.ComparePackage; -import org.eclipse.emf.compare.Comparison; -import org.eclipse.emf.compare.Conflict; -import org.eclipse.emf.compare.ConflictKind; -import org.eclipse.emf.compare.Diff; -import org.eclipse.emf.compare.DifferenceKind; -import org.eclipse.emf.compare.DifferenceSource; -import org.eclipse.emf.compare.DifferenceState; -import org.eclipse.emf.compare.Equivalence; -import org.eclipse.emf.compare.Match; -import org.eclipse.emf.compare.MatchResource; -import org.eclipse.emf.compare.ReferenceChange; -import org.eclipse.emf.compare.ResourceAttachmentChange; -import org.eclipse.emf.compare.utils.IEqualityHelper; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EGenericType; -import org.eclipse.emf.ecore.EOperation; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.impl.EPackageImpl; - -/** - * An implementation of the model Package. - * - * @generated - */ -public class ComparePackageImpl extends EPackageImpl implements ComparePackage { - /** - * - * - * @generated - */ - public static final String copyright = "Copyright (c) 2012 Obeo.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Obeo - initial API and implementation"; //$NON-NLS-1$ - - /** - * - * - * @generated - */ - private EClass comparisonEClass = null; - - /** - * - * - * @generated - */ - private EClass matchResourceEClass = null; - - /** - * - * - * @generated - */ - private EClass matchEClass = null; - - /** - * - * - * @generated - */ - private EClass diffEClass = null; - - /** - * - * - * @generated - */ - private EClass resourceAttachmentChangeEClass = null; - - /** - * - * - * @generated - */ - private EClass referenceChangeEClass = null; - - /** - * - * - * @generated - */ - private EClass attributeChangeEClass = null; - - /** - * - * - * @generated - */ - private EClass conflictEClass = null; - - /** - * - * - * @generated - */ - private EClass equivalenceEClass = null; - - /** - * - * - * @generated - */ - private EEnum differenceKindEEnum = null; - - /** - * - * - * @generated - */ - private EEnum differenceSourceEEnum = null; - - /** - * - * - * @generated - */ - private EEnum differenceStateEEnum = null; - - /** - * - * - * @generated - */ - private EEnum conflictKindEEnum = null; - - /** - * - * - * @generated - */ - private EDataType eIterableEDataType = null; - - /** - * - * - * @generated - */ - private EDataType iEqualityHelperEDataType = null; - - /** - * Creates an instance of the model Package, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package package URI value. - *- * 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. - * - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.eclipse.emf.compare.ComparePackage#eNS_URI - * @see #init() - * @generated - */ - private ComparePackageImpl() { - super(eNS_URI, CompareFactory.eINSTANCE); - } - - /** - * - * - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the Package for this model, and for any others upon which it - * depends. - *
- * This method is used to initialize {@link ComparePackage#eINSTANCE} when that field is accessed. Clients - * should not invoke it directly. Instead, they should simply access that field to obtain the package. - * - * - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static ComparePackage init() { - if (isInited) { - return (ComparePackage)EPackage.Registry.INSTANCE.getEPackage(ComparePackage.eNS_URI); - } - - // Obtain or create and register package - ComparePackageImpl theComparePackage = (ComparePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ComparePackageImpl ? EPackage.Registry.INSTANCE - .get(eNS_URI) - : new ComparePackageImpl()); - - isInited = true; - - // Initialize simple dependencies - EcorePackage.eINSTANCE.eClass(); - - // Create package meta-data objects - theComparePackage.createPackageContents(); - - // Initialize created meta-data - theComparePackage.initializePackageContents(); - - // Mark meta-data to indicate it can't be changed - theComparePackage.freeze(); - - // Update the registry and return the package - EPackage.Registry.INSTANCE.put(ComparePackage.eNS_URI, theComparePackage); - return theComparePackage; - } - - /** - * - * - * @generated - */ - public EClass getComparison() { - return comparisonEClass; - } - - /** - * - * - * @generated - */ - public EReference getComparison_MatchedResources() { - return (EReference)comparisonEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EReference getComparison_Matches() { - return (EReference)comparisonEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EReference getComparison_Conflicts() { - return (EReference)comparisonEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - public EReference getComparison_Equivalences() { - return (EReference)comparisonEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - public EAttribute getComparison_ThreeWay() { - return (EAttribute)comparisonEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * @generated - */ - public EClass getMatchResource() { - return matchResourceEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getMatchResource_LeftURI() { - return (EAttribute)matchResourceEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getMatchResource_RightURI() { - return (EAttribute)matchResourceEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EAttribute getMatchResource_OriginURI() { - return (EAttribute)matchResourceEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - public EAttribute getMatchResource_Left() { - return (EAttribute)matchResourceEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - public EAttribute getMatchResource_Right() { - return (EAttribute)matchResourceEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * @generated - */ - public EAttribute getMatchResource_Origin() { - return (EAttribute)matchResourceEClass.getEStructuralFeatures().get(5); - } - - /** - * - * - * @generated - */ - public EClass getMatch() { - return matchEClass; - } - - /** - * - * - * @generated - */ - public EReference getMatch_Submatches() { - return (EReference)matchEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EReference getMatch_Differences() { - return (EReference)matchEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EReference getMatch_Left() { - return (EReference)matchEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - public EReference getMatch_Right() { - return (EReference)matchEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - public EReference getMatch_Origin() { - return (EReference)matchEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * @generated - */ - public EClass getDiff() { - return diffEClass; - } - - /** - * - * - * @generated - */ - public EReference getDiff_Match() { - return (EReference)diffEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EReference getDiff_Requires() { - return (EReference)diffEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EReference getDiff_RequiredBy() { - return (EReference)diffEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - public EReference getDiff_Refines() { - return (EReference)diffEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - public EReference getDiff_RefinedBy() { - return (EReference)diffEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * @generated - */ - public EAttribute getDiff_Kind() { - return (EAttribute)diffEClass.getEStructuralFeatures().get(5); - } - - /** - * - * - * @generated - */ - public EAttribute getDiff_Source() { - return (EAttribute)diffEClass.getEStructuralFeatures().get(6); - } - - /** - * - * - * @generated - */ - public EAttribute getDiff_State() { - return (EAttribute)diffEClass.getEStructuralFeatures().get(7); - } - - /** - * - * - * @generated - */ - public EReference getDiff_Equivalence() { - return (EReference)diffEClass.getEStructuralFeatures().get(8); - } - - /** - * - * - * @generated - */ - public EReference getDiff_Conflict() { - return (EReference)diffEClass.getEStructuralFeatures().get(9); - } - - /** - * - * - * @generated - */ - public EClass getResourceAttachmentChange() { - return resourceAttachmentChangeEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getResourceAttachmentChange_ResourceURI() { - return (EAttribute)resourceAttachmentChangeEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EClass getReferenceChange() { - return referenceChangeEClass; - } - - /** - * - * - * @generated - */ - public EReference getReferenceChange_Reference() { - return (EReference)referenceChangeEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EReference getReferenceChange_Value() { - return (EReference)referenceChangeEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EClass getAttributeChange() { - return attributeChangeEClass; - } - - /** - * - * - * @generated - */ - public EReference getAttributeChange_Attribute() { - return (EReference)attributeChangeEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getAttributeChange_Value() { - return (EAttribute)attributeChangeEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EClass getConflict() { - return conflictEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getConflict_Kind() { - return (EAttribute)conflictEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EReference getConflict_Differences() { - return (EReference)conflictEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EClass getEquivalence() { - return equivalenceEClass; - } - - /** - * - * - * @generated - */ - public EReference getEquivalence_Differences() { - return (EReference)equivalenceEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EEnum getDifferenceKind() { - return differenceKindEEnum; - } - - /** - * - * - * @generated - */ - public EEnum getDifferenceSource() { - return differenceSourceEEnum; - } - - /** - * - * - * @generated - */ - public EEnum getDifferenceState() { - return differenceStateEEnum; - } - - /** - * - * - * @generated - */ - public EEnum getConflictKind() { - return conflictKindEEnum; - } - - /** - * - * - * @generated - */ - public EDataType getEIterable() { - return eIterableEDataType; - } - - /** - * - * - * @generated - */ - public EDataType getIEqualityHelper() { - return iEqualityHelperEDataType; - } - - /** - * - * - * @generated - */ - public CompareFactory getCompareFactory() { - return (CompareFactory)getEFactoryInstance(); - } - - /** - * - * - * @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. - * - * @generated - */ - public void createPackageContents() { - if (isCreated) { - return; - } - isCreated = true; - - // Create classes and their features - comparisonEClass = createEClass(COMPARISON); - createEReference(comparisonEClass, COMPARISON__MATCHED_RESOURCES); - createEReference(comparisonEClass, COMPARISON__MATCHES); - createEReference(comparisonEClass, COMPARISON__CONFLICTS); - createEReference(comparisonEClass, COMPARISON__EQUIVALENCES); - createEAttribute(comparisonEClass, COMPARISON__THREE_WAY); - - matchResourceEClass = createEClass(MATCH_RESOURCE); - createEAttribute(matchResourceEClass, MATCH_RESOURCE__LEFT_URI); - createEAttribute(matchResourceEClass, MATCH_RESOURCE__RIGHT_URI); - createEAttribute(matchResourceEClass, MATCH_RESOURCE__ORIGIN_URI); - createEAttribute(matchResourceEClass, MATCH_RESOURCE__LEFT); - createEAttribute(matchResourceEClass, MATCH_RESOURCE__RIGHT); - createEAttribute(matchResourceEClass, MATCH_RESOURCE__ORIGIN); - - matchEClass = createEClass(MATCH); - createEReference(matchEClass, MATCH__SUBMATCHES); - createEReference(matchEClass, MATCH__DIFFERENCES); - createEReference(matchEClass, MATCH__LEFT); - createEReference(matchEClass, MATCH__RIGHT); - createEReference(matchEClass, MATCH__ORIGIN); - - diffEClass = createEClass(DIFF); - createEReference(diffEClass, DIFF__MATCH); - createEReference(diffEClass, DIFF__REQUIRES); - createEReference(diffEClass, DIFF__REQUIRED_BY); - createEReference(diffEClass, DIFF__REFINES); - createEReference(diffEClass, DIFF__REFINED_BY); - createEAttribute(diffEClass, DIFF__KIND); - createEAttribute(diffEClass, DIFF__SOURCE); - createEAttribute(diffEClass, DIFF__STATE); - createEReference(diffEClass, DIFF__EQUIVALENCE); - createEReference(diffEClass, DIFF__CONFLICT); - - resourceAttachmentChangeEClass = createEClass(RESOURCE_ATTACHMENT_CHANGE); - createEAttribute(resourceAttachmentChangeEClass, RESOURCE_ATTACHMENT_CHANGE__RESOURCE_URI); - - referenceChangeEClass = createEClass(REFERENCE_CHANGE); - createEReference(referenceChangeEClass, REFERENCE_CHANGE__REFERENCE); - createEReference(referenceChangeEClass, REFERENCE_CHANGE__VALUE); - - attributeChangeEClass = createEClass(ATTRIBUTE_CHANGE); - createEReference(attributeChangeEClass, ATTRIBUTE_CHANGE__ATTRIBUTE); - createEAttribute(attributeChangeEClass, ATTRIBUTE_CHANGE__VALUE); - - conflictEClass = createEClass(CONFLICT); - createEAttribute(conflictEClass, CONFLICT__KIND); - createEReference(conflictEClass, CONFLICT__DIFFERENCES); - - equivalenceEClass = createEClass(EQUIVALENCE); - createEReference(equivalenceEClass, EQUIVALENCE__DIFFERENCES); - - // Create enums - differenceKindEEnum = createEEnum(DIFFERENCE_KIND); - differenceSourceEEnum = createEEnum(DIFFERENCE_SOURCE); - differenceStateEEnum = createEEnum(DIFFERENCE_STATE); - conflictKindEEnum = createEEnum(CONFLICT_KIND); - - // Create data types - eIterableEDataType = createEDataType(EITERABLE); - iEqualityHelperEDataType = createEDataType(IEQUALITY_HELPER); - } - - /** - * - * - * @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. - * - * @generated - */ - public void initializePackageContents() { - if (isInitialized) { - return; - } - isInitialized = true; - - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - - // Obtain other dependent packages - EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE - .getEPackage(EcorePackage.eNS_URI); - - // Create type parameters - addETypeParameter(eIterableEDataType, "T"); //$NON-NLS-1$ - - // Set bounds for type parameters - - // Add supertypes to classes - resourceAttachmentChangeEClass.getESuperTypes().add(this.getDiff()); - referenceChangeEClass.getESuperTypes().add(this.getDiff()); - attributeChangeEClass.getESuperTypes().add(this.getDiff()); - - // Initialize classes and features; add operations and parameters - initEClass(comparisonEClass, Comparison.class, - "Comparison", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference( - getComparison_MatchedResources(), - this.getMatchResource(), - null, - "matchedResources", null, 0, -1, Comparison.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEReference( - getComparison_Matches(), - this.getMatch(), - null, - "matches", null, 0, -1, Comparison.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEReference( - getComparison_Conflicts(), - this.getConflict(), - null, - "conflicts", null, 0, -1, Comparison.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEReference( - getComparison_Equivalences(), - this.getEquivalence(), - null, - "equivalences", null, 0, -1, Comparison.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEAttribute( - getComparison_ThreeWay(), - ecorePackage.getEBoolean(), - "threeWay", null, 0, 1, Comparison.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - - addEOperation(comparisonEClass, this.getDiff(), "getDifferences", 0, -1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ - - EOperation op = addEOperation(comparisonEClass, this.getDiff(), - "getDifferences", 0, -1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ - addEParameter(op, theEcorePackage.getEObject(), "element", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ - - op = addEOperation(comparisonEClass, this.getMatch(), "getMatch", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ - addEParameter(op, theEcorePackage.getEObject(), "element", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ - - addEOperation(comparisonEClass, this.getIEqualityHelper(), - "getEqualityHelper", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ - - initEClass(matchResourceEClass, MatchResource.class, - "MatchResource", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEAttribute( - getMatchResource_LeftURI(), - ecorePackage.getEString(), - "leftURI", null, 1, 1, MatchResource.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEAttribute( - getMatchResource_RightURI(), - ecorePackage.getEString(), - "rightURI", null, 1, 1, MatchResource.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEAttribute( - getMatchResource_OriginURI(), - ecorePackage.getEString(), - "originURI", null, 0, 1, MatchResource.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEAttribute( - getMatchResource_Left(), - theEcorePackage.getEResource(), - "left", null, 0, 1, MatchResource.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEAttribute( - getMatchResource_Right(), - theEcorePackage.getEResource(), - "right", null, 0, 1, MatchResource.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEAttribute( - getMatchResource_Origin(), - theEcorePackage.getEResource(), - "origin", null, 0, 1, MatchResource.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - - initEClass(matchEClass, Match.class, - "Match", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference( - getMatch_Submatches(), - this.getMatch(), - null, - "submatches", null, 0, -1, Match.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEReference( - getMatch_Differences(), - this.getDiff(), - this.getDiff_Match(), - "differences", null, 0, -1, Match.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEReference( - getMatch_Left(), - ecorePackage.getEObject(), - null, - "left", null, 0, 1, Match.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEReference( - getMatch_Right(), - ecorePackage.getEObject(), - null, - "right", null, 0, 1, Match.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEReference( - getMatch_Origin(), - ecorePackage.getEObject(), - null, - "origin", null, 0, 1, Match.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - - addEOperation(matchEClass, this.getComparison(), "getComparison", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ - - op = addEOperation(matchEClass, null, "getAllSubmatches", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ - EGenericType g1 = createEGenericType(this.getEIterable()); - EGenericType g2 = createEGenericType(this.getMatch()); - g1.getETypeArguments().add(g2); - initEOperation(op, g1); - - op = addEOperation(matchEClass, null, "getAllDifferences", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ - g1 = createEGenericType(this.getEIterable()); - g2 = createEGenericType(this.getDiff()); - g1.getETypeArguments().add(g2); - initEOperation(op, g1); - - initEClass(diffEClass, Diff.class, "Diff", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference( - getDiff_Match(), - this.getMatch(), - this.getMatch_Differences(), - "match", null, 1, 1, Diff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEReference( - getDiff_Requires(), - this.getDiff(), - this.getDiff_RequiredBy(), - "requires", null, 0, -1, Diff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEReference( - getDiff_RequiredBy(), - this.getDiff(), - this.getDiff_Requires(), - "requiredBy", null, 0, -1, Diff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEReference( - getDiff_Refines(), - this.getDiff(), - this.getDiff_RefinedBy(), - "refines", null, 0, -1, Diff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEReference( - getDiff_RefinedBy(), - this.getDiff(), - this.getDiff_Refines(), - "refinedBy", null, 0, -1, Diff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEAttribute( - getDiff_Kind(), - this.getDifferenceKind(), - "kind", null, 1, 1, Diff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEAttribute( - getDiff_Source(), - this.getDifferenceSource(), - "source", null, 1, 1, Diff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEAttribute( - getDiff_State(), - this.getDifferenceState(), - "state", null, 1, 1, Diff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEReference( - getDiff_Equivalence(), - this.getEquivalence(), - this.getEquivalence_Differences(), - "equivalence", null, 0, 1, Diff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEReference( - getDiff_Conflict(), - this.getConflict(), - this.getConflict_Differences(), - "conflict", null, 0, 1, Diff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - - addEOperation(diffEClass, null, "copyRightToLeft", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ - - addEOperation(diffEClass, null, "copyLeftToRight", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ - - addEOperation(diffEClass, null, "discard", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ - - initEClass(resourceAttachmentChangeEClass, ResourceAttachmentChange.class, - "ResourceAttachmentChange", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEAttribute( - getResourceAttachmentChange_ResourceURI(), - ecorePackage.getEString(), - "resourceURI", null, 1, 1, ResourceAttachmentChange.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - - initEClass(referenceChangeEClass, ReferenceChange.class, - "ReferenceChange", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference( - getReferenceChange_Reference(), - theEcorePackage.getEReference(), - null, - "reference", null, 1, 1, ReferenceChange.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEReference( - getReferenceChange_Value(), - theEcorePackage.getEObject(), - null, - "value", null, 0, 1, ReferenceChange.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - - initEClass(attributeChangeEClass, AttributeChange.class, - "AttributeChange", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference( - getAttributeChange_Attribute(), - theEcorePackage.getEAttribute(), - null, - "attribute", null, 1, 1, AttributeChange.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEAttribute( - getAttributeChange_Value(), - theEcorePackage.getEJavaObject(), - "value", null, 0, 1, AttributeChange.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - - initEClass(conflictEClass, Conflict.class, - "Conflict", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEAttribute( - getConflict_Kind(), - this.getConflictKind(), - "kind", null, 1, 1, Conflict.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - initEReference( - getConflict_Differences(), - this.getDiff(), - this.getDiff_Conflict(), - "differences", null, 2, -1, Conflict.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - - addEOperation(conflictEClass, this.getDiff(), "getLeftDifferences", 1, -1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ - - addEOperation(conflictEClass, this.getDiff(), "getRightDifferences", 1, -1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ - - initEClass(equivalenceEClass, Equivalence.class, - "Equivalence", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference( - getEquivalence_Differences(), - this.getDiff(), - this.getDiff_Equivalence(), - "differences", null, 2, -1, Equivalence.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ - - // Initialize enums and add enum literals - initEEnum(differenceKindEEnum, DifferenceKind.class, "DifferenceKind"); //$NON-NLS-1$ - addEEnumLiteral(differenceKindEEnum, DifferenceKind.ADD); - addEEnumLiteral(differenceKindEEnum, DifferenceKind.DELETE); - addEEnumLiteral(differenceKindEEnum, DifferenceKind.CHANGE); - addEEnumLiteral(differenceKindEEnum, DifferenceKind.MOVE); - - initEEnum(differenceSourceEEnum, DifferenceSource.class, "DifferenceSource"); //$NON-NLS-1$ - addEEnumLiteral(differenceSourceEEnum, DifferenceSource.LEFT); - addEEnumLiteral(differenceSourceEEnum, DifferenceSource.RIGHT); - - initEEnum(differenceStateEEnum, DifferenceState.class, "DifferenceState"); //$NON-NLS-1$ - addEEnumLiteral(differenceStateEEnum, DifferenceState.UNRESOLVED); - addEEnumLiteral(differenceStateEEnum, DifferenceState.MERGED); - addEEnumLiteral(differenceStateEEnum, DifferenceState.DISCARDED); - - initEEnum(conflictKindEEnum, ConflictKind.class, "ConflictKind"); //$NON-NLS-1$ - addEEnumLiteral(conflictKindEEnum, ConflictKind.REAL); - addEEnumLiteral(conflictKindEEnum, ConflictKind.PSEUDO); - - // Initialize data types - initEDataType(eIterableEDataType, Iterable.class, - "EIterable", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEDataType(iEqualityHelperEDataType, IEqualityHelper.class, - "IEqualityHelper", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - - // Create resource - createResource(eNS_URI); - } - -} // ComparePackageImpl +/** + * Copyright (c) 2012 Obeo. + * 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: + * Obeo - initial API and implementation + */ +package org.eclipse.emf.compare.impl; + +import java.lang.Iterable; +import org.eclipse.emf.compare.AttributeChange; +import org.eclipse.emf.compare.CompareFactory; +import org.eclipse.emf.compare.ComparePackage; +import org.eclipse.emf.compare.Comparison; +import org.eclipse.emf.compare.Conflict; +import org.eclipse.emf.compare.ConflictKind; +import org.eclipse.emf.compare.Diff; +import org.eclipse.emf.compare.DifferenceKind; +import org.eclipse.emf.compare.DifferenceSource; +import org.eclipse.emf.compare.DifferenceState; +import org.eclipse.emf.compare.Equivalence; +import org.eclipse.emf.compare.Match; +import org.eclipse.emf.compare.MatchResource; +import org.eclipse.emf.compare.ReferenceChange; +import org.eclipse.emf.compare.ResourceAttachmentChange; +import org.eclipse.emf.compare.utils.IEqualityHelper; +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EGenericType; +import org.eclipse.emf.ecore.EOperation; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EcorePackage; +import org.eclipse.emf.ecore.impl.EPackageImpl; + +/** + * An implementation of the model Package. + * @generated + */ +public class ComparePackageImpl extends EPackageImpl implements ComparePackage { + /** + * + * @generated + */ + public static final String copyright = "Copyright (c) 2012 Obeo.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Obeo - initial API and implementation"; //$NON-NLS-1$ + + /** + * + * @generated + */ + private EClass comparisonEClass = null; + + /** + * + * @generated + */ + private EClass matchResourceEClass = null; + + /** + * + * @generated + */ + private EClass matchEClass = null; + + /** + * + * @generated + */ + private EClass diffEClass = null; + + /** + * + * @generated + */ + private EClass resourceAttachmentChangeEClass = null; + + /** + * + * @generated + */ + private EClass referenceChangeEClass = null; + + /** + * + * @generated + */ + private EClass attributeChangeEClass = null; + + /** + * + * @generated + */ + private EClass conflictEClass = null; + + /** + * + * @generated + */ + private EClass equivalenceEClass = null; + + /** + * + * @generated + */ + private EEnum differenceKindEEnum = null; + + /** + * + * @generated + */ + private EEnum differenceSourceEEnum = null; + + /** + * + * @generated + */ + private EEnum differenceStateEEnum = null; + + /** + * + * @generated + */ + private EEnum conflictKindEEnum = null; + + /** + * + * @generated + */ + private EDataType eIterableEDataType = null; + + /** + * + * @generated + */ + private EDataType iEqualityHelperEDataType = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *
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. + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.emf.compare.ComparePackage#eNS_URI + * @see #init() + * @generated + */ + private ComparePackageImpl() { + super(eNS_URI, CompareFactory.eINSTANCE); + } + + /** + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *
This method is used to initialize {@link ComparePackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static ComparePackage init() { + if (isInited) + return (ComparePackage)EPackage.Registry.INSTANCE.getEPackage(ComparePackage.eNS_URI); + + // Obtain or create and register package + ComparePackageImpl theComparePackage = (ComparePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ComparePackageImpl ? EPackage.Registry.INSTANCE + .get(eNS_URI) + : new ComparePackageImpl()); + + isInited = true; + + // Initialize simple dependencies + EcorePackage.eINSTANCE.eClass(); + + // Create package meta-data objects + theComparePackage.createPackageContents(); + + // Initialize created meta-data + theComparePackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theComparePackage.freeze(); + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(ComparePackage.eNS_URI, theComparePackage); + return theComparePackage; + } + + /** + * + * @generated + */ + public EClass getComparison() { + return comparisonEClass; + } + + /** + * + * @generated + */ + public EReference getComparison_MatchedResources() { + return (EReference)comparisonEClass.getEStructuralFeatures().get(0); + } + + /** + * + * @generated + */ + public EReference getComparison_Matches() { + return (EReference)comparisonEClass.getEStructuralFeatures().get(1); + } + + /** + * + * @generated + */ + public EReference getComparison_Conflicts() { + return (EReference)comparisonEClass.getEStructuralFeatures().get(2); + } + + /** + * + * @generated + */ + public EReference getComparison_Equivalences() { + return (EReference)comparisonEClass.getEStructuralFeatures().get(3); + } + + /** + * + * @generated + */ + public EAttribute getComparison_ThreeWay() { + return (EAttribute)comparisonEClass.getEStructuralFeatures().get(4); + } + + /** + * + * @generated + */ + public EClass getMatchResource() { + return matchResourceEClass; + } + + /** + * + * @generated + */ + public EAttribute getMatchResource_LeftURI() { + return (EAttribute)matchResourceEClass.getEStructuralFeatures().get(0); + } + + /** + * + * @generated + */ + public EAttribute getMatchResource_RightURI() { + return (EAttribute)matchResourceEClass.getEStructuralFeatures().get(1); + } + + /** + * + * @generated + */ + public EAttribute getMatchResource_OriginURI() { + return (EAttribute)matchResourceEClass.getEStructuralFeatures().get(2); + } + + /** + * + * @generated + */ + public EAttribute getMatchResource_Left() { + return (EAttribute)matchResourceEClass.getEStructuralFeatures().get(3); + } + + /** + * + * @generated + */ + public EAttribute getMatchResource_Right() { + return (EAttribute)matchResourceEClass.getEStructuralFeatures().get(4); + } + + /** + * + * @generated + */ + public EAttribute getMatchResource_Origin() { + return (EAttribute)matchResourceEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + public EReference getMatchResource_Comparison() { + return (EReference)matchResourceEClass.getEStructuralFeatures().get(6); + } + + /** + * + * @generated + */ + public EClass getMatch() { + return matchEClass; + } + + /** + * + * @generated + */ + public EReference getMatch_Submatches() { + return (EReference)matchEClass.getEStructuralFeatures().get(0); + } + + /** + * + * @generated + */ + public EReference getMatch_Differences() { + return (EReference)matchEClass.getEStructuralFeatures().get(1); + } + + /** + * + * @generated + */ + public EReference getMatch_Left() { + return (EReference)matchEClass.getEStructuralFeatures().get(2); + } + + /** + * + * @generated + */ + public EReference getMatch_Right() { + return (EReference)matchEClass.getEStructuralFeatures().get(3); + } + + /** + * + * @generated + */ + public EReference getMatch_Origin() { + return (EReference)matchEClass.getEStructuralFeatures().get(4); + } + + /** + * + * @generated + */ + public EClass getDiff() { + return diffEClass; + } + + /** + * + * @generated + */ + public EReference getDiff_Match() { + return (EReference)diffEClass.getEStructuralFeatures().get(0); + } + + /** + * + * @generated + */ + public EReference getDiff_Requires() { + return (EReference)diffEClass.getEStructuralFeatures().get(1); + } + + /** + * + * @generated + */ + public EReference getDiff_RequiredBy() { + return (EReference)diffEClass.getEStructuralFeatures().get(2); + } + + /** + * + * @generated + */ + public EReference getDiff_Refines() { + return (EReference)diffEClass.getEStructuralFeatures().get(3); + } + + /** + * + * @generated + */ + public EReference getDiff_RefinedBy() { + return (EReference)diffEClass.getEStructuralFeatures().get(4); + } + + /** + * + * @generated + */ + public EAttribute getDiff_Kind() { + return (EAttribute)diffEClass.getEStructuralFeatures().get(5); + } + + /** + * + * @generated + */ + public EAttribute getDiff_Source() { + return (EAttribute)diffEClass.getEStructuralFeatures().get(6); + } + + /** + * + * @generated + */ + public EAttribute getDiff_State() { + return (EAttribute)diffEClass.getEStructuralFeatures().get(7); + } + + /** + * + * @generated + */ + public EReference getDiff_Equivalence() { + return (EReference)diffEClass.getEStructuralFeatures().get(8); + } + + /** + * + * @generated + */ + public EReference getDiff_Conflict() { + return (EReference)diffEClass.getEStructuralFeatures().get(9); + } + + /** + * + * @generated + */ + public EClass getResourceAttachmentChange() { + return resourceAttachmentChangeEClass; + } + + /** + * + * @generated + */ + public EAttribute getResourceAttachmentChange_ResourceURI() { + return (EAttribute)resourceAttachmentChangeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * @generated + */ + public EClass getReferenceChange() { + return referenceChangeEClass; + } + + /** + * + * @generated + */ + public EReference getReferenceChange_Reference() { + return (EReference)referenceChangeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * @generated + */ + public EReference getReferenceChange_Value() { + return (EReference)referenceChangeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * @generated + */ + public EClass getAttributeChange() { + return attributeChangeEClass; + } + + /** + * + * @generated + */ + public EReference getAttributeChange_Attribute() { + return (EReference)attributeChangeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * @generated + */ + public EAttribute getAttributeChange_Value() { + return (EAttribute)attributeChangeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * @generated + */ + public EClass getConflict() { + return conflictEClass; + } + + /** + * + * @generated + */ + public EAttribute getConflict_Kind() { + return (EAttribute)conflictEClass.getEStructuralFeatures().get(0); + } + + /** + * + * @generated + */ + public EReference getConflict_Differences() { + return (EReference)conflictEClass.getEStructuralFeatures().get(1); + } + + /** + * + * @generated + */ + public EClass getEquivalence() { + return equivalenceEClass; + } + + /** + * + * @generated + */ + public EReference getEquivalence_Differences() { + return (EReference)equivalenceEClass.getEStructuralFeatures().get(0); + } + + /** + * + * @generated + */ + public EEnum getDifferenceKind() { + return differenceKindEEnum; + } + + /** + * + * @generated + */ + public EEnum getDifferenceSource() { + return differenceSourceEEnum; + } + + /** + * + * @generated + */ + public EEnum getDifferenceState() { + return differenceStateEEnum; + } + + /** + * + * @generated + */ + public EEnum getConflictKind() { + return conflictKindEEnum; + } + + /** + * + * @generated + */ + public EDataType getEIterable() { + return eIterableEDataType; + } + + /** + * + * @generated + */ + public EDataType getIEqualityHelper() { + return iEqualityHelperEDataType; + } + + /** + * + * @generated + */ + public CompareFactory getCompareFactory() { + return (CompareFactory)getEFactoryInstance(); + } + + /** + * + * @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. + * + * @generated + */ + public void createPackageContents() { + if (isCreated) + return; + isCreated = true; + + // Create classes and their features + comparisonEClass = createEClass(COMPARISON); + createEReference(comparisonEClass, COMPARISON__MATCHED_RESOURCES); + createEReference(comparisonEClass, COMPARISON__MATCHES); + createEReference(comparisonEClass, COMPARISON__CONFLICTS); + createEReference(comparisonEClass, COMPARISON__EQUIVALENCES); + createEAttribute(comparisonEClass, COMPARISON__THREE_WAY); + + matchResourceEClass = createEClass(MATCH_RESOURCE); + createEAttribute(matchResourceEClass, MATCH_RESOURCE__LEFT_URI); + createEAttribute(matchResourceEClass, MATCH_RESOURCE__RIGHT_URI); + createEAttribute(matchResourceEClass, MATCH_RESOURCE__ORIGIN_URI); + createEAttribute(matchResourceEClass, MATCH_RESOURCE__LEFT); + createEAttribute(matchResourceEClass, MATCH_RESOURCE__RIGHT); + createEAttribute(matchResourceEClass, MATCH_RESOURCE__ORIGIN); + createEReference(matchResourceEClass, MATCH_RESOURCE__COMPARISON); + + matchEClass = createEClass(MATCH); + createEReference(matchEClass, MATCH__SUBMATCHES); + createEReference(matchEClass, MATCH__DIFFERENCES); + createEReference(matchEClass, MATCH__LEFT); + createEReference(matchEClass, MATCH__RIGHT); + createEReference(matchEClass, MATCH__ORIGIN); + + diffEClass = createEClass(DIFF); + createEReference(diffEClass, DIFF__MATCH); + createEReference(diffEClass, DIFF__REQUIRES); + createEReference(diffEClass, DIFF__REQUIRED_BY); + createEReference(diffEClass, DIFF__REFINES); + createEReference(diffEClass, DIFF__REFINED_BY); + createEAttribute(diffEClass, DIFF__KIND); + createEAttribute(diffEClass, DIFF__SOURCE); + createEAttribute(diffEClass, DIFF__STATE); + createEReference(diffEClass, DIFF__EQUIVALENCE); + createEReference(diffEClass, DIFF__CONFLICT); + + resourceAttachmentChangeEClass = createEClass(RESOURCE_ATTACHMENT_CHANGE); + createEAttribute(resourceAttachmentChangeEClass, RESOURCE_ATTACHMENT_CHANGE__RESOURCE_URI); + + referenceChangeEClass = createEClass(REFERENCE_CHANGE); + createEReference(referenceChangeEClass, REFERENCE_CHANGE__REFERENCE); + createEReference(referenceChangeEClass, REFERENCE_CHANGE__VALUE); + + attributeChangeEClass = createEClass(ATTRIBUTE_CHANGE); + createEReference(attributeChangeEClass, ATTRIBUTE_CHANGE__ATTRIBUTE); + createEAttribute(attributeChangeEClass, ATTRIBUTE_CHANGE__VALUE); + + conflictEClass = createEClass(CONFLICT); + createEAttribute(conflictEClass, CONFLICT__KIND); + createEReference(conflictEClass, CONFLICT__DIFFERENCES); + + equivalenceEClass = createEClass(EQUIVALENCE); + createEReference(equivalenceEClass, EQUIVALENCE__DIFFERENCES); + + // Create enums + differenceKindEEnum = createEEnum(DIFFERENCE_KIND); + differenceSourceEEnum = createEEnum(DIFFERENCE_SOURCE); + differenceStateEEnum = createEEnum(DIFFERENCE_STATE); + conflictKindEEnum = createEEnum(CONFLICT_KIND); + + // Create data types + eIterableEDataType = createEDataType(EITERABLE); + iEqualityHelperEDataType = createEDataType(IEQUALITY_HELPER); + } + + /** + * + * @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. + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) + return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE + .getEPackage(EcorePackage.eNS_URI); + + // Create type parameters + addETypeParameter(eIterableEDataType, "T"); //$NON-NLS-1$ + + // Set bounds for type parameters + + // Add supertypes to classes + resourceAttachmentChangeEClass.getESuperTypes().add(this.getDiff()); + referenceChangeEClass.getESuperTypes().add(this.getDiff()); + attributeChangeEClass.getESuperTypes().add(this.getDiff()); + + // Initialize classes and features; add operations and parameters + initEClass(comparisonEClass, Comparison.class, + "Comparison", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference( + getComparison_MatchedResources(), + this.getMatchResource(), + this.getMatchResource_Comparison(), + "matchedResources", null, 0, -1, Comparison.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEReference( + getComparison_Matches(), + this.getMatch(), + null, + "matches", null, 0, -1, Comparison.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEReference( + getComparison_Conflicts(), + this.getConflict(), + null, + "conflicts", null, 0, -1, Comparison.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEReference( + getComparison_Equivalences(), + this.getEquivalence(), + null, + "equivalences", null, 0, -1, Comparison.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEAttribute( + getComparison_ThreeWay(), + ecorePackage.getEBoolean(), + "threeWay", null, 0, 1, Comparison.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + + addEOperation(comparisonEClass, this.getDiff(), "getDifferences", 0, -1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ + + EOperation op = addEOperation(comparisonEClass, this.getDiff(), + "getDifferences", 0, -1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ + addEParameter(op, theEcorePackage.getEObject(), "element", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ + + op = addEOperation(comparisonEClass, this.getMatch(), "getMatch", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ + addEParameter(op, theEcorePackage.getEObject(), "element", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ + + addEOperation(comparisonEClass, this.getIEqualityHelper(), + "getEqualityHelper", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ + + initEClass(matchResourceEClass, MatchResource.class, + "MatchResource", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEAttribute( + getMatchResource_LeftURI(), + ecorePackage.getEString(), + "leftURI", null, 1, 1, MatchResource.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEAttribute( + getMatchResource_RightURI(), + ecorePackage.getEString(), + "rightURI", null, 1, 1, MatchResource.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEAttribute( + getMatchResource_OriginURI(), + ecorePackage.getEString(), + "originURI", null, 0, 1, MatchResource.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEAttribute( + getMatchResource_Left(), + theEcorePackage.getEResource(), + "left", null, 0, 1, MatchResource.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEAttribute( + getMatchResource_Right(), + theEcorePackage.getEResource(), + "right", null, 0, 1, MatchResource.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEAttribute( + getMatchResource_Origin(), + theEcorePackage.getEResource(), + "origin", null, 0, 1, MatchResource.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEReference( + getMatchResource_Comparison(), + this.getComparison(), + this.getComparison_MatchedResources(), + "comparison", null, 0, 1, MatchResource.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + + initEClass(matchEClass, Match.class, + "Match", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference( + getMatch_Submatches(), + this.getMatch(), + null, + "submatches", null, 0, -1, Match.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEReference( + getMatch_Differences(), + this.getDiff(), + this.getDiff_Match(), + "differences", null, 0, -1, Match.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEReference( + getMatch_Left(), + ecorePackage.getEObject(), + null, + "left", null, 0, 1, Match.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEReference( + getMatch_Right(), + ecorePackage.getEObject(), + null, + "right", null, 0, 1, Match.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEReference( + getMatch_Origin(), + ecorePackage.getEObject(), + null, + "origin", null, 0, 1, Match.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + + addEOperation(matchEClass, this.getComparison(), "getComparison", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ + + op = addEOperation(matchEClass, null, "getAllSubmatches", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ + EGenericType g1 = createEGenericType(this.getEIterable()); + EGenericType g2 = createEGenericType(this.getMatch()); + g1.getETypeArguments().add(g2); + initEOperation(op, g1); + + op = addEOperation(matchEClass, null, "getAllDifferences", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ + g1 = createEGenericType(this.getEIterable()); + g2 = createEGenericType(this.getDiff()); + g1.getETypeArguments().add(g2); + initEOperation(op, g1); + + initEClass(diffEClass, Diff.class, "Diff", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference( + getDiff_Match(), + this.getMatch(), + this.getMatch_Differences(), + "match", null, 1, 1, Diff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEReference( + getDiff_Requires(), + this.getDiff(), + this.getDiff_RequiredBy(), + "requires", null, 0, -1, Diff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEReference( + getDiff_RequiredBy(), + this.getDiff(), + this.getDiff_Requires(), + "requiredBy", null, 0, -1, Diff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEReference( + getDiff_Refines(), + this.getDiff(), + this.getDiff_RefinedBy(), + "refines", null, 0, -1, Diff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEReference( + getDiff_RefinedBy(), + this.getDiff(), + this.getDiff_Refines(), + "refinedBy", null, 0, -1, Diff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEAttribute( + getDiff_Kind(), + this.getDifferenceKind(), + "kind", null, 1, 1, Diff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEAttribute( + getDiff_Source(), + this.getDifferenceSource(), + "source", null, 1, 1, Diff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEAttribute( + getDiff_State(), + this.getDifferenceState(), + "state", null, 1, 1, Diff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEReference( + getDiff_Equivalence(), + this.getEquivalence(), + this.getEquivalence_Differences(), + "equivalence", null, 0, 1, Diff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEReference( + getDiff_Conflict(), + this.getConflict(), + this.getConflict_Differences(), + "conflict", null, 0, 1, Diff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + + addEOperation(diffEClass, null, "copyRightToLeft", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ + + addEOperation(diffEClass, null, "copyLeftToRight", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ + + addEOperation(diffEClass, null, "discard", 0, 1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ + + initEClass(resourceAttachmentChangeEClass, ResourceAttachmentChange.class, + "ResourceAttachmentChange", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEAttribute( + getResourceAttachmentChange_ResourceURI(), + ecorePackage.getEString(), + "resourceURI", null, 1, 1, ResourceAttachmentChange.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + + initEClass(referenceChangeEClass, ReferenceChange.class, + "ReferenceChange", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference( + getReferenceChange_Reference(), + theEcorePackage.getEReference(), + null, + "reference", null, 1, 1, ReferenceChange.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEReference( + getReferenceChange_Value(), + theEcorePackage.getEObject(), + null, + "value", null, 0, 1, ReferenceChange.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + + initEClass(attributeChangeEClass, AttributeChange.class, + "AttributeChange", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference( + getAttributeChange_Attribute(), + theEcorePackage.getEAttribute(), + null, + "attribute", null, 1, 1, AttributeChange.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEAttribute( + getAttributeChange_Value(), + theEcorePackage.getEJavaObject(), + "value", null, 0, 1, AttributeChange.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + + initEClass(conflictEClass, Conflict.class, + "Conflict", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEAttribute( + getConflict_Kind(), + this.getConflictKind(), + "kind", null, 1, 1, Conflict.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEReference( + getConflict_Differences(), + this.getDiff(), + this.getDiff_Conflict(), + "differences", null, 2, -1, Conflict.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + + addEOperation(conflictEClass, this.getDiff(), "getLeftDifferences", 1, -1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ + + addEOperation(conflictEClass, this.getDiff(), "getRightDifferences", 1, -1, IS_UNIQUE, IS_ORDERED); //$NON-NLS-1$ + + initEClass(equivalenceEClass, Equivalence.class, + "Equivalence", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference( + getEquivalence_Differences(), + this.getDiff(), + this.getDiff_Equivalence(), + "differences", null, 2, -1, Equivalence.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + + // Initialize enums and add enum literals + initEEnum(differenceKindEEnum, DifferenceKind.class, "DifferenceKind"); //$NON-NLS-1$ + addEEnumLiteral(differenceKindEEnum, DifferenceKind.ADD); + addEEnumLiteral(differenceKindEEnum, DifferenceKind.DELETE); + addEEnumLiteral(differenceKindEEnum, DifferenceKind.CHANGE); + addEEnumLiteral(differenceKindEEnum, DifferenceKind.MOVE); + + initEEnum(differenceSourceEEnum, DifferenceSource.class, "DifferenceSource"); //$NON-NLS-1$ + addEEnumLiteral(differenceSourceEEnum, DifferenceSource.LEFT); + addEEnumLiteral(differenceSourceEEnum, DifferenceSource.RIGHT); + + initEEnum(differenceStateEEnum, DifferenceState.class, "DifferenceState"); //$NON-NLS-1$ + addEEnumLiteral(differenceStateEEnum, DifferenceState.UNRESOLVED); + addEEnumLiteral(differenceStateEEnum, DifferenceState.MERGED); + addEEnumLiteral(differenceStateEEnum, DifferenceState.DISCARDED); + + initEEnum(conflictKindEEnum, ConflictKind.class, "ConflictKind"); //$NON-NLS-1$ + addEEnumLiteral(conflictKindEEnum, ConflictKind.REAL); + addEEnumLiteral(conflictKindEEnum, ConflictKind.PSEUDO); + + // Initialize data types + initEDataType(eIterableEDataType, Iterable.class, + "EIterable", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEDataType(iEqualityHelperEDataType, IEqualityHelper.class, + "IEqualityHelper", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + + // Create resource + createResource(eNS_URI); + } + +} // ComparePackageImpl diff --git a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/ComparisonImpl.java b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/ComparisonImpl.java index 327bc816a..c9a8783b9 100644 --- a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/ComparisonImpl.java +++ b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/ComparisonImpl.java @@ -1,398 +1,393 @@ -/** - * Copyright (c) 2012 Obeo. - * 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: - * Obeo - initial API and implementation - */ -package org.eclipse.emf.compare.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.compare.ComparePackage; -import org.eclipse.emf.compare.Comparison; -import org.eclipse.emf.compare.Conflict; -import org.eclipse.emf.compare.Diff; -import org.eclipse.emf.compare.Equivalence; -import org.eclipse.emf.compare.Match; -import org.eclipse.emf.compare.MatchResource; -import org.eclipse.emf.compare.utils.IEqualityHelper; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * An implementation of the model object 'Comparison'. - *
- * The following features are implemented: - *
+ * The following features are implemented: + *
- * The following features are implemented: - *
+ * The following features are implemented: + *