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 children = Lists.newArrayList(matches); for (EObject match : matches) { EList differences = ((Match)match).getDifferences(); - Iterable resourcesAttachmentChanges = filter(differences, - ResourceAttachmentChange.class); - if (!isEmpty(resourcesAttachmentChanges)) { + if (!isEmpty(filter(differences, ResourceAttachmentChange.class))) { children.remove(match); - Iterables.addAll(children, resourcesAttachmentChanges); } } diff --git a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/MatchItemProviderSpec.java b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/MatchItemProviderSpec.java index 7fd6d7397..f00268299 100644 --- a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/MatchItemProviderSpec.java +++ b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/MatchItemProviderSpec.java @@ -1,272 +1,274 @@ -/******************************************************************************* - * 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.spec; - -import static com.google.common.base.Predicates.not; -import static com.google.common.base.Predicates.or; -import static com.google.common.collect.Iterables.filter; -import static com.google.common.collect.Iterables.isEmpty; -import static com.google.common.collect.Iterables.transform; - -import com.google.common.base.Function; -import com.google.common.base.Predicate; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Iterables; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.compare.Conflict; -import org.eclipse.emf.compare.ConflictKind; -import org.eclipse.emf.compare.Diff; -import org.eclipse.emf.compare.Match; -import org.eclipse.emf.compare.ReferenceChange; -import org.eclipse.emf.compare.provider.AdapterFactoryUtil; -import org.eclipse.emf.compare.provider.IItemStyledLabelProvider; -import org.eclipse.emf.compare.provider.MatchItemProvider; -import org.eclipse.emf.compare.provider.utils.ComposedStyledString; -import org.eclipse.emf.compare.provider.utils.IStyledString; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; - -/** - * Specialized {@link MatchItemProvider} returning nice output for {@link #getText(Object)} and - * {@link #getImage(Object)}. - * - * @author Mikael Barbero - */ -public class MatchItemProviderSpec extends MatchItemProvider implements IItemStyledLabelProvider { - - private static final Predicate CONTAINMENT_REFERENCE_CHANGE = new Predicate() { - public boolean apply(ReferenceChange input) { - return input.getReference().isContainment(); - } - }; - - private static final Function VALUE = new Function() { - public EObject apply(ReferenceChange input) { - return input.getValue(); - } - }; - - private final OverlayImageProvider overlayProvider; - - /** - * Constructor calling super {@link #MatchItemProvider(AdapterFactory)}. - * - * @param adapterFactory - * the adapter factory - */ - public MatchItemProviderSpec(AdapterFactory adapterFactory) { - super(adapterFactory); - overlayProvider = new OverlayImageProvider(getResourceLocator(), true); - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.emf.compare.provider.MatchItemProvider#getImage(java.lang.Object) - */ - @Override - public Object getImage(Object object) { - Match match = (Match)object; - Object ret = AdapterFactoryUtil.getImage(getRootAdapterFactory(), match.getLeft()); - - if (ret == null) { - ret = AdapterFactoryUtil.getImage(getRootAdapterFactory(), match.getRight()); - } - - if (ret == null) { - ret = AdapterFactoryUtil.getImage(getRootAdapterFactory(), match.getOrigin()); - } - - if (ret == null) { - ret = super.getImage(object); - } - - Object matchImage = overlayProvider.getComposedImage(match, ret); - ret = overlayImage(object, matchImage); - - return ret; - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.emf.compare.provider.MatchItemProvider#getText(java.lang.Object) - */ - @Override - public String getText(Object object) { - Match match = (Match)object; - String ret = AdapterFactoryUtil.getText(getRootAdapterFactory(), match.getLeft()); - - if (ret == null) { - ret = AdapterFactoryUtil.getText(getRootAdapterFactory(), match.getRight()); - } - - if (ret == null) { - ret = AdapterFactoryUtil.getText(getRootAdapterFactory(), match.getOrigin()); - } - - if (ret == null) { - ret = super.getText(object); - } - - return ret; - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren(java.lang.Object) - */ - @Override - public Collection getChildren(Object object) { - Match match = (Match)object; - Iterable filteredChildren = getChildrenIterable(match); - return ImmutableList.copyOf(filteredChildren); - } - - Iterable getChildrenIterable(Match match) { - ImmutableSet containementDifferenceValues = containmentReferencesValues(match); - - @SuppressWarnings("unchecked") - Predicate childrenFilter = not(or(matchOfContainmentDiff(containementDifferenceValues), - matchWithNoChildren(), emptyMatch(), PSEUDO_CONFLICT_DIFF, REFINED_DIFF, - PSEUDO_DELETE_CONFLICT)); - - Iterable filteredChildren = filter(super.getChildren(match), childrenFilter); - return filteredChildren; - } - - private ImmutableSet containmentReferencesValues(Match match) { - EList differences = match.getDifferences(); - Iterable containmentReferenceChanges = filter(filter(differences, - ReferenceChange.class), CONTAINMENT_REFERENCE_CHANGE); - ImmutableSet containementDifferenceValues = ImmutableSet.copyOf(transform( - containmentReferenceChanges, VALUE)); - return containementDifferenceValues; - } - - private static Predicate matchOfContainmentDiff( - final ImmutableSet containementDifferenceValues) { - return new Predicate() { - public boolean apply(Object input) { - boolean ret = false; - if (input instanceof Match) { - Match match = (Match)input; - if (containementDifferenceValues.contains(match.getLeft()) - || containementDifferenceValues.contains(match.getRight()) - || containementDifferenceValues.contains(match.getOrigin())) { - ret = true; - } - } - return ret; - } - }; - } - - private Predicate matchWithNoChildren() { - return new Predicate() { - public boolean apply(Object input) { - boolean ret = false; - if (input instanceof Match) { - Match match = (Match)input; - ret = Iterables.isEmpty(MatchItemProviderSpec.this.getChildrenIterable(match)); - } - return ret; - } - }; - } - - private static Predicate emptyMatch() { - return new Predicate() { - public boolean apply(Object input) { - if (input instanceof Match) { - final Match match = ((Match)input); - return match.getLeft() == null && match.getRight() == null && match.getOrigin() == null; - } - return false; - } - }; - } - - static final Predicate REFINED_DIFF = new Predicate() { - public boolean apply(Object input) { - boolean ret = false; - if (input instanceof Diff) { - Diff diff = (Diff)input; - ret = !diff.getRefines().isEmpty(); - } - return ret; - } - }; - - private static final Predicate PSEUDO_CONFLICT_DIFF = new Predicate() { - public boolean apply(Object input) { - boolean ret = false; - if (input instanceof Diff) { - Diff diff = (Diff)input; - Conflict conflict = diff.getConflict(); - if (conflict != null && conflict.getKind() == ConflictKind.PSEUDO) { - ret = true; - } - } - return ret; - } - }; - - private static final Predicate PSEUDO_DELETE_CONFLICT = new Predicate() { - public boolean apply(Object input) { - boolean ret = false; - if (input instanceof ReferenceChange) { - ReferenceChange referenceChange = (ReferenceChange)input; - Conflict conflict = referenceChange.getConflict(); - if (conflict != null) { - EReference eReference = referenceChange.getReference(); - EObject value = referenceChange.getValue(); - Iterable conflictualReferenceChanges = filter(conflict.getDifferences(), - ReferenceChange.class); - for (ReferenceChange conflictualReferenceChange : conflictualReferenceChanges) { - if (conflictualReferenceChange != referenceChange - && conflictualReferenceChange.getReference() == eReference - && conflictualReferenceChange.getValue() == value) { - ret = true; - } - } - } - } - return ret; - } - }; - - /** - * {@inheritDoc} - * - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#hasChildren(java.lang.Object) - */ - @Override - public boolean hasChildren(Object object) { - Match match = (Match)object; - return !isEmpty(getChildrenIterable(match)); - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.emf.compare.provider.IItemStyledLabelProvider#getStyledText(java.lang.Object) - */ - public IStyledString.IComposedStyledString getStyledText(Object object) { - return new ComposedStyledString(getText(object)); - } -} +/******************************************************************************* + * 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.spec; + +import static com.google.common.base.Predicates.instanceOf; +import static com.google.common.base.Predicates.not; +import static com.google.common.base.Predicates.or; +import static com.google.common.collect.Iterables.filter; +import static com.google.common.collect.Iterables.isEmpty; +import static com.google.common.collect.Iterables.transform; + +import com.google.common.base.Function; +import com.google.common.base.Predicate; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Iterables; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.compare.Conflict; +import org.eclipse.emf.compare.ConflictKind; +import org.eclipse.emf.compare.Diff; +import org.eclipse.emf.compare.Match; +import org.eclipse.emf.compare.ReferenceChange; +import org.eclipse.emf.compare.ResourceAttachmentChange; +import org.eclipse.emf.compare.provider.AdapterFactoryUtil; +import org.eclipse.emf.compare.provider.IItemStyledLabelProvider; +import org.eclipse.emf.compare.provider.MatchItemProvider; +import org.eclipse.emf.compare.provider.utils.ComposedStyledString; +import org.eclipse.emf.compare.provider.utils.IStyledString; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EReference; + +/** + * Specialized {@link MatchItemProvider} returning nice output for {@link #getText(Object)} and + * {@link #getImage(Object)}. + * + * @author Mikael Barbero + */ +public class MatchItemProviderSpec extends MatchItemProvider implements IItemStyledLabelProvider { + + private static final Predicate CONTAINMENT_REFERENCE_CHANGE = new Predicate() { + public boolean apply(ReferenceChange input) { + return input.getReference().isContainment(); + } + }; + + private static final Function VALUE = new Function() { + public EObject apply(ReferenceChange input) { + return input.getValue(); + } + }; + + private final OverlayImageProvider overlayProvider; + + /** + * Constructor calling super {@link #MatchItemProvider(AdapterFactory)}. + * + * @param adapterFactory + * the adapter factory + */ + public MatchItemProviderSpec(AdapterFactory adapterFactory) { + super(adapterFactory); + overlayProvider = new OverlayImageProvider(getResourceLocator(), true); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.compare.provider.MatchItemProvider#getImage(java.lang.Object) + */ + @Override + public Object getImage(Object object) { + Match match = (Match)object; + Object ret = AdapterFactoryUtil.getImage(getRootAdapterFactory(), match.getLeft()); + + if (ret == null) { + ret = AdapterFactoryUtil.getImage(getRootAdapterFactory(), match.getRight()); + } + + if (ret == null) { + ret = AdapterFactoryUtil.getImage(getRootAdapterFactory(), match.getOrigin()); + } + + if (ret == null) { + ret = super.getImage(object); + } + + Object matchImage = overlayProvider.getComposedImage(match, ret); + ret = overlayImage(object, matchImage); + + return ret; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.compare.provider.MatchItemProvider#getText(java.lang.Object) + */ + @Override + public String getText(Object object) { + Match match = (Match)object; + String ret = AdapterFactoryUtil.getText(getRootAdapterFactory(), match.getLeft()); + + if (ret == null) { + ret = AdapterFactoryUtil.getText(getRootAdapterFactory(), match.getRight()); + } + + if (ret == null) { + ret = AdapterFactoryUtil.getText(getRootAdapterFactory(), match.getOrigin()); + } + + if (ret == null) { + ret = super.getText(object); + } + + return ret; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren(java.lang.Object) + */ + @Override + public Collection getChildren(Object object) { + Match match = (Match)object; + Iterable filteredChildren = getChildrenIterable(match); + return ImmutableList.copyOf(filteredChildren); + } + + Iterable getChildrenIterable(Match match) { + ImmutableSet containementDifferenceValues = containmentReferencesValues(match); + + @SuppressWarnings("unchecked") + Predicate childrenFilter = not(or(matchOfContainmentDiff(containementDifferenceValues), + matchWithNoChildren(), emptyMatch(), PSEUDO_CONFLICT_DIFF, REFINED_DIFF, + PSEUDO_DELETE_CONFLICT, instanceOf(ResourceAttachmentChange.class))); + + Iterable filteredChildren = filter(super.getChildren(match), childrenFilter); + return filteredChildren; + } + + private ImmutableSet containmentReferencesValues(Match match) { + EList differences = match.getDifferences(); + Iterable containmentReferenceChanges = filter(filter(differences, + ReferenceChange.class), CONTAINMENT_REFERENCE_CHANGE); + ImmutableSet containementDifferenceValues = ImmutableSet.copyOf(transform( + containmentReferenceChanges, VALUE)); + return containementDifferenceValues; + } + + private static Predicate matchOfContainmentDiff( + final ImmutableSet containementDifferenceValues) { + return new Predicate() { + public boolean apply(Object input) { + boolean ret = false; + if (input instanceof Match) { + Match match = (Match)input; + if (containementDifferenceValues.contains(match.getLeft()) + || containementDifferenceValues.contains(match.getRight()) + || containementDifferenceValues.contains(match.getOrigin())) { + ret = true; + } + } + return ret; + } + }; + } + + private Predicate matchWithNoChildren() { + return new Predicate() { + public boolean apply(Object input) { + boolean ret = false; + if (input instanceof Match) { + Match match = (Match)input; + ret = Iterables.isEmpty(MatchItemProviderSpec.this.getChildrenIterable(match)); + } + return ret; + } + }; + } + + private static Predicate emptyMatch() { + return new Predicate() { + public boolean apply(Object input) { + if (input instanceof Match) { + final Match match = ((Match)input); + return match.getLeft() == null && match.getRight() == null && match.getOrigin() == null; + } + return false; + } + }; + } + + static final Predicate REFINED_DIFF = new Predicate() { + public boolean apply(Object input) { + boolean ret = false; + if (input instanceof Diff) { + Diff diff = (Diff)input; + ret = !diff.getRefines().isEmpty(); + } + return ret; + } + }; + + private static final Predicate PSEUDO_CONFLICT_DIFF = new Predicate() { + public boolean apply(Object input) { + boolean ret = false; + if (input instanceof Diff) { + Diff diff = (Diff)input; + Conflict conflict = diff.getConflict(); + if (conflict != null && conflict.getKind() == ConflictKind.PSEUDO) { + ret = true; + } + } + return ret; + } + }; + + private static final Predicate PSEUDO_DELETE_CONFLICT = new Predicate() { + public boolean apply(Object input) { + boolean ret = false; + if (input instanceof ReferenceChange) { + ReferenceChange referenceChange = (ReferenceChange)input; + Conflict conflict = referenceChange.getConflict(); + if (conflict != null) { + EReference eReference = referenceChange.getReference(); + EObject value = referenceChange.getValue(); + Iterable conflictualReferenceChanges = filter(conflict.getDifferences(), + ReferenceChange.class); + for (ReferenceChange conflictualReferenceChange : conflictualReferenceChanges) { + if (conflictualReferenceChange != referenceChange + && conflictualReferenceChange.getReference() == eReference + && conflictualReferenceChange.getValue() == value) { + ret = true; + } + } + } + } + return ret; + } + }; + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#hasChildren(java.lang.Object) + */ + @Override + public boolean hasChildren(Object object) { + Match match = (Match)object; + return !isEmpty(getChildrenIterable(match)); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.compare.provider.IItemStyledLabelProvider#getStyledText(java.lang.Object) + */ + public IStyledString.IComposedStyledString getStyledText(Object object) { + return new ComposedStyledString(getText(object)); + } +} diff --git a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/MatchResourceItemProviderSpec.java b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/MatchResourceItemProviderSpec.java index 828c03484..90c5fbc15 100644 --- a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/MatchResourceItemProviderSpec.java +++ b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/MatchResourceItemProviderSpec.java @@ -1,144 +1,168 @@ -/******************************************************************************* - * 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.spec; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.compare.Comparison; -import org.eclipse.emf.compare.MatchResource; -import org.eclipse.emf.compare.provider.IItemStyledLabelProvider; -import org.eclipse.emf.compare.provider.MatchResourceItemProvider; -import org.eclipse.emf.compare.provider.utils.ComposedStyledString; -import org.eclipse.emf.compare.provider.utils.IStyledString; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.edit.provider.IItemLabelProvider; - -/** - * Specialized {@link MatchResourceItemProvider} returning nice output for {@link #getText(Object)} and - * {@link #getImage(Object)}. - * - * @author Mikael Barbero - */ -public class MatchResourceItemProviderSpec extends MatchResourceItemProvider implements IItemStyledLabelProvider { - - /** - * Constructor calling super {@link #MatchResourceItemProviderSpec(AdapterFactory)}. - * - * @param adapterFactory - * the adapter factory - */ - public MatchResourceItemProviderSpec(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.emf.compare.provider.MatchResourceItemProvider#getText(java.lang.Object) - */ - @Override - public String getText(Object object) { - final MatchResource matchResource = (MatchResource)object; - final String leftURI = matchResource.getLeftURI(); - final String rightURI = matchResource.getRightURI(); - - final String commonBase = getCommonBase(leftURI, rightURI); - - String text = ""; //$NON-NLS-1$ - if (leftURI != null) { - text += leftURI.substring(commonBase.length()); - } - text += " <-> "; //$NON-NLS-1$ - if (rightURI != null) { - text += rightURI.substring(commonBase.length()); - } - if (matchResource.eContainer() instanceof Comparison - && ((Comparison)matchResource.eContainer()).isThreeWay()) { - final String originURI = matchResource.getOriginURI(); - text += " (" + originURI.substring(commonBase.length()) + ")"; //$NON-NLS-1$ //$NON-NLS-2$ - } - return text; - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.emf.compare.provider.MatchResourceItemProvider#getImage(java.lang.Object) - */ - @Override - public Object getImage(Object object) { - final MatchResource matchResource = (MatchResource)object; - Resource resource = matchResource.getLeft(); - if (resource == null) { - resource = matchResource.getRight(); - if (resource == null) { - resource = matchResource.getOrigin(); - } - } - - if (resource != null) { - IItemLabelProvider itemLabelProvider = (IItemLabelProvider)getRootAdapterFactory().adapt( - resource, IItemLabelProvider.class); - - Object image = itemLabelProvider.getImage(resource); - if (image != null) { - return image; - } else { - return super.getImage(object); - } - } else { - return super.getImage(object); - } - } - - /** - * Returns the longest common starting substring of the two given strings. - * - * @param left - * First of the two strings for which we need the common starting substring. - * @param right - * Second of the two strings for which we need the common starting substring. - * @return The longest common starting substring of the two given strings. - */ - public String getCommonBase(String left, String right) { - if (left == null || right == null) { - return ""; //$NON-NLS-1$ - } - - final char[] leftChars = left.toCharArray(); - final char[] rightChars = right.toCharArray(); - - final StringBuilder buffer = new StringBuilder(); - StringBuilder fragmentBuffer = new StringBuilder(); - for (int i = 0; i < Math.min(leftChars.length, rightChars.length); i++) { - if (leftChars[i] == rightChars[i]) { - fragmentBuffer.append(leftChars[i]); - - if (leftChars[i] == '\\' || leftChars[i] == '/') { - buffer.append(fragmentBuffer); - fragmentBuffer = new StringBuilder(); - } - } else { - break; - } - } - - return buffer.toString(); - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.emf.compare.provider.IItemStyledLabelProvider#getStyledText(java.lang.Object) - */ - public IStyledString.IComposedStyledString getStyledText(Object object) { - return new ComposedStyledString(getText(object)); - } -} +/******************************************************************************* + * 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.spec; + +import static com.google.common.collect.Iterables.filter; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.compare.Comparison; +import org.eclipse.emf.compare.MatchResource; +import org.eclipse.emf.compare.ResourceAttachmentChange; +import org.eclipse.emf.compare.provider.IItemStyledLabelProvider; +import org.eclipse.emf.compare.provider.MatchResourceItemProvider; +import org.eclipse.emf.compare.provider.utils.ComposedStyledString; +import org.eclipse.emf.compare.provider.utils.IStyledString; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.edit.provider.IItemLabelProvider; + +/** + * Specialized {@link MatchResourceItemProvider} returning nice output for {@link #getText(Object)} and + * {@link #getImage(Object)}. + * + * @author Mikael Barbero + */ +public class MatchResourceItemProviderSpec extends MatchResourceItemProvider implements IItemStyledLabelProvider { + + /** + * Constructor calling super {@link #MatchResourceItemProviderSpec(AdapterFactory)}. + * + * @param adapterFactory + * the adapter factory + */ + public MatchResourceItemProviderSpec(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + @Override + public Collection getChildren(Object object) { + Collection children = new ArrayList(); + MatchResource matchResource = (MatchResource)object; + Comparison comparison = matchResource.getComparison(); + for (ResourceAttachmentChange rac : filter(comparison.getDifferences(), + ResourceAttachmentChange.class)) { + final String diffResourceURI = rac.getResourceURI(); + if (diffResourceURI != null + && (diffResourceURI.equals(matchResource.getLeftURI()) + || diffResourceURI.equals(matchResource.getRightURI()) || diffResourceURI + .equals(matchResource.getOriginURI()))) { + children.add(rac); + } + } + return children; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.compare.provider.MatchResourceItemProvider#getText(java.lang.Object) + */ + @Override + public String getText(Object object) { + final MatchResource matchResource = (MatchResource)object; + final String leftURI = matchResource.getLeftURI(); + final String rightURI = matchResource.getRightURI(); + + final String commonBase = getCommonBase(leftURI, rightURI); + + String text = ""; //$NON-NLS-1$ + if (leftURI != null) { + text += leftURI.substring(commonBase.length()); + } + text += " <-> "; //$NON-NLS-1$ + if (rightURI != null) { + text += rightURI.substring(commonBase.length()); + } + if (matchResource.eContainer() instanceof Comparison + && ((Comparison)matchResource.eContainer()).isThreeWay()) { + final String originURI = matchResource.getOriginURI(); + text += " (" + originURI.substring(commonBase.length()) + ")"; //$NON-NLS-1$ //$NON-NLS-2$ + } + return text; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.compare.provider.MatchResourceItemProvider#getImage(java.lang.Object) + */ + @Override + public Object getImage(Object object) { + final MatchResource matchResource = (MatchResource)object; + Resource resource = matchResource.getLeft(); + if (resource == null) { + resource = matchResource.getRight(); + if (resource == null) { + resource = matchResource.getOrigin(); + } + } + + if (resource != null) { + IItemLabelProvider itemLabelProvider = (IItemLabelProvider)getRootAdapterFactory().adapt( + resource, IItemLabelProvider.class); + + Object image = itemLabelProvider.getImage(resource); + if (image != null) { + return image; + } else { + return super.getImage(object); + } + } else { + return super.getImage(object); + } + } + + /** + * Returns the longest common starting substring of the two given strings. + * + * @param left + * First of the two strings for which we need the common starting substring. + * @param right + * Second of the two strings for which we need the common starting substring. + * @return The longest common starting substring of the two given strings. + */ + public String getCommonBase(String left, String right) { + if (left == null || right == null) { + return ""; //$NON-NLS-1$ + } + + final char[] leftChars = left.toCharArray(); + final char[] rightChars = right.toCharArray(); + + final StringBuilder buffer = new StringBuilder(); + StringBuilder fragmentBuffer = new StringBuilder(); + for (int i = 0; i < Math.min(leftChars.length, rightChars.length); i++) { + if (leftChars[i] == rightChars[i]) { + fragmentBuffer.append(leftChars[i]); + + if (leftChars[i] == '\\' || leftChars[i] == '/') { + buffer.append(fragmentBuffer); + fragmentBuffer = new StringBuilder(); + } + } else { + break; + } + } + + return buffer.toString(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.compare.provider.IItemStyledLabelProvider#getStyledText(java.lang.Object) + */ + public IStyledString.IComposedStyledString getStyledText(Object object) { + return new ComposedStyledString(getText(object)); + } +} diff --git a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ReferenceChangeItemProviderSpec.java b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ReferenceChangeItemProviderSpec.java index f97dbec9c..f20e11fee 100644 --- a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ReferenceChangeItemProviderSpec.java +++ b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ReferenceChangeItemProviderSpec.java @@ -1,263 +1,266 @@ -/******************************************************************************* - * 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.spec; - -import static com.google.common.base.Predicates.not; -import static com.google.common.collect.Iterables.filter; -import static com.google.common.collect.Lists.newArrayList; - -import com.google.common.base.Strings; -import com.google.common.collect.ImmutableCollection; -import com.google.common.collect.ImmutableList; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.compare.Diff; -import org.eclipse.emf.compare.DifferenceKind; -import org.eclipse.emf.compare.DifferenceSource; -import org.eclipse.emf.compare.Match; -import org.eclipse.emf.compare.ReferenceChange; -import org.eclipse.emf.compare.provider.AdapterFactoryUtil; -import org.eclipse.emf.compare.provider.IItemStyledLabelProvider; -import org.eclipse.emf.compare.provider.ReferenceChangeItemProvider; -import org.eclipse.emf.compare.provider.utils.ComposedStyledString; -import org.eclipse.emf.compare.provider.utils.IStyledString; -import org.eclipse.emf.compare.provider.utils.IStyledString.Style; -import org.eclipse.emf.compare.utils.ReferenceUtil; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; - -/** - * Specialized {@link ReferenceChangeItemProvider} returning nice output for {@link #getText(Object)} and - * {@link #getImage(Object)}. - * - * @author Mikael Barbero - */ -public class ReferenceChangeItemProviderSpec extends ReferenceChangeItemProvider implements IItemStyledLabelProvider { - - private final OverlayImageProvider overlayProvider; - - /** - * Constructor calling super {@link #ReferenceChangeItemProvider(AdapterFactory)}. - * - * @param adapterFactory - * the adapter factory - */ - public ReferenceChangeItemProviderSpec(AdapterFactory adapterFactory) { - super(adapterFactory); - overlayProvider = new OverlayImageProvider(getResourceLocator(), true); - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.emf.compare.provider.ReferenceChangeItemProvider#getText(java.lang.Object) - */ - @Override - public String getText(Object object) { - return getStyledText(object).getString(); - } - - static String changeText(final Diff diff, EStructuralFeature feature) { - DifferenceSource source = diff.getSource(); - Match matchOfInterrest = diff.getMatch(); - final EObject sourceSide; - final EObject otherSide; - if (source == DifferenceSource.LEFT) { - sourceSide = matchOfInterrest.getLeft(); - otherSide = matchOfInterrest.getRight(); - } else { // source == DifferenceSource.RIGHT - sourceSide = matchOfInterrest.getRight(); - otherSide = matchOfInterrest.getLeft(); - } - String changeText = changeText(feature, sourceSide, otherSide); - return changeText; - } - - private static String changeText(final EStructuralFeature eStructuralFeature, EObject sourceSide, - EObject otherSide) { - String changeText; - if (sourceSide != null) { - Object leftValue = ReferenceUtil.safeEGet(sourceSide, eStructuralFeature); - if (leftValue == null || isStringAndNullOrEmpty(leftValue)) { - changeText = "unset"; //$NON-NLS-1$ - } else if (otherSide != null) { - Object otherValue = ReferenceUtil.safeEGet(otherSide, eStructuralFeature); - if (otherValue == null || isStringAndNullOrEmpty(otherValue)) { - changeText = "set"; //$NON-NLS-1$ - } else { - changeText = "changed"; //$NON-NLS-1$ - } - } else { - changeText = "set"; //$NON-NLS-1$ - } - } else { - changeText = "unset"; //$NON-NLS-1$ - } - return changeText; - } - - private static boolean isStringAndNullOrEmpty(Object s) { - if (s instanceof String) { - return Strings.isNullOrEmpty((String)s); - } else { - return false; - } - } - - protected String getReferenceText(final ReferenceChange refChange) { - return refChange.getReference().getName(); - } - - protected String getValueText(final ReferenceChange refChange) { - String value = AdapterFactoryUtil.getText(getRootAdapterFactory(), refChange.getValue()); - if (value == null) { - value = ""; //$NON-NLS-1$ - } else { - value = org.eclipse.emf.compare.provider.spec.Strings.elide(value, 50, "..."); //$NON-NLS-1$ - } - return value; - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.emf.compare.provider.ReferenceChangeItemProvider#getImage(java.lang.Object) - */ - @Override - public Object getImage(Object object) { - ReferenceChange refChange = (ReferenceChange)object; - - Object refChangeValueImage = AdapterFactoryUtil.getImage(getRootAdapterFactory(), refChange - .getValue()); - - Object diffImage = overlayProvider.getComposedImage(refChange, refChangeValueImage); - Object ret = overlayImage(object, diffImage); - - return ret; - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren(java.lang.Object) - */ - @Override - public Collection getChildren(Object object) { - Collection superChildren = super.getChildren(object); - List ret = newArrayList(superChildren); - - ReferenceChange referenceChange = (ReferenceChange)object; - EReference reference = referenceChange.getReference(); - - if (reference.isContainment()) { - Match matchOfValue = referenceChange.getMatch().getComparison().getMatch( - referenceChange.getValue()); - if (matchOfValue != null) { - Collection children = getChildren(matchOfValue); - children.remove(referenceChange); - ret.addAll(children); - } - } - - return ImmutableList.copyOf(filter(ret, not(MatchItemProviderSpec.REFINED_DIFF))); - - } - - private Collection getChildren(Match matchOfValue) { - final Collection children; - ITreeItemContentProvider matchItemContentProvider = (ITreeItemContentProvider)adapterFactory.adapt( - matchOfValue, ITreeItemContentProvider.class); - if (matchItemContentProvider != null) { - Collection itemProviderChildren = matchItemContentProvider.getChildren(matchOfValue); - if (itemProviderChildren instanceof ImmutableCollection) { - children = newArrayList(itemProviderChildren); - } else { - children = itemProviderChildren; - } - - Iterator childrenIterator = children.iterator(); - while (childrenIterator.hasNext()) { - Object child = childrenIterator.next(); - if (child instanceof Match) { - if (!matchItemContentProvider.hasChildren(child)) { - childrenIterator.remove(); - } - } - - } - } else { - children = ImmutableList.of(); - } - return children; - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getForeground(java.lang.Object) - */ - @Override - public Object getForeground(Object object) { - ReferenceChange referenceChange = (ReferenceChange)object; - switch (referenceChange.getState()) { - case MERGED: - case DISCARDED: - return URI.createURI("color://rgb/156/156/156"); //$NON-NLS-1$ - default: - return super.getForeground(object); - } - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.emf.compare.provider.IItemStyledLabelProvider#getStyledText(java.lang.Object) - */ - public IStyledString.IComposedStyledString getStyledText(Object object) { - final ReferenceChange refChange = (ReferenceChange)object; - - final String valueText = getValueText(refChange); - - final String referenceText = getReferenceText(refChange); - - ComposedStyledString ret = new ComposedStyledString(valueText); - ret.append(" [" + referenceText, Style.DECORATIONS_STYLER); //$NON-NLS-1$ - - switch (refChange.getKind()) { - case ADD: - ret.append(" add", Style.DECORATIONS_STYLER); //$NON-NLS-1$ - break; - case DELETE: - ret.append(" delete", Style.DECORATIONS_STYLER); //$NON-NLS-1$ - break; - case CHANGE: - ret.append(" " + changeText(refChange, refChange.getReference()), //$NON-NLS-1$ - Style.DECORATIONS_STYLER); - break; - case MOVE: - ret.append(" move", Style.DECORATIONS_STYLER); //$NON-NLS-1$ - break; - default: - throw new IllegalStateException("Unsupported " + DifferenceKind.class.getSimpleName() //$NON-NLS-1$ - + " value: " + refChange.getKind()); //$NON-NLS-1$ - } - ret.append("]", Style.DECORATIONS_STYLER); //$NON-NLS-1$ - - return ret; - } -} +/******************************************************************************* + * Copyright (c) 2012, 2013 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.spec; + +import static com.google.common.base.Predicates.instanceOf; +import static com.google.common.base.Predicates.not; +import static com.google.common.collect.Iterables.filter; +import static com.google.common.collect.Lists.newArrayList; + +import com.google.common.base.Strings; +import com.google.common.collect.ImmutableCollection; +import com.google.common.collect.ImmutableList; + +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.compare.Diff; +import org.eclipse.emf.compare.DifferenceKind; +import org.eclipse.emf.compare.DifferenceSource; +import org.eclipse.emf.compare.Match; +import org.eclipse.emf.compare.ReferenceChange; +import org.eclipse.emf.compare.ResourceAttachmentChange; +import org.eclipse.emf.compare.provider.AdapterFactoryUtil; +import org.eclipse.emf.compare.provider.IItemStyledLabelProvider; +import org.eclipse.emf.compare.provider.ReferenceChangeItemProvider; +import org.eclipse.emf.compare.provider.utils.ComposedStyledString; +import org.eclipse.emf.compare.provider.utils.IStyledString; +import org.eclipse.emf.compare.provider.utils.IStyledString.Style; +import org.eclipse.emf.compare.utils.ReferenceUtil; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; + +/** + * Specialized {@link ReferenceChangeItemProvider} returning nice output for {@link #getText(Object)} and + * {@link #getImage(Object)}. + * + * @author Mikael Barbero + */ +public class ReferenceChangeItemProviderSpec extends ReferenceChangeItemProvider implements IItemStyledLabelProvider { + + private final OverlayImageProvider overlayProvider; + + /** + * Constructor calling super {@link #ReferenceChangeItemProvider(AdapterFactory)}. + * + * @param adapterFactory + * the adapter factory + */ + public ReferenceChangeItemProviderSpec(AdapterFactory adapterFactory) { + super(adapterFactory); + overlayProvider = new OverlayImageProvider(getResourceLocator(), true); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.compare.provider.ReferenceChangeItemProvider#getText(java.lang.Object) + */ + @Override + public String getText(Object object) { + return getStyledText(object).getString(); + } + + static String changeText(final Diff diff, EStructuralFeature feature) { + DifferenceSource source = diff.getSource(); + Match matchOfInterrest = diff.getMatch(); + final EObject sourceSide; + final EObject otherSide; + if (source == DifferenceSource.LEFT) { + sourceSide = matchOfInterrest.getLeft(); + otherSide = matchOfInterrest.getRight(); + } else { // source == DifferenceSource.RIGHT + sourceSide = matchOfInterrest.getRight(); + otherSide = matchOfInterrest.getLeft(); + } + String changeText = changeText(feature, sourceSide, otherSide); + return changeText; + } + + private static String changeText(final EStructuralFeature eStructuralFeature, EObject sourceSide, + EObject otherSide) { + String changeText; + if (sourceSide != null) { + Object leftValue = ReferenceUtil.safeEGet(sourceSide, eStructuralFeature); + if (leftValue == null || isStringAndNullOrEmpty(leftValue)) { + changeText = "unset"; //$NON-NLS-1$ + } else if (otherSide != null) { + Object otherValue = ReferenceUtil.safeEGet(otherSide, eStructuralFeature); + if (otherValue == null || isStringAndNullOrEmpty(otherValue)) { + changeText = "set"; //$NON-NLS-1$ + } else { + changeText = "changed"; //$NON-NLS-1$ + } + } else { + changeText = "set"; //$NON-NLS-1$ + } + } else { + changeText = "unset"; //$NON-NLS-1$ + } + return changeText; + } + + private static boolean isStringAndNullOrEmpty(Object s) { + if (s instanceof String) { + return Strings.isNullOrEmpty((String)s); + } else { + return false; + } + } + + protected String getReferenceText(final ReferenceChange refChange) { + return refChange.getReference().getName(); + } + + protected String getValueText(final ReferenceChange refChange) { + String value = AdapterFactoryUtil.getText(getRootAdapterFactory(), refChange.getValue()); + if (value == null) { + value = ""; //$NON-NLS-1$ + } else { + value = org.eclipse.emf.compare.provider.spec.Strings.elide(value, 50, "..."); //$NON-NLS-1$ + } + return value; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.compare.provider.ReferenceChangeItemProvider#getImage(java.lang.Object) + */ + @Override + public Object getImage(Object object) { + ReferenceChange refChange = (ReferenceChange)object; + + Object refChangeValueImage = AdapterFactoryUtil.getImage(getRootAdapterFactory(), refChange + .getValue()); + + Object diffImage = overlayProvider.getComposedImage(refChange, refChangeValueImage); + Object ret = overlayImage(object, diffImage); + + return ret; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren(java.lang.Object) + */ + @Override + public Collection getChildren(Object object) { + Collection superChildren = super.getChildren(object); + List ret = newArrayList(superChildren); + + ReferenceChange referenceChange = (ReferenceChange)object; + EReference reference = referenceChange.getReference(); + + if (reference.isContainment()) { + Match matchOfValue = referenceChange.getMatch().getComparison().getMatch( + referenceChange.getValue()); + if (matchOfValue != null) { + Collection children = getChildren(matchOfValue); + children.remove(referenceChange); + ret.addAll(children); + } + } + + return ImmutableList.copyOf(filter(filter(ret, not(instanceOf(ResourceAttachmentChange.class))), + not(MatchItemProviderSpec.REFINED_DIFF))); + + } + + private Collection getChildren(Match matchOfValue) { + final Collection children; + ITreeItemContentProvider matchItemContentProvider = (ITreeItemContentProvider)adapterFactory.adapt( + matchOfValue, ITreeItemContentProvider.class); + if (matchItemContentProvider != null) { + Collection itemProviderChildren = matchItemContentProvider.getChildren(matchOfValue); + if (itemProviderChildren instanceof ImmutableCollection) { + children = newArrayList(itemProviderChildren); + } else { + children = itemProviderChildren; + } + + Iterator childrenIterator = children.iterator(); + while (childrenIterator.hasNext()) { + Object child = childrenIterator.next(); + if (child instanceof Match) { + if (!matchItemContentProvider.hasChildren(child)) { + childrenIterator.remove(); + } + } + + } + } else { + children = ImmutableList.of(); + } + return children; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getForeground(java.lang.Object) + */ + @Override + public Object getForeground(Object object) { + ReferenceChange referenceChange = (ReferenceChange)object; + switch (referenceChange.getState()) { + case MERGED: + case DISCARDED: + return URI.createURI("color://rgb/156/156/156"); //$NON-NLS-1$ + default: + return super.getForeground(object); + } + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.compare.provider.IItemStyledLabelProvider#getStyledText(java.lang.Object) + */ + public IStyledString.IComposedStyledString getStyledText(Object object) { + final ReferenceChange refChange = (ReferenceChange)object; + + final String valueText = getValueText(refChange); + + final String referenceText = getReferenceText(refChange); + + ComposedStyledString ret = new ComposedStyledString(valueText); + ret.append(" [" + referenceText, Style.DECORATIONS_STYLER); //$NON-NLS-1$ + + switch (refChange.getKind()) { + case ADD: + ret.append(" add", Style.DECORATIONS_STYLER); //$NON-NLS-1$ + break; + case DELETE: + ret.append(" delete", Style.DECORATIONS_STYLER); //$NON-NLS-1$ + break; + case CHANGE: + ret.append(" " + changeText(refChange, refChange.getReference()), //$NON-NLS-1$ + Style.DECORATIONS_STYLER); + break; + case MOVE: + ret.append(" move", Style.DECORATIONS_STYLER); //$NON-NLS-1$ + break; + default: + throw new IllegalStateException("Unsupported " + DifferenceKind.class.getSimpleName() //$NON-NLS-1$ + + " value: " + refChange.getKind()); //$NON-NLS-1$ + } + ret.append("]", Style.DECORATIONS_STYLER); //$NON-NLS-1$ + + return ret; + } +} diff --git a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ResourceAttachmentChangeItemProviderSpec.java b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ResourceAttachmentChangeItemProviderSpec.java index adc955c8d..bf3656a9e 100644 --- a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ResourceAttachmentChangeItemProviderSpec.java +++ b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ResourceAttachmentChangeItemProviderSpec.java @@ -138,7 +138,7 @@ public class ResourceAttachmentChangeItemProviderSpec extends ResourceAttachment ret = super.getImage(object); } - Object matchImage = overlayProvider.getComposedImage(match, ret); + Object matchImage = overlayProvider.getComposedImage((ResourceAttachmentChange)object, ret); ret = overlayImage(object, matchImage); return ret; diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/plugin.xml b/plugins/org.eclipse.emf.compare.rcp.ui/plugin.xml index bb20670c6..b76137a6a 100644 --- a/plugins/org.eclipse.emf.compare.rcp.ui/plugin.xml +++ b/plugins/org.eclipse.emf.compare.rcp.ui/plugin.xml @@ -57,8 +57,8 @@ + class="org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.EmptyMatchedResourcesFilter" + label="Empty Resource Mappings"> diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/accessor/BasicResourceContentsAccessorImpl.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/accessor/BasicResourceContentsAccessorImpl.java index 1201c2d5d..62c601db4 100644 --- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/accessor/BasicResourceContentsAccessorImpl.java +++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/accessor/BasicResourceContentsAccessorImpl.java @@ -26,9 +26,9 @@ import com.google.common.collect.Iterables; import java.util.Collection; import java.util.Collections; -import java.util.Iterator; import java.util.List; +import org.eclipse.emf.common.util.URI; import org.eclipse.emf.compare.Comparison; import org.eclipse.emf.compare.ConflictKind; import org.eclipse.emf.compare.Diff; @@ -42,6 +42,7 @@ import org.eclipse.emf.ecore.resource.Resource; /** * @author Axel Richard + * @since 3.0 */ public abstract class BasicResourceContentsAccessorImpl implements IResourceContentsAccessor { @@ -104,9 +105,8 @@ public abstract class BasicResourceContentsAccessorImpl implements IResourceCont public Resource getResource(MergeViewerSide side) { Resource resource = null; Collection matchResources = fOwnerMatch.getComparison().getMatchedResources(); - Iterator it = matchResources.iterator(); - if (it.hasNext()) { - MatchResource matchResource = it.next(); + final String diffResourceURI = ((ResourceAttachmentChange)fDiff).getResourceURI(); + for (MatchResource matchResource : matchResources) { switch (side) { case ANCESTOR: resource = matchResource.getOrigin(); @@ -120,6 +120,12 @@ public abstract class BasicResourceContentsAccessorImpl implements IResourceCont default: throw new IllegalStateException(); } + if (resource != null) { + URI resourceURI = resource.getURI(); + if (diffResourceURI.equals(resourceURI.toString())) { + return resource; + } + } } return resource; } diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/EmptyMatchedResourcesFilter.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/EmptyMatchedResourcesFilter.java new file mode 100644 index 000000000..355242e52 --- /dev/null +++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/EmptyMatchedResourcesFilter.java @@ -0,0 +1,135 @@ +/******************************************************************************* + * Copyright (c) 2013 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.rcp.ui.structuremergeviewer.filters; + +import static com.google.common.collect.Iterables.filter; +import static com.google.common.collect.Iterables.isEmpty; + +import com.google.common.base.Predicate; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.compare.Comparison; +import org.eclipse.emf.compare.Diff; +import org.eclipse.emf.compare.MatchResource; +import org.eclipse.emf.compare.ResourceAttachmentChange; +import org.eclipse.emf.compare.scope.IComparisonScope; +import org.eclipse.emf.ecore.EObject; + +/** + * A filter used by default that filtered out matched elements. + * + * @author Axel Richard + * @since 3.0 + */ +public class EmptyMatchedResourcesFilter implements IDifferenceFilter { + + /** A human-readable label for this filter. This will be displayed in the EMF Compare UI. */ + private String label; + + /** The initial activation state of the filter. */ + private boolean activeByDefault; + + /** The Predicate activate through this action. */ + private Predicate predicate; + + /** + * Constructs the filter with the appropriate predicate. + */ + public EmptyMatchedResourcesFilter() { + super(); + setPredicate(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getLabel() + */ + public String getLabel() { + return label; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#setLabel(java.lang.String) + */ + public void setLabel(String label) { + this.label = label; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#defaultSelected() + */ + public boolean defaultSelected() { + return activeByDefault; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#setDefaultSelected(boolean) + */ + public void setDefaultSelected(boolean activeByDefault) { + this.activeByDefault = activeByDefault; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#isEnabled(org.eclipse.emf.compare.scope.IComparisonScope, + * org.eclipse.emf.compare.Comparison) + */ + public boolean isEnabled(IComparisonScope scope, Comparison comparison) { + return true; + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getPredicate() + */ + public Predicate getPredicate() { + return predicate; + } + + /** + * Set the predicate that will be activate through this filter. + */ + private void setPredicate() { + final Predicate actualPredicate = new Predicate() { + public boolean apply(EObject input) { + if (input instanceof MatchResource) { + EList differences = ((MatchResource)input).getComparison().getDifferences(); + Iterable resourceAttachmentchanges = filter(differences, + ResourceAttachmentChange.class); + if (!isEmpty(resourceAttachmentchanges)) { + for (ResourceAttachmentChange rac : resourceAttachmentchanges) { + final String diffResourceURI = rac.getResourceURI(); + if (!diffResourceURI.equals(((MatchResource)input).getLeftURI()) + && !diffResourceURI.equals(((MatchResource)input).getRightURI()) + && !diffResourceURI.equals(((MatchResource)input).getOriginURI())) { + return true; + } + } + } else { + return true; + } + } + return false; + } + }; + predicate = actualPredicate; + } + +} diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/MatchedResourcesFilter.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/MatchedResourcesFilter.java deleted file mode 100644 index d0f181df0..000000000 --- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/MatchedResourcesFilter.java +++ /dev/null @@ -1,112 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 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.rcp.ui.structuremergeviewer.filters; - -import com.google.common.base.Predicate; - -import org.eclipse.emf.compare.Comparison; -import org.eclipse.emf.compare.MatchResource; -import org.eclipse.emf.compare.scope.IComparisonScope; -import org.eclipse.emf.ecore.EObject; - -/** - * A filter used by default that filtered out matched elements. - * - * @author Axel Richard - * @since 3.0 - */ -public class MatchedResourcesFilter implements IDifferenceFilter { - - /** A human-readable label for this filter. This will be displayed in the EMF Compare UI. */ - private String label; - - /** The initial activation state of the filter. */ - private boolean activeByDefault; - - /** The Predicate activate through this action. */ - private Predicate predicate; - - /** - * Constructs the filter with the appropriate predicate. - */ - public MatchedResourcesFilter() { - super(); - setPredicate(); - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getLabel() - */ - public String getLabel() { - return label; - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#setLabel(java.lang.String) - */ - public void setLabel(String label) { - this.label = label; - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#defaultSelected() - */ - public boolean defaultSelected() { - return activeByDefault; - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#setDefaultSelected(boolean) - */ - public void setDefaultSelected(boolean activeByDefault) { - this.activeByDefault = activeByDefault; - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#isEnabled(org.eclipse.emf.compare.scope.IComparisonScope, - * org.eclipse.emf.compare.Comparison) - */ - public boolean isEnabled(IComparisonScope scope, Comparison comparison) { - return true; - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getPredicate() - */ - public Predicate getPredicate() { - return predicate; - } - - /** - * Set the predicate that will be activate through this filter. - */ - private void setPredicate() { - final Predicate actualPredicate = new Predicate() { - public boolean apply(EObject input) { - return input instanceof MatchResource; - } - }; - predicate = actualPredicate; - } - -} diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/StructureMergeViewerFilter.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/StructureMergeViewerFilter.java index 5297665f2..e9b530f27 100644 --- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/StructureMergeViewerFilter.java +++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/StructureMergeViewerFilter.java @@ -27,6 +27,7 @@ import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.common.notify.Notifier; import org.eclipse.emf.compare.Diff; import org.eclipse.emf.compare.Match; +import org.eclipse.emf.compare.MatchResource; import org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilterSelectionChangeEvent.Action; import org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.DifferenceGroup; import org.eclipse.emf.ecore.EObject; @@ -95,6 +96,9 @@ public class StructureMergeViewerFilter extends ViewerFilter { } else if (notifier instanceof Match) { final Iterator differences = ((Match)notifier).getAllDifferences().iterator(); result = Iterators.any(differences, not(predicate)); + } else if (notifier instanceof MatchResource) { + final MatchResource matchResource = (MatchResource)notifier; + result = !predicate.apply(matchResource); } } else if (element instanceof DifferenceGroup) { final Iterator differences = ((DifferenceGroup)element).getDifferences() @@ -120,7 +124,8 @@ public class StructureMergeViewerFilter extends ViewerFilter { */ public void addFilter(IDifferenceFilter filter) { addPredicate(filter.getPredicate()); - eventBus.post(new IDifferenceFilterSelectionChangeEvent.DefaultFilterSelectionChangeEvent(filter, Action.ADD)); + eventBus.post(new IDifferenceFilterSelectionChangeEvent.DefaultFilterSelectionChangeEvent(filter, + Action.ADD)); } /** @@ -131,7 +136,8 @@ public class StructureMergeViewerFilter extends ViewerFilter { */ public void removeFilter(IDifferenceFilter filter) { removePredicate(filter.getPredicate()); - eventBus.post(new IDifferenceFilterSelectionChangeEvent.DefaultFilterSelectionChangeEvent(filter, Action.REMOVE)); + eventBus.post(new IDifferenceFilterSelectionChangeEvent.DefaultFilterSelectionChangeEvent(filter, + Action.REMOVE)); } /** diff --git a/plugins/org.eclipse.emf.compare/model/compare.ecore b/plugins/org.eclipse.emf.compare/model/compare.ecore index a5af333a3..bcfbf848b 100644 --- a/plugins/org.eclipse.emf.compare/model/compare.ecore +++ b/plugins/org.eclipse.emf.compare/model/compare.ecore @@ -32,7 +32,7 @@ + eType="#//MatchResource" containment="true" eOpposite="#//MatchResource/comparison">
@@ -96,6 +96,8 @@
+ diff --git a/plugins/org.eclipse.emf.compare/model/compare.genmodel b/plugins/org.eclipse.emf.compare/model/compare.genmodel index 03c388f04..b8b596f66 100644 --- a/plugins/org.eclipse.emf.compare/model/compare.genmodel +++ b/plugins/org.eclipse.emf.compare/model/compare.genmodel @@ -35,7 +35,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -58,6 +58,7 @@ + diff --git a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/ComparePackage.java b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/ComparePackage.java index eb336b2ce..eb5602bbe 100644 --- a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/ComparePackage.java +++ b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/ComparePackage.java @@ -1,1857 +1,1885 @@ -/** - * 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; - -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.EPackage; -import org.eclipse.emf.ecore.EReference; - -/** - * - * The Package for the model. - * It contains accessors for the meta objects to represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @see org.eclipse.emf.compare.CompareFactory - * @model kind="package" - * @generated - */ -public interface ComparePackage extends EPackage { - /** - * - * - * @generated - */ - 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$ - - /** - * The package name. - * - * - * @generated - */ - String eNAME = "compare"; //$NON-NLS-1$ - - /** - * The package namespace URI. - * - * - * @generated - */ - String eNS_URI = "http://www.eclipse.org/emf/compare"; //$NON-NLS-1$ - - /** - * The package namespace name. - * - * - * @generated - */ - String eNS_PREFIX = "compare"; //$NON-NLS-1$ - - /** - * The singleton instance of the package. - * - * - * @generated - */ - ComparePackage eINSTANCE = org.eclipse.emf.compare.impl.ComparePackageImpl.init(); - - /** - * The meta object id for the '{@link org.eclipse.emf.compare.impl.ComparisonImpl Comparison}' class. - * - * - * @see org.eclipse.emf.compare.impl.ComparisonImpl - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getComparison() - * @generated - */ - int COMPARISON = 0; - - /** - * The feature id for the 'Matched Resources' containment reference list. - * - * - * @generated - * @ordered - */ - int COMPARISON__MATCHED_RESOURCES = 0; - - /** - * The feature id for the 'Matches' containment reference list. - * - * - * @generated - * @ordered - */ - int COMPARISON__MATCHES = 1; - - /** - * The feature id for the 'Conflicts' containment reference list. - * - * - * @generated - * @ordered - */ - int COMPARISON__CONFLICTS = 2; - - /** - * The feature id for the 'Equivalences' containment reference list. - * - * - * @generated - * @ordered - */ - int COMPARISON__EQUIVALENCES = 3; - - /** - * The feature id for the 'Three Way' attribute. - * - * - * @generated - * @ordered - */ - int COMPARISON__THREE_WAY = 4; - - /** - * The number of structural features of the 'Comparison' class. - * - * - * @generated - * @ordered - */ - int COMPARISON_FEATURE_COUNT = 5; - - /** - * The meta object id for the '{@link org.eclipse.emf.compare.impl.MatchResourceImpl Match Resource}' class. - * - * - * @see org.eclipse.emf.compare.impl.MatchResourceImpl - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getMatchResource() - * @generated - */ - int MATCH_RESOURCE = 1; - - /** - * The feature id for the 'Left URI' attribute. - * - * - * @generated - * @ordered - */ - int MATCH_RESOURCE__LEFT_URI = 0; - - /** - * The feature id for the 'Right URI' attribute. - * - * - * @generated - * @ordered - */ - int MATCH_RESOURCE__RIGHT_URI = 1; - - /** - * The feature id for the 'Origin URI' attribute. - * - * - * @generated - * @ordered - */ - int MATCH_RESOURCE__ORIGIN_URI = 2; - - /** - * The feature id for the 'Left' attribute. - * - * - * @generated - * @ordered - */ - int MATCH_RESOURCE__LEFT = 3; - - /** - * The feature id for the 'Right' attribute. - * - * - * @generated - * @ordered - */ - int MATCH_RESOURCE__RIGHT = 4; - - /** - * The feature id for the 'Origin' attribute. - * - * - * @generated - * @ordered - */ - int MATCH_RESOURCE__ORIGIN = 5; - - /** - * The number of structural features of the 'Match Resource' class. - * - * - * @generated - * @ordered - */ - int MATCH_RESOURCE_FEATURE_COUNT = 6; - - /** - * The meta object id for the '{@link org.eclipse.emf.compare.impl.MatchImpl Match}' class. - * - * - * @see org.eclipse.emf.compare.impl.MatchImpl - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getMatch() - * @generated - */ - int MATCH = 2; - - /** - * The feature id for the 'Submatches' containment reference list. - * - * - * @generated - * @ordered - */ - int MATCH__SUBMATCHES = 0; - - /** - * The feature id for the 'Differences' containment reference list. - * - * - * @generated - * @ordered - */ - int MATCH__DIFFERENCES = 1; - - /** - * The feature id for the 'Left' reference. - * - * - * @generated - * @ordered - */ - int MATCH__LEFT = 2; - - /** - * The feature id for the 'Right' reference. - * - * - * @generated - * @ordered - */ - int MATCH__RIGHT = 3; - - /** - * The feature id for the 'Origin' reference. - * - * - * @generated - * @ordered - */ - int MATCH__ORIGIN = 4; - - /** - * The number of structural features of the 'Match' class. - * - * - * @generated - * @ordered - */ - int MATCH_FEATURE_COUNT = 5; - - /** - * The meta object id for the '{@link org.eclipse.emf.compare.impl.DiffImpl Diff}' class. - * - * - * @see org.eclipse.emf.compare.impl.DiffImpl - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getDiff() - * @generated - */ - int DIFF = 3; - - /** - * The feature id for the 'Match' container reference. - * - * - * @generated - * @ordered - */ - int DIFF__MATCH = 0; - - /** - * The feature id for the 'Requires' reference list. - * - * - * @generated - * @ordered - */ - int DIFF__REQUIRES = 1; - - /** - * The feature id for the 'Required By' reference list. - * - * - * @generated - * @ordered - */ - int DIFF__REQUIRED_BY = 2; - - /** - * The feature id for the 'Refines' reference list. - * - * - * @generated - * @ordered - */ - int DIFF__REFINES = 3; - - /** - * The feature id for the 'Refined By' reference list. - * - * - * @generated - * @ordered - */ - int DIFF__REFINED_BY = 4; - - /** - * The feature id for the 'Kind' attribute. - * - * - * @generated - * @ordered - */ - int DIFF__KIND = 5; - - /** - * The feature id for the 'Source' attribute. - * - * - * @generated - * @ordered - */ - int DIFF__SOURCE = 6; - - /** - * The feature id for the 'State' attribute. - * - * - * @generated - * @ordered - */ - int DIFF__STATE = 7; - - /** - * The feature id for the 'Equivalence' reference. - * - * - * @generated - * @ordered - */ - int DIFF__EQUIVALENCE = 8; - - /** - * The feature id for the 'Conflict' reference. - * - * - * @generated - * @ordered - */ - int DIFF__CONFLICT = 9; - - /** - * The number of structural features of the 'Diff' class. - * - * - * @generated - * @ordered - */ - int DIFF_FEATURE_COUNT = 10; - - /** - * The meta object id for the '{@link org.eclipse.emf.compare.impl.ResourceAttachmentChangeImpl Resource Attachment Change}' class. - * - * - * @see org.eclipse.emf.compare.impl.ResourceAttachmentChangeImpl - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getResourceAttachmentChange() - * @generated - */ - int RESOURCE_ATTACHMENT_CHANGE = 4; - - /** - * The feature id for the 'Match' container reference. - * - * - * @generated - * @ordered - */ - int RESOURCE_ATTACHMENT_CHANGE__MATCH = DIFF__MATCH; - - /** - * The feature id for the 'Requires' reference list. - * - * - * @generated - * @ordered - */ - int RESOURCE_ATTACHMENT_CHANGE__REQUIRES = DIFF__REQUIRES; - - /** - * The feature id for the 'Required By' reference list. - * - * - * @generated - * @ordered - */ - int RESOURCE_ATTACHMENT_CHANGE__REQUIRED_BY = DIFF__REQUIRED_BY; - - /** - * The feature id for the 'Refines' reference list. - * - * - * @generated - * @ordered - */ - int RESOURCE_ATTACHMENT_CHANGE__REFINES = DIFF__REFINES; - - /** - * The feature id for the 'Refined By' reference list. - * - * - * @generated - * @ordered - */ - int RESOURCE_ATTACHMENT_CHANGE__REFINED_BY = DIFF__REFINED_BY; - - /** - * The feature id for the 'Kind' attribute. - * - * - * @generated - * @ordered - */ - int RESOURCE_ATTACHMENT_CHANGE__KIND = DIFF__KIND; - - /** - * The feature id for the 'Source' attribute. - * - * - * @generated - * @ordered - */ - int RESOURCE_ATTACHMENT_CHANGE__SOURCE = DIFF__SOURCE; - - /** - * The feature id for the 'State' attribute. - * - * - * @generated - * @ordered - */ - int RESOURCE_ATTACHMENT_CHANGE__STATE = DIFF__STATE; - - /** - * The feature id for the 'Equivalence' reference. - * - * - * @generated - * @ordered - */ - int RESOURCE_ATTACHMENT_CHANGE__EQUIVALENCE = DIFF__EQUIVALENCE; - - /** - * The feature id for the 'Conflict' reference. - * - * - * @generated - * @ordered - */ - int RESOURCE_ATTACHMENT_CHANGE__CONFLICT = DIFF__CONFLICT; - - /** - * The feature id for the 'Resource URI' attribute. - * - * - * @generated - * @ordered - */ - int RESOURCE_ATTACHMENT_CHANGE__RESOURCE_URI = DIFF_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Resource Attachment Change' class. - * - * - * @generated - * @ordered - */ - int RESOURCE_ATTACHMENT_CHANGE_FEATURE_COUNT = DIFF_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.emf.compare.impl.ReferenceChangeImpl Reference Change}' class. - * - * - * @see org.eclipse.emf.compare.impl.ReferenceChangeImpl - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getReferenceChange() - * @generated - */ - int REFERENCE_CHANGE = 5; - - /** - * The feature id for the 'Match' container reference. - * - * - * @generated - * @ordered - */ - int REFERENCE_CHANGE__MATCH = DIFF__MATCH; - - /** - * The feature id for the 'Requires' reference list. - * - * - * @generated - * @ordered - */ - int REFERENCE_CHANGE__REQUIRES = DIFF__REQUIRES; - - /** - * The feature id for the 'Required By' reference list. - * - * - * @generated - * @ordered - */ - int REFERENCE_CHANGE__REQUIRED_BY = DIFF__REQUIRED_BY; - - /** - * The feature id for the 'Refines' reference list. - * - * - * @generated - * @ordered - */ - int REFERENCE_CHANGE__REFINES = DIFF__REFINES; - - /** - * The feature id for the 'Refined By' reference list. - * - * - * @generated - * @ordered - */ - int REFERENCE_CHANGE__REFINED_BY = DIFF__REFINED_BY; - - /** - * The feature id for the 'Kind' attribute. - * - * - * @generated - * @ordered - */ - int REFERENCE_CHANGE__KIND = DIFF__KIND; - - /** - * The feature id for the 'Source' attribute. - * - * - * @generated - * @ordered - */ - int REFERENCE_CHANGE__SOURCE = DIFF__SOURCE; - - /** - * The feature id for the 'State' attribute. - * - * - * @generated - * @ordered - */ - int REFERENCE_CHANGE__STATE = DIFF__STATE; - - /** - * The feature id for the 'Equivalence' reference. - * - * - * @generated - * @ordered - */ - int REFERENCE_CHANGE__EQUIVALENCE = DIFF__EQUIVALENCE; - - /** - * The feature id for the 'Conflict' reference. - * - * - * @generated - * @ordered - */ - int REFERENCE_CHANGE__CONFLICT = DIFF__CONFLICT; - - /** - * The feature id for the 'Reference' reference. - * - * - * @generated - * @ordered - */ - int REFERENCE_CHANGE__REFERENCE = DIFF_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Value' reference. - * - * - * @generated - * @ordered - */ - int REFERENCE_CHANGE__VALUE = DIFF_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Reference Change' class. - * - * - * @generated - * @ordered - */ - int REFERENCE_CHANGE_FEATURE_COUNT = DIFF_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.emf.compare.impl.AttributeChangeImpl Attribute Change}' class. - * - * - * @see org.eclipse.emf.compare.impl.AttributeChangeImpl - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getAttributeChange() - * @generated - */ - int ATTRIBUTE_CHANGE = 6; - - /** - * The feature id for the 'Match' container reference. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE_CHANGE__MATCH = DIFF__MATCH; - - /** - * The feature id for the 'Requires' reference list. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE_CHANGE__REQUIRES = DIFF__REQUIRES; - - /** - * The feature id for the 'Required By' reference list. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE_CHANGE__REQUIRED_BY = DIFF__REQUIRED_BY; - - /** - * The feature id for the 'Refines' reference list. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE_CHANGE__REFINES = DIFF__REFINES; - - /** - * The feature id for the 'Refined By' reference list. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE_CHANGE__REFINED_BY = DIFF__REFINED_BY; - - /** - * The feature id for the 'Kind' attribute. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE_CHANGE__KIND = DIFF__KIND; - - /** - * The feature id for the 'Source' attribute. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE_CHANGE__SOURCE = DIFF__SOURCE; - - /** - * The feature id for the 'State' attribute. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE_CHANGE__STATE = DIFF__STATE; - - /** - * The feature id for the 'Equivalence' reference. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE_CHANGE__EQUIVALENCE = DIFF__EQUIVALENCE; - - /** - * The feature id for the 'Conflict' reference. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE_CHANGE__CONFLICT = DIFF__CONFLICT; - - /** - * The feature id for the 'Attribute' reference. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE_CHANGE__ATTRIBUTE = DIFF_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Value' attribute. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE_CHANGE__VALUE = DIFF_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Attribute Change' class. - * - * - * @generated - * @ordered - */ - int ATTRIBUTE_CHANGE_FEATURE_COUNT = DIFF_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.emf.compare.impl.ConflictImpl Conflict}' class. - * - * - * @see org.eclipse.emf.compare.impl.ConflictImpl - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getConflict() - * @generated - */ - int CONFLICT = 7; - - /** - * The feature id for the 'Kind' attribute. - * - * - * @generated - * @ordered - */ - int CONFLICT__KIND = 0; - - /** - * The feature id for the 'Differences' reference list. - * - * - * @generated - * @ordered - */ - int CONFLICT__DIFFERENCES = 1; - - /** - * The number of structural features of the 'Conflict' class. - * - * - * @generated - * @ordered - */ - int CONFLICT_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.eclipse.emf.compare.impl.EquivalenceImpl Equivalence}' class. - * - * - * @see org.eclipse.emf.compare.impl.EquivalenceImpl - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getEquivalence() - * @generated - */ - int EQUIVALENCE = 8; - - /** - * The feature id for the 'Differences' reference list. - * - * - * @generated - * @ordered - */ - int EQUIVALENCE__DIFFERENCES = 0; - - /** - * The number of structural features of the 'Equivalence' class. - * - * - * @generated - * @ordered - */ - int EQUIVALENCE_FEATURE_COUNT = 1; - - /** - * The meta object id for the '{@link org.eclipse.emf.compare.DifferenceKind Difference Kind}' enum. - * - * - * @see org.eclipse.emf.compare.DifferenceKind - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getDifferenceKind() - * @generated - */ - int DIFFERENCE_KIND = 9; - - /** - * The meta object id for the '{@link org.eclipse.emf.compare.DifferenceSource Difference Source}' enum. - * - * - * @see org.eclipse.emf.compare.DifferenceSource - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getDifferenceSource() - * @generated - */ - int DIFFERENCE_SOURCE = 10; - - /** - * The meta object id for the '{@link org.eclipse.emf.compare.DifferenceState Difference State}' enum. - * - * - * @see org.eclipse.emf.compare.DifferenceState - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getDifferenceState() - * @generated - */ - int DIFFERENCE_STATE = 11; - - /** - * The meta object id for the '{@link org.eclipse.emf.compare.ConflictKind Conflict Kind}' enum. - * - * - * @see org.eclipse.emf.compare.ConflictKind - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getConflictKind() - * @generated - */ - int CONFLICT_KIND = 12; - - /** - * The meta object id for the 'EIterable' data type. - * - * - * @see java.lang.Iterable - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getEIterable() - * @generated - */ - int EITERABLE = 13; - - /** - * The meta object id for the 'IEquality Helper' data type. - * - * - * @see org.eclipse.emf.compare.utils.IEqualityHelper - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getIEqualityHelper() - * @generated - */ - int IEQUALITY_HELPER = 14; - - /** - * Returns the meta object for class '{@link org.eclipse.emf.compare.Comparison Comparison}'. - * - * - * @return the meta object for class 'Comparison'. - * @see org.eclipse.emf.compare.Comparison - * @generated - */ - EClass getComparison(); - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.emf.compare.Comparison#getMatchedResources Matched Resources}'. - * - * - * @return the meta object for the containment reference list 'Matched Resources'. - * @see org.eclipse.emf.compare.Comparison#getMatchedResources() - * @see #getComparison() - * @generated - */ - EReference getComparison_MatchedResources(); - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.emf.compare.Comparison#getMatches Matches}'. - * - * - * @return the meta object for the containment reference list 'Matches'. - * @see org.eclipse.emf.compare.Comparison#getMatches() - * @see #getComparison() - * @generated - */ - EReference getComparison_Matches(); - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.emf.compare.Comparison#getConflicts Conflicts}'. - * - * - * @return the meta object for the containment reference list 'Conflicts'. - * @see org.eclipse.emf.compare.Comparison#getConflicts() - * @see #getComparison() - * @generated - */ - EReference getComparison_Conflicts(); - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.emf.compare.Comparison#getEquivalences Equivalences}'. - * - * - * @return the meta object for the containment reference list 'Equivalences'. - * @see org.eclipse.emf.compare.Comparison#getEquivalences() - * @see #getComparison() - * @generated - */ - EReference getComparison_Equivalences(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.Comparison#isThreeWay Three Way}'. - * - * - * @return the meta object for the attribute 'Three Way'. - * @see org.eclipse.emf.compare.Comparison#isThreeWay() - * @see #getComparison() - * @generated - */ - EAttribute getComparison_ThreeWay(); - - /** - * Returns the meta object for class '{@link org.eclipse.emf.compare.MatchResource Match Resource}'. - * - * - * @return the meta object for class 'Match Resource'. - * @see org.eclipse.emf.compare.MatchResource - * @generated - */ - EClass getMatchResource(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.MatchResource#getLeftURI Left URI}'. - * - * - * @return the meta object for the attribute 'Left URI'. - * @see org.eclipse.emf.compare.MatchResource#getLeftURI() - * @see #getMatchResource() - * @generated - */ - EAttribute getMatchResource_LeftURI(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.MatchResource#getRightURI Right URI}'. - * - * - * @return the meta object for the attribute 'Right URI'. - * @see org.eclipse.emf.compare.MatchResource#getRightURI() - * @see #getMatchResource() - * @generated - */ - EAttribute getMatchResource_RightURI(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.MatchResource#getOriginURI Origin URI}'. - * - * - * @return the meta object for the attribute 'Origin URI'. - * @see org.eclipse.emf.compare.MatchResource#getOriginURI() - * @see #getMatchResource() - * @generated - */ - EAttribute getMatchResource_OriginURI(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.MatchResource#getLeft Left}'. - * - * - * @return the meta object for the attribute 'Left'. - * @see org.eclipse.emf.compare.MatchResource#getLeft() - * @see #getMatchResource() - * @generated - */ - EAttribute getMatchResource_Left(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.MatchResource#getRight Right}'. - * - * - * @return the meta object for the attribute 'Right'. - * @see org.eclipse.emf.compare.MatchResource#getRight() - * @see #getMatchResource() - * @generated - */ - EAttribute getMatchResource_Right(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.MatchResource#getOrigin Origin}'. - * - * - * @return the meta object for the attribute 'Origin'. - * @see org.eclipse.emf.compare.MatchResource#getOrigin() - * @see #getMatchResource() - * @generated - */ - EAttribute getMatchResource_Origin(); - - /** - * Returns the meta object for class '{@link org.eclipse.emf.compare.Match Match}'. - * - * - * @return the meta object for class 'Match'. - * @see org.eclipse.emf.compare.Match - * @generated - */ - EClass getMatch(); - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.emf.compare.Match#getSubmatches Submatches}'. - * - * - * @return the meta object for the containment reference list 'Submatches'. - * @see org.eclipse.emf.compare.Match#getSubmatches() - * @see #getMatch() - * @generated - */ - EReference getMatch_Submatches(); - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.emf.compare.Match#getDifferences Differences}'. - * - * - * @return the meta object for the containment reference list 'Differences'. - * @see org.eclipse.emf.compare.Match#getDifferences() - * @see #getMatch() - * @generated - */ - EReference getMatch_Differences(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.emf.compare.Match#getLeft Left}'. - * - * - * @return the meta object for the reference 'Left'. - * @see org.eclipse.emf.compare.Match#getLeft() - * @see #getMatch() - * @generated - */ - EReference getMatch_Left(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.emf.compare.Match#getRight Right}'. - * - * - * @return the meta object for the reference 'Right'. - * @see org.eclipse.emf.compare.Match#getRight() - * @see #getMatch() - * @generated - */ - EReference getMatch_Right(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.emf.compare.Match#getOrigin Origin}'. - * - * - * @return the meta object for the reference 'Origin'. - * @see org.eclipse.emf.compare.Match#getOrigin() - * @see #getMatch() - * @generated - */ - EReference getMatch_Origin(); - - /** - * Returns the meta object for class '{@link org.eclipse.emf.compare.Diff Diff}'. - * - * - * @return the meta object for class 'Diff'. - * @see org.eclipse.emf.compare.Diff - * @generated - */ - EClass getDiff(); - - /** - * Returns the meta object for the container reference '{@link org.eclipse.emf.compare.Diff#getMatch Match}'. - * - * - * @return the meta object for the container reference 'Match'. - * @see org.eclipse.emf.compare.Diff#getMatch() - * @see #getDiff() - * @generated - */ - EReference getDiff_Match(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.emf.compare.Diff#getRequires Requires}'. - * - * - * @return the meta object for the reference list 'Requires'. - * @see org.eclipse.emf.compare.Diff#getRequires() - * @see #getDiff() - * @generated - */ - EReference getDiff_Requires(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.emf.compare.Diff#getRequiredBy Required By}'. - * - * - * @return the meta object for the reference list 'Required By'. - * @see org.eclipse.emf.compare.Diff#getRequiredBy() - * @see #getDiff() - * @generated - */ - EReference getDiff_RequiredBy(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.emf.compare.Diff#getRefines Refines}'. - * - * - * @return the meta object for the reference list 'Refines'. - * @see org.eclipse.emf.compare.Diff#getRefines() - * @see #getDiff() - * @generated - */ - EReference getDiff_Refines(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.emf.compare.Diff#getRefinedBy Refined By}'. - * - * - * @return the meta object for the reference list 'Refined By'. - * @see org.eclipse.emf.compare.Diff#getRefinedBy() - * @see #getDiff() - * @generated - */ - EReference getDiff_RefinedBy(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.Diff#getKind Kind}'. - * - * - * @return the meta object for the attribute 'Kind'. - * @see org.eclipse.emf.compare.Diff#getKind() - * @see #getDiff() - * @generated - */ - EAttribute getDiff_Kind(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.Diff#getSource Source}'. - * - * - * @return the meta object for the attribute 'Source'. - * @see org.eclipse.emf.compare.Diff#getSource() - * @see #getDiff() - * @generated - */ - EAttribute getDiff_Source(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.Diff#getState State}'. - * - * - * @return the meta object for the attribute 'State'. - * @see org.eclipse.emf.compare.Diff#getState() - * @see #getDiff() - * @generated - */ - EAttribute getDiff_State(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.emf.compare.Diff#getEquivalence Equivalence}'. - * - * - * @return the meta object for the reference 'Equivalence'. - * @see org.eclipse.emf.compare.Diff#getEquivalence() - * @see #getDiff() - * @generated - */ - EReference getDiff_Equivalence(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.emf.compare.Diff#getConflict Conflict}'. - * - * - * @return the meta object for the reference 'Conflict'. - * @see org.eclipse.emf.compare.Diff#getConflict() - * @see #getDiff() - * @generated - */ - EReference getDiff_Conflict(); - - /** - * Returns the meta object for class '{@link org.eclipse.emf.compare.ResourceAttachmentChange Resource Attachment Change}'. - * - * - * @return the meta object for class 'Resource Attachment Change'. - * @see org.eclipse.emf.compare.ResourceAttachmentChange - * @generated - */ - EClass getResourceAttachmentChange(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.ResourceAttachmentChange#getResourceURI Resource URI}'. - * - * - * @return the meta object for the attribute 'Resource URI'. - * @see org.eclipse.emf.compare.ResourceAttachmentChange#getResourceURI() - * @see #getResourceAttachmentChange() - * @generated - */ - EAttribute getResourceAttachmentChange_ResourceURI(); - - /** - * Returns the meta object for class '{@link org.eclipse.emf.compare.ReferenceChange Reference Change}'. - * - * - * @return the meta object for class 'Reference Change'. - * @see org.eclipse.emf.compare.ReferenceChange - * @generated - */ - EClass getReferenceChange(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.emf.compare.ReferenceChange#getReference Reference}'. - * - * - * @return the meta object for the reference 'Reference'. - * @see org.eclipse.emf.compare.ReferenceChange#getReference() - * @see #getReferenceChange() - * @generated - */ - EReference getReferenceChange_Reference(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.emf.compare.ReferenceChange#getValue Value}'. - * - * - * @return the meta object for the reference 'Value'. - * @see org.eclipse.emf.compare.ReferenceChange#getValue() - * @see #getReferenceChange() - * @generated - */ - EReference getReferenceChange_Value(); - - /** - * Returns the meta object for class '{@link org.eclipse.emf.compare.AttributeChange Attribute Change}'. - * - * - * @return the meta object for class 'Attribute Change'. - * @see org.eclipse.emf.compare.AttributeChange - * @generated - */ - EClass getAttributeChange(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.emf.compare.AttributeChange#getAttribute Attribute}'. - * - * - * @return the meta object for the reference 'Attribute'. - * @see org.eclipse.emf.compare.AttributeChange#getAttribute() - * @see #getAttributeChange() - * @generated - */ - EReference getAttributeChange_Attribute(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.AttributeChange#getValue Value}'. - * - * - * @return the meta object for the attribute 'Value'. - * @see org.eclipse.emf.compare.AttributeChange#getValue() - * @see #getAttributeChange() - * @generated - */ - EAttribute getAttributeChange_Value(); - - /** - * Returns the meta object for class '{@link org.eclipse.emf.compare.Conflict Conflict}'. - * - * - * @return the meta object for class 'Conflict'. - * @see org.eclipse.emf.compare.Conflict - * @generated - */ - EClass getConflict(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.Conflict#getKind Kind}'. - * - * - * @return the meta object for the attribute 'Kind'. - * @see org.eclipse.emf.compare.Conflict#getKind() - * @see #getConflict() - * @generated - */ - EAttribute getConflict_Kind(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.emf.compare.Conflict#getDifferences Differences}'. - * - * - * @return the meta object for the reference list 'Differences'. - * @see org.eclipse.emf.compare.Conflict#getDifferences() - * @see #getConflict() - * @generated - */ - EReference getConflict_Differences(); - - /** - * Returns the meta object for class '{@link org.eclipse.emf.compare.Equivalence Equivalence}'. - * - * - * @return the meta object for class 'Equivalence'. - * @see org.eclipse.emf.compare.Equivalence - * @generated - */ - EClass getEquivalence(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.emf.compare.Equivalence#getDifferences Differences}'. - * - * - * @return the meta object for the reference list 'Differences'. - * @see org.eclipse.emf.compare.Equivalence#getDifferences() - * @see #getEquivalence() - * @generated - */ - EReference getEquivalence_Differences(); - - /** - * Returns the meta object for enum '{@link org.eclipse.emf.compare.DifferenceKind Difference Kind}'. - * - * - * @return the meta object for enum 'Difference Kind'. - * @see org.eclipse.emf.compare.DifferenceKind - * @generated - */ - EEnum getDifferenceKind(); - - /** - * Returns the meta object for enum '{@link org.eclipse.emf.compare.DifferenceSource Difference Source}'. - * - * - * @return the meta object for enum 'Difference Source'. - * @see org.eclipse.emf.compare.DifferenceSource - * @generated - */ - EEnum getDifferenceSource(); - - /** - * Returns the meta object for enum '{@link org.eclipse.emf.compare.DifferenceState Difference State}'. - * - * - * @return the meta object for enum 'Difference State'. - * @see org.eclipse.emf.compare.DifferenceState - * @generated - */ - EEnum getDifferenceState(); - - /** - * Returns the meta object for enum '{@link org.eclipse.emf.compare.ConflictKind Conflict Kind}'. - * - * - * @return the meta object for enum 'Conflict Kind'. - * @see org.eclipse.emf.compare.ConflictKind - * @generated - */ - EEnum getConflictKind(); - - /** - * Returns the meta object for data type '{@link java.lang.Iterable EIterable}'. - * - * - * @return the meta object for data type 'EIterable'. - * @see java.lang.Iterable - * @model instanceClass="java.lang.Iterable" typeParameters="T" - * @generated - */ - EDataType getEIterable(); - - /** - * Returns the meta object for data type '{@link org.eclipse.emf.compare.utils.IEqualityHelper IEquality Helper}'. - * - * - * @return the meta object for data type 'IEquality Helper'. - * @see org.eclipse.emf.compare.utils.IEqualityHelper - * @model instanceClass="org.eclipse.emf.compare.utils.IEqualityHelper" serializeable="false" - * @generated - */ - EDataType getIEqualityHelper(); - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - CompareFactory getCompareFactory(); - - /** - * - * Defines literals for the meta objects that represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @generated - */ - @SuppressWarnings("hiding") - // generated code, removing warnings - interface Literals { - /** - * The meta object literal for the '{@link org.eclipse.emf.compare.impl.ComparisonImpl Comparison}' class. - * - * - * @see org.eclipse.emf.compare.impl.ComparisonImpl - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getComparison() - * @generated - */ - EClass COMPARISON = eINSTANCE.getComparison(); - - /** - * The meta object literal for the 'Matched Resources' containment reference list feature. - * - * - * @generated - */ - EReference COMPARISON__MATCHED_RESOURCES = eINSTANCE.getComparison_MatchedResources(); - - /** - * The meta object literal for the 'Matches' containment reference list feature. - * - * - * @generated - */ - EReference COMPARISON__MATCHES = eINSTANCE.getComparison_Matches(); - - /** - * The meta object literal for the 'Conflicts' containment reference list feature. - * - * - * @generated - */ - EReference COMPARISON__CONFLICTS = eINSTANCE.getComparison_Conflicts(); - - /** - * The meta object literal for the 'Equivalences' containment reference list feature. - * - * - * @generated - */ - EReference COMPARISON__EQUIVALENCES = eINSTANCE.getComparison_Equivalences(); - - /** - * The meta object literal for the 'Three Way' attribute feature. - * - * - * @generated - */ - EAttribute COMPARISON__THREE_WAY = eINSTANCE.getComparison_ThreeWay(); - - /** - * The meta object literal for the '{@link org.eclipse.emf.compare.impl.MatchResourceImpl Match Resource}' class. - * - * - * @see org.eclipse.emf.compare.impl.MatchResourceImpl - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getMatchResource() - * @generated - */ - EClass MATCH_RESOURCE = eINSTANCE.getMatchResource(); - - /** - * The meta object literal for the 'Left URI' attribute feature. - * - * - * @generated - */ - EAttribute MATCH_RESOURCE__LEFT_URI = eINSTANCE.getMatchResource_LeftURI(); - - /** - * The meta object literal for the 'Right URI' attribute feature. - * - * - * @generated - */ - EAttribute MATCH_RESOURCE__RIGHT_URI = eINSTANCE.getMatchResource_RightURI(); - - /** - * The meta object literal for the 'Origin URI' attribute feature. - * - * - * @generated - */ - EAttribute MATCH_RESOURCE__ORIGIN_URI = eINSTANCE.getMatchResource_OriginURI(); - - /** - * The meta object literal for the 'Left' attribute feature. - * - * - * @generated - */ - EAttribute MATCH_RESOURCE__LEFT = eINSTANCE.getMatchResource_Left(); - - /** - * The meta object literal for the 'Right' attribute feature. - * - * - * @generated - */ - EAttribute MATCH_RESOURCE__RIGHT = eINSTANCE.getMatchResource_Right(); - - /** - * The meta object literal for the 'Origin' attribute feature. - * - * - * @generated - */ - EAttribute MATCH_RESOURCE__ORIGIN = eINSTANCE.getMatchResource_Origin(); - - /** - * The meta object literal for the '{@link org.eclipse.emf.compare.impl.MatchImpl Match}' class. - * - * - * @see org.eclipse.emf.compare.impl.MatchImpl - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getMatch() - * @generated - */ - EClass MATCH = eINSTANCE.getMatch(); - - /** - * The meta object literal for the 'Submatches' containment reference list feature. - * - * - * @generated - */ - EReference MATCH__SUBMATCHES = eINSTANCE.getMatch_Submatches(); - - /** - * The meta object literal for the 'Differences' containment reference list feature. - * - * - * @generated - */ - EReference MATCH__DIFFERENCES = eINSTANCE.getMatch_Differences(); - - /** - * The meta object literal for the 'Left' reference feature. - * - * - * @generated - */ - EReference MATCH__LEFT = eINSTANCE.getMatch_Left(); - - /** - * The meta object literal for the 'Right' reference feature. - * - * - * @generated - */ - EReference MATCH__RIGHT = eINSTANCE.getMatch_Right(); - - /** - * The meta object literal for the 'Origin' reference feature. - * - * - * @generated - */ - EReference MATCH__ORIGIN = eINSTANCE.getMatch_Origin(); - - /** - * The meta object literal for the '{@link org.eclipse.emf.compare.impl.DiffImpl Diff}' class. - * - * - * @see org.eclipse.emf.compare.impl.DiffImpl - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getDiff() - * @generated - */ - EClass DIFF = eINSTANCE.getDiff(); - - /** - * The meta object literal for the 'Match' container reference feature. - * - * - * @generated - */ - EReference DIFF__MATCH = eINSTANCE.getDiff_Match(); - - /** - * The meta object literal for the 'Requires' reference list feature. - * - * - * @generated - */ - EReference DIFF__REQUIRES = eINSTANCE.getDiff_Requires(); - - /** - * The meta object literal for the 'Required By' reference list feature. - * - * - * @generated - */ - EReference DIFF__REQUIRED_BY = eINSTANCE.getDiff_RequiredBy(); - - /** - * The meta object literal for the 'Refines' reference list feature. - * - * - * @generated - */ - EReference DIFF__REFINES = eINSTANCE.getDiff_Refines(); - - /** - * The meta object literal for the 'Refined By' reference list feature. - * - * - * @generated - */ - EReference DIFF__REFINED_BY = eINSTANCE.getDiff_RefinedBy(); - - /** - * The meta object literal for the 'Kind' attribute feature. - * - * - * @generated - */ - EAttribute DIFF__KIND = eINSTANCE.getDiff_Kind(); - - /** - * The meta object literal for the 'Source' attribute feature. - * - * - * @generated - */ - EAttribute DIFF__SOURCE = eINSTANCE.getDiff_Source(); - - /** - * The meta object literal for the 'State' attribute feature. - * - * - * @generated - */ - EAttribute DIFF__STATE = eINSTANCE.getDiff_State(); - - /** - * The meta object literal for the 'Equivalence' reference feature. - * - * - * @generated - */ - EReference DIFF__EQUIVALENCE = eINSTANCE.getDiff_Equivalence(); - - /** - * The meta object literal for the 'Conflict' reference feature. - * - * - * @generated - */ - EReference DIFF__CONFLICT = eINSTANCE.getDiff_Conflict(); - - /** - * The meta object literal for the '{@link org.eclipse.emf.compare.impl.ResourceAttachmentChangeImpl Resource Attachment Change}' class. - * - * - * @see org.eclipse.emf.compare.impl.ResourceAttachmentChangeImpl - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getResourceAttachmentChange() - * @generated - */ - EClass RESOURCE_ATTACHMENT_CHANGE = eINSTANCE.getResourceAttachmentChange(); - - /** - * The meta object literal for the 'Resource URI' attribute feature. - * - * - * @generated - */ - EAttribute RESOURCE_ATTACHMENT_CHANGE__RESOURCE_URI = eINSTANCE - .getResourceAttachmentChange_ResourceURI(); - - /** - * The meta object literal for the '{@link org.eclipse.emf.compare.impl.ReferenceChangeImpl Reference Change}' class. - * - * - * @see org.eclipse.emf.compare.impl.ReferenceChangeImpl - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getReferenceChange() - * @generated - */ - EClass REFERENCE_CHANGE = eINSTANCE.getReferenceChange(); - - /** - * The meta object literal for the 'Reference' reference feature. - * - * - * @generated - */ - EReference REFERENCE_CHANGE__REFERENCE = eINSTANCE.getReferenceChange_Reference(); - - /** - * The meta object literal for the 'Value' reference feature. - * - * - * @generated - */ - EReference REFERENCE_CHANGE__VALUE = eINSTANCE.getReferenceChange_Value(); - - /** - * The meta object literal for the '{@link org.eclipse.emf.compare.impl.AttributeChangeImpl Attribute Change}' class. - * - * - * @see org.eclipse.emf.compare.impl.AttributeChangeImpl - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getAttributeChange() - * @generated - */ - EClass ATTRIBUTE_CHANGE = eINSTANCE.getAttributeChange(); - - /** - * The meta object literal for the 'Attribute' reference feature. - * - * - * @generated - */ - EReference ATTRIBUTE_CHANGE__ATTRIBUTE = eINSTANCE.getAttributeChange_Attribute(); - - /** - * The meta object literal for the 'Value' attribute feature. - * - * - * @generated - */ - EAttribute ATTRIBUTE_CHANGE__VALUE = eINSTANCE.getAttributeChange_Value(); - - /** - * The meta object literal for the '{@link org.eclipse.emf.compare.impl.ConflictImpl Conflict}' class. - * - * - * @see org.eclipse.emf.compare.impl.ConflictImpl - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getConflict() - * @generated - */ - EClass CONFLICT = eINSTANCE.getConflict(); - - /** - * The meta object literal for the 'Kind' attribute feature. - * - * - * @generated - */ - EAttribute CONFLICT__KIND = eINSTANCE.getConflict_Kind(); - - /** - * The meta object literal for the 'Differences' reference list feature. - * - * - * @generated - */ - EReference CONFLICT__DIFFERENCES = eINSTANCE.getConflict_Differences(); - - /** - * The meta object literal for the '{@link org.eclipse.emf.compare.impl.EquivalenceImpl Equivalence}' class. - * - * - * @see org.eclipse.emf.compare.impl.EquivalenceImpl - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getEquivalence() - * @generated - */ - EClass EQUIVALENCE = eINSTANCE.getEquivalence(); - - /** - * The meta object literal for the 'Differences' reference list feature. - * - * - * @generated - */ - EReference EQUIVALENCE__DIFFERENCES = eINSTANCE.getEquivalence_Differences(); - - /** - * The meta object literal for the '{@link org.eclipse.emf.compare.DifferenceKind Difference Kind}' enum. - * - * - * @see org.eclipse.emf.compare.DifferenceKind - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getDifferenceKind() - * @generated - */ - EEnum DIFFERENCE_KIND = eINSTANCE.getDifferenceKind(); - - /** - * The meta object literal for the '{@link org.eclipse.emf.compare.DifferenceSource Difference Source}' enum. - * - * - * @see org.eclipse.emf.compare.DifferenceSource - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getDifferenceSource() - * @generated - */ - EEnum DIFFERENCE_SOURCE = eINSTANCE.getDifferenceSource(); - - /** - * The meta object literal for the '{@link org.eclipse.emf.compare.DifferenceState Difference State}' enum. - * - * - * @see org.eclipse.emf.compare.DifferenceState - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getDifferenceState() - * @generated - */ - EEnum DIFFERENCE_STATE = eINSTANCE.getDifferenceState(); - - /** - * The meta object literal for the '{@link org.eclipse.emf.compare.ConflictKind Conflict Kind}' enum. - * - * - * @see org.eclipse.emf.compare.ConflictKind - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getConflictKind() - * @generated - */ - EEnum CONFLICT_KIND = eINSTANCE.getConflictKind(); - - /** - * The meta object literal for the 'EIterable' data type. - * - * - * @see java.lang.Iterable - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getEIterable() - * @generated - */ - EDataType EITERABLE = eINSTANCE.getEIterable(); - - /** - * The meta object literal for the 'IEquality Helper' data type. - * - * - * @see org.eclipse.emf.compare.utils.IEqualityHelper - * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getIEqualityHelper() - * @generated - */ - EDataType IEQUALITY_HELPER = eINSTANCE.getIEqualityHelper(); - - } - -} //ComparePackage +/** + * 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; + +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.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @see org.eclipse.emf.compare.CompareFactory + * @model kind="package" + * @generated + */ +public interface ComparePackage extends EPackage { + /** + * + * + * @generated + */ + 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$ + + /** + * The package name. + * + * + * @generated + */ + String eNAME = "compare"; //$NON-NLS-1$ + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://www.eclipse.org/emf/compare"; //$NON-NLS-1$ + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "compare"; //$NON-NLS-1$ + + /** + * The singleton instance of the package. + * + * + * @generated + */ + ComparePackage eINSTANCE = org.eclipse.emf.compare.impl.ComparePackageImpl.init(); + + /** + * The meta object id for the '{@link org.eclipse.emf.compare.impl.ComparisonImpl Comparison}' class. + * + * + * @see org.eclipse.emf.compare.impl.ComparisonImpl + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getComparison() + * @generated + */ + int COMPARISON = 0; + + /** + * The feature id for the 'Matched Resources' containment reference list. + * + * + * @generated + * @ordered + */ + int COMPARISON__MATCHED_RESOURCES = 0; + + /** + * The feature id for the 'Matches' containment reference list. + * + * + * @generated + * @ordered + */ + int COMPARISON__MATCHES = 1; + + /** + * The feature id for the 'Conflicts' containment reference list. + * + * + * @generated + * @ordered + */ + int COMPARISON__CONFLICTS = 2; + + /** + * The feature id for the 'Equivalences' containment reference list. + * + * + * @generated + * @ordered + */ + int COMPARISON__EQUIVALENCES = 3; + + /** + * The feature id for the 'Three Way' attribute. + * + * + * @generated + * @ordered + */ + int COMPARISON__THREE_WAY = 4; + + /** + * The number of structural features of the 'Comparison' class. + * + * + * @generated + * @ordered + */ + int COMPARISON_FEATURE_COUNT = 5; + + /** + * The meta object id for the '{@link org.eclipse.emf.compare.impl.MatchResourceImpl Match Resource}' class. + * + * + * @see org.eclipse.emf.compare.impl.MatchResourceImpl + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getMatchResource() + * @generated + */ + int MATCH_RESOURCE = 1; + + /** + * The feature id for the 'Left URI' attribute. + * + * + * @generated + * @ordered + */ + int MATCH_RESOURCE__LEFT_URI = 0; + + /** + * The feature id for the 'Right URI' attribute. + * + * + * @generated + * @ordered + */ + int MATCH_RESOURCE__RIGHT_URI = 1; + + /** + * The feature id for the 'Origin URI' attribute. + * + * + * @generated + * @ordered + */ + int MATCH_RESOURCE__ORIGIN_URI = 2; + + /** + * The feature id for the 'Left' attribute. + * + * + * @generated + * @ordered + */ + int MATCH_RESOURCE__LEFT = 3; + + /** + * The feature id for the 'Right' attribute. + * + * + * @generated + * @ordered + */ + int MATCH_RESOURCE__RIGHT = 4; + + /** + * The feature id for the 'Origin' attribute. + * + * + * @generated + * @ordered + */ + int MATCH_RESOURCE__ORIGIN = 5; + + /** + * The feature id for the 'Comparison' container reference. + * + * + * @generated + * @ordered + */ + int MATCH_RESOURCE__COMPARISON = 6; + + /** + * The number of structural features of the 'Match Resource' class. + * + * + * @generated + * @ordered + */ + int MATCH_RESOURCE_FEATURE_COUNT = 7; + + /** + * The meta object id for the '{@link org.eclipse.emf.compare.impl.MatchImpl Match}' class. + * + * + * @see org.eclipse.emf.compare.impl.MatchImpl + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getMatch() + * @generated + */ + int MATCH = 2; + + /** + * The feature id for the 'Submatches' containment reference list. + * + * + * @generated + * @ordered + */ + int MATCH__SUBMATCHES = 0; + + /** + * The feature id for the 'Differences' containment reference list. + * + * + * @generated + * @ordered + */ + int MATCH__DIFFERENCES = 1; + + /** + * The feature id for the 'Left' reference. + * + * + * @generated + * @ordered + */ + int MATCH__LEFT = 2; + + /** + * The feature id for the 'Right' reference. + * + * + * @generated + * @ordered + */ + int MATCH__RIGHT = 3; + + /** + * The feature id for the 'Origin' reference. + * + * + * @generated + * @ordered + */ + int MATCH__ORIGIN = 4; + + /** + * The number of structural features of the 'Match' class. + * + * + * @generated + * @ordered + */ + int MATCH_FEATURE_COUNT = 5; + + /** + * The meta object id for the '{@link org.eclipse.emf.compare.impl.DiffImpl Diff}' class. + * + * + * @see org.eclipse.emf.compare.impl.DiffImpl + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getDiff() + * @generated + */ + int DIFF = 3; + + /** + * The feature id for the 'Match' container reference. + * + * + * @generated + * @ordered + */ + int DIFF__MATCH = 0; + + /** + * The feature id for the 'Requires' reference list. + * + * + * @generated + * @ordered + */ + int DIFF__REQUIRES = 1; + + /** + * The feature id for the 'Required By' reference list. + * + * + * @generated + * @ordered + */ + int DIFF__REQUIRED_BY = 2; + + /** + * The feature id for the 'Refines' reference list. + * + * + * @generated + * @ordered + */ + int DIFF__REFINES = 3; + + /** + * The feature id for the 'Refined By' reference list. + * + * + * @generated + * @ordered + */ + int DIFF__REFINED_BY = 4; + + /** + * The feature id for the 'Kind' attribute. + * + * + * @generated + * @ordered + */ + int DIFF__KIND = 5; + + /** + * The feature id for the 'Source' attribute. + * + * + * @generated + * @ordered + */ + int DIFF__SOURCE = 6; + + /** + * The feature id for the 'State' attribute. + * + * + * @generated + * @ordered + */ + int DIFF__STATE = 7; + + /** + * The feature id for the 'Equivalence' reference. + * + * + * @generated + * @ordered + */ + int DIFF__EQUIVALENCE = 8; + + /** + * The feature id for the 'Conflict' reference. + * + * + * @generated + * @ordered + */ + int DIFF__CONFLICT = 9; + + /** + * The number of structural features of the 'Diff' class. + * + * + * @generated + * @ordered + */ + int DIFF_FEATURE_COUNT = 10; + + /** + * The meta object id for the '{@link org.eclipse.emf.compare.impl.ResourceAttachmentChangeImpl Resource Attachment Change}' class. + * + * + * @see org.eclipse.emf.compare.impl.ResourceAttachmentChangeImpl + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getResourceAttachmentChange() + * @generated + */ + int RESOURCE_ATTACHMENT_CHANGE = 4; + + /** + * The feature id for the 'Match' container reference. + * + * + * @generated + * @ordered + */ + int RESOURCE_ATTACHMENT_CHANGE__MATCH = DIFF__MATCH; + + /** + * The feature id for the 'Requires' reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE_ATTACHMENT_CHANGE__REQUIRES = DIFF__REQUIRES; + + /** + * The feature id for the 'Required By' reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE_ATTACHMENT_CHANGE__REQUIRED_BY = DIFF__REQUIRED_BY; + + /** + * The feature id for the 'Refines' reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE_ATTACHMENT_CHANGE__REFINES = DIFF__REFINES; + + /** + * The feature id for the 'Refined By' reference list. + * + * + * @generated + * @ordered + */ + int RESOURCE_ATTACHMENT_CHANGE__REFINED_BY = DIFF__REFINED_BY; + + /** + * The feature id for the 'Kind' attribute. + * + * + * @generated + * @ordered + */ + int RESOURCE_ATTACHMENT_CHANGE__KIND = DIFF__KIND; + + /** + * The feature id for the 'Source' attribute. + * + * + * @generated + * @ordered + */ + int RESOURCE_ATTACHMENT_CHANGE__SOURCE = DIFF__SOURCE; + + /** + * The feature id for the 'State' attribute. + * + * + * @generated + * @ordered + */ + int RESOURCE_ATTACHMENT_CHANGE__STATE = DIFF__STATE; + + /** + * The feature id for the 'Equivalence' reference. + * + * + * @generated + * @ordered + */ + int RESOURCE_ATTACHMENT_CHANGE__EQUIVALENCE = DIFF__EQUIVALENCE; + + /** + * The feature id for the 'Conflict' reference. + * + * + * @generated + * @ordered + */ + int RESOURCE_ATTACHMENT_CHANGE__CONFLICT = DIFF__CONFLICT; + + /** + * The feature id for the 'Resource URI' attribute. + * + * + * @generated + * @ordered + */ + int RESOURCE_ATTACHMENT_CHANGE__RESOURCE_URI = DIFF_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Resource Attachment Change' class. + * + * + * @generated + * @ordered + */ + int RESOURCE_ATTACHMENT_CHANGE_FEATURE_COUNT = DIFF_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.emf.compare.impl.ReferenceChangeImpl Reference Change}' class. + * + * + * @see org.eclipse.emf.compare.impl.ReferenceChangeImpl + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getReferenceChange() + * @generated + */ + int REFERENCE_CHANGE = 5; + + /** + * The feature id for the 'Match' container reference. + * + * + * @generated + * @ordered + */ + int REFERENCE_CHANGE__MATCH = DIFF__MATCH; + + /** + * The feature id for the 'Requires' reference list. + * + * + * @generated + * @ordered + */ + int REFERENCE_CHANGE__REQUIRES = DIFF__REQUIRES; + + /** + * The feature id for the 'Required By' reference list. + * + * + * @generated + * @ordered + */ + int REFERENCE_CHANGE__REQUIRED_BY = DIFF__REQUIRED_BY; + + /** + * The feature id for the 'Refines' reference list. + * + * + * @generated + * @ordered + */ + int REFERENCE_CHANGE__REFINES = DIFF__REFINES; + + /** + * The feature id for the 'Refined By' reference list. + * + * + * @generated + * @ordered + */ + int REFERENCE_CHANGE__REFINED_BY = DIFF__REFINED_BY; + + /** + * The feature id for the 'Kind' attribute. + * + * + * @generated + * @ordered + */ + int REFERENCE_CHANGE__KIND = DIFF__KIND; + + /** + * The feature id for the 'Source' attribute. + * + * + * @generated + * @ordered + */ + int REFERENCE_CHANGE__SOURCE = DIFF__SOURCE; + + /** + * The feature id for the 'State' attribute. + * + * + * @generated + * @ordered + */ + int REFERENCE_CHANGE__STATE = DIFF__STATE; + + /** + * The feature id for the 'Equivalence' reference. + * + * + * @generated + * @ordered + */ + int REFERENCE_CHANGE__EQUIVALENCE = DIFF__EQUIVALENCE; + + /** + * The feature id for the 'Conflict' reference. + * + * + * @generated + * @ordered + */ + int REFERENCE_CHANGE__CONFLICT = DIFF__CONFLICT; + + /** + * The feature id for the 'Reference' reference. + * + * + * @generated + * @ordered + */ + int REFERENCE_CHANGE__REFERENCE = DIFF_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Value' reference. + * + * + * @generated + * @ordered + */ + int REFERENCE_CHANGE__VALUE = DIFF_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Reference Change' class. + * + * + * @generated + * @ordered + */ + int REFERENCE_CHANGE_FEATURE_COUNT = DIFF_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.emf.compare.impl.AttributeChangeImpl Attribute Change}' class. + * + * + * @see org.eclipse.emf.compare.impl.AttributeChangeImpl + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getAttributeChange() + * @generated + */ + int ATTRIBUTE_CHANGE = 6; + + /** + * The feature id for the 'Match' container reference. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_CHANGE__MATCH = DIFF__MATCH; + + /** + * The feature id for the 'Requires' reference list. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_CHANGE__REQUIRES = DIFF__REQUIRES; + + /** + * The feature id for the 'Required By' reference list. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_CHANGE__REQUIRED_BY = DIFF__REQUIRED_BY; + + /** + * The feature id for the 'Refines' reference list. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_CHANGE__REFINES = DIFF__REFINES; + + /** + * The feature id for the 'Refined By' reference list. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_CHANGE__REFINED_BY = DIFF__REFINED_BY; + + /** + * The feature id for the 'Kind' attribute. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_CHANGE__KIND = DIFF__KIND; + + /** + * The feature id for the 'Source' attribute. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_CHANGE__SOURCE = DIFF__SOURCE; + + /** + * The feature id for the 'State' attribute. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_CHANGE__STATE = DIFF__STATE; + + /** + * The feature id for the 'Equivalence' reference. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_CHANGE__EQUIVALENCE = DIFF__EQUIVALENCE; + + /** + * The feature id for the 'Conflict' reference. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_CHANGE__CONFLICT = DIFF__CONFLICT; + + /** + * The feature id for the 'Attribute' reference. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_CHANGE__ATTRIBUTE = DIFF_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_CHANGE__VALUE = DIFF_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Attribute Change' class. + * + * + * @generated + * @ordered + */ + int ATTRIBUTE_CHANGE_FEATURE_COUNT = DIFF_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.emf.compare.impl.ConflictImpl Conflict}' class. + * + * + * @see org.eclipse.emf.compare.impl.ConflictImpl + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getConflict() + * @generated + */ + int CONFLICT = 7; + + /** + * The feature id for the 'Kind' attribute. + * + * + * @generated + * @ordered + */ + int CONFLICT__KIND = 0; + + /** + * The feature id for the 'Differences' reference list. + * + * + * @generated + * @ordered + */ + int CONFLICT__DIFFERENCES = 1; + + /** + * The number of structural features of the 'Conflict' class. + * + * + * @generated + * @ordered + */ + int CONFLICT_FEATURE_COUNT = 2; + + /** + * The meta object id for the '{@link org.eclipse.emf.compare.impl.EquivalenceImpl Equivalence}' class. + * + * + * @see org.eclipse.emf.compare.impl.EquivalenceImpl + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getEquivalence() + * @generated + */ + int EQUIVALENCE = 8; + + /** + * The feature id for the 'Differences' reference list. + * + * + * @generated + * @ordered + */ + int EQUIVALENCE__DIFFERENCES = 0; + + /** + * The number of structural features of the 'Equivalence' class. + * + * + * @generated + * @ordered + */ + int EQUIVALENCE_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link org.eclipse.emf.compare.DifferenceKind Difference Kind}' enum. + * + * + * @see org.eclipse.emf.compare.DifferenceKind + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getDifferenceKind() + * @generated + */ + int DIFFERENCE_KIND = 9; + + /** + * The meta object id for the '{@link org.eclipse.emf.compare.DifferenceSource Difference Source}' enum. + * + * + * @see org.eclipse.emf.compare.DifferenceSource + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getDifferenceSource() + * @generated + */ + int DIFFERENCE_SOURCE = 10; + + /** + * The meta object id for the '{@link org.eclipse.emf.compare.DifferenceState Difference State}' enum. + * + * + * @see org.eclipse.emf.compare.DifferenceState + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getDifferenceState() + * @generated + */ + int DIFFERENCE_STATE = 11; + + /** + * The meta object id for the '{@link org.eclipse.emf.compare.ConflictKind Conflict Kind}' enum. + * + * + * @see org.eclipse.emf.compare.ConflictKind + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getConflictKind() + * @generated + */ + int CONFLICT_KIND = 12; + + /** + * The meta object id for the 'EIterable' data type. + * + * + * @see java.lang.Iterable + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getEIterable() + * @generated + */ + int EITERABLE = 13; + + /** + * The meta object id for the 'IEquality Helper' data type. + * + * + * @see org.eclipse.emf.compare.utils.IEqualityHelper + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getIEqualityHelper() + * @generated + */ + int IEQUALITY_HELPER = 14; + + /** + * Returns the meta object for class '{@link org.eclipse.emf.compare.Comparison Comparison}'. + * + * + * @return the meta object for class 'Comparison'. + * @see org.eclipse.emf.compare.Comparison + * @generated + */ + EClass getComparison(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.emf.compare.Comparison#getMatchedResources Matched Resources}'. + * + * + * @return the meta object for the containment reference list 'Matched Resources'. + * @see org.eclipse.emf.compare.Comparison#getMatchedResources() + * @see #getComparison() + * @generated + */ + EReference getComparison_MatchedResources(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.emf.compare.Comparison#getMatches Matches}'. + * + * + * @return the meta object for the containment reference list 'Matches'. + * @see org.eclipse.emf.compare.Comparison#getMatches() + * @see #getComparison() + * @generated + */ + EReference getComparison_Matches(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.emf.compare.Comparison#getConflicts Conflicts}'. + * + * + * @return the meta object for the containment reference list 'Conflicts'. + * @see org.eclipse.emf.compare.Comparison#getConflicts() + * @see #getComparison() + * @generated + */ + EReference getComparison_Conflicts(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.emf.compare.Comparison#getEquivalences Equivalences}'. + * + * + * @return the meta object for the containment reference list 'Equivalences'. + * @see org.eclipse.emf.compare.Comparison#getEquivalences() + * @see #getComparison() + * @generated + */ + EReference getComparison_Equivalences(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.Comparison#isThreeWay Three Way}'. + * + * + * @return the meta object for the attribute 'Three Way'. + * @see org.eclipse.emf.compare.Comparison#isThreeWay() + * @see #getComparison() + * @generated + */ + EAttribute getComparison_ThreeWay(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.compare.MatchResource Match Resource}'. + * + * + * @return the meta object for class 'Match Resource'. + * @see org.eclipse.emf.compare.MatchResource + * @generated + */ + EClass getMatchResource(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.MatchResource#getLeftURI Left URI}'. + * + * + * @return the meta object for the attribute 'Left URI'. + * @see org.eclipse.emf.compare.MatchResource#getLeftURI() + * @see #getMatchResource() + * @generated + */ + EAttribute getMatchResource_LeftURI(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.MatchResource#getRightURI Right URI}'. + * + * + * @return the meta object for the attribute 'Right URI'. + * @see org.eclipse.emf.compare.MatchResource#getRightURI() + * @see #getMatchResource() + * @generated + */ + EAttribute getMatchResource_RightURI(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.MatchResource#getOriginURI Origin URI}'. + * + * + * @return the meta object for the attribute 'Origin URI'. + * @see org.eclipse.emf.compare.MatchResource#getOriginURI() + * @see #getMatchResource() + * @generated + */ + EAttribute getMatchResource_OriginURI(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.MatchResource#getLeft Left}'. + * + * + * @return the meta object for the attribute 'Left'. + * @see org.eclipse.emf.compare.MatchResource#getLeft() + * @see #getMatchResource() + * @generated + */ + EAttribute getMatchResource_Left(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.MatchResource#getRight Right}'. + * + * + * @return the meta object for the attribute 'Right'. + * @see org.eclipse.emf.compare.MatchResource#getRight() + * @see #getMatchResource() + * @generated + */ + EAttribute getMatchResource_Right(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.MatchResource#getOrigin Origin}'. + * + * + * @return the meta object for the attribute 'Origin'. + * @see org.eclipse.emf.compare.MatchResource#getOrigin() + * @see #getMatchResource() + * @generated + */ + EAttribute getMatchResource_Origin(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.emf.compare.MatchResource#getComparison Comparison}'. + * + * + * @return the meta object for the container reference 'Comparison'. + * @see org.eclipse.emf.compare.MatchResource#getComparison() + * @see #getMatchResource() + * @generated + */ + EReference getMatchResource_Comparison(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.compare.Match Match}'. + * + * + * @return the meta object for class 'Match'. + * @see org.eclipse.emf.compare.Match + * @generated + */ + EClass getMatch(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.emf.compare.Match#getSubmatches Submatches}'. + * + * + * @return the meta object for the containment reference list 'Submatches'. + * @see org.eclipse.emf.compare.Match#getSubmatches() + * @see #getMatch() + * @generated + */ + EReference getMatch_Submatches(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.emf.compare.Match#getDifferences Differences}'. + * + * + * @return the meta object for the containment reference list 'Differences'. + * @see org.eclipse.emf.compare.Match#getDifferences() + * @see #getMatch() + * @generated + */ + EReference getMatch_Differences(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.compare.Match#getLeft Left}'. + * + * + * @return the meta object for the reference 'Left'. + * @see org.eclipse.emf.compare.Match#getLeft() + * @see #getMatch() + * @generated + */ + EReference getMatch_Left(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.compare.Match#getRight Right}'. + * + * + * @return the meta object for the reference 'Right'. + * @see org.eclipse.emf.compare.Match#getRight() + * @see #getMatch() + * @generated + */ + EReference getMatch_Right(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.compare.Match#getOrigin Origin}'. + * + * + * @return the meta object for the reference 'Origin'. + * @see org.eclipse.emf.compare.Match#getOrigin() + * @see #getMatch() + * @generated + */ + EReference getMatch_Origin(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.compare.Diff Diff}'. + * + * + * @return the meta object for class 'Diff'. + * @see org.eclipse.emf.compare.Diff + * @generated + */ + EClass getDiff(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.emf.compare.Diff#getMatch Match}'. + * + * + * @return the meta object for the container reference 'Match'. + * @see org.eclipse.emf.compare.Diff#getMatch() + * @see #getDiff() + * @generated + */ + EReference getDiff_Match(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.emf.compare.Diff#getRequires Requires}'. + * + * + * @return the meta object for the reference list 'Requires'. + * @see org.eclipse.emf.compare.Diff#getRequires() + * @see #getDiff() + * @generated + */ + EReference getDiff_Requires(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.emf.compare.Diff#getRequiredBy Required By}'. + * + * + * @return the meta object for the reference list 'Required By'. + * @see org.eclipse.emf.compare.Diff#getRequiredBy() + * @see #getDiff() + * @generated + */ + EReference getDiff_RequiredBy(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.emf.compare.Diff#getRefines Refines}'. + * + * + * @return the meta object for the reference list 'Refines'. + * @see org.eclipse.emf.compare.Diff#getRefines() + * @see #getDiff() + * @generated + */ + EReference getDiff_Refines(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.emf.compare.Diff#getRefinedBy Refined By}'. + * + * + * @return the meta object for the reference list 'Refined By'. + * @see org.eclipse.emf.compare.Diff#getRefinedBy() + * @see #getDiff() + * @generated + */ + EReference getDiff_RefinedBy(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.Diff#getKind Kind}'. + * + * + * @return the meta object for the attribute 'Kind'. + * @see org.eclipse.emf.compare.Diff#getKind() + * @see #getDiff() + * @generated + */ + EAttribute getDiff_Kind(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.Diff#getSource Source}'. + * + * + * @return the meta object for the attribute 'Source'. + * @see org.eclipse.emf.compare.Diff#getSource() + * @see #getDiff() + * @generated + */ + EAttribute getDiff_Source(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.Diff#getState State}'. + * + * + * @return the meta object for the attribute 'State'. + * @see org.eclipse.emf.compare.Diff#getState() + * @see #getDiff() + * @generated + */ + EAttribute getDiff_State(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.compare.Diff#getEquivalence Equivalence}'. + * + * + * @return the meta object for the reference 'Equivalence'. + * @see org.eclipse.emf.compare.Diff#getEquivalence() + * @see #getDiff() + * @generated + */ + EReference getDiff_Equivalence(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.compare.Diff#getConflict Conflict}'. + * + * + * @return the meta object for the reference 'Conflict'. + * @see org.eclipse.emf.compare.Diff#getConflict() + * @see #getDiff() + * @generated + */ + EReference getDiff_Conflict(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.compare.ResourceAttachmentChange Resource Attachment Change}'. + * + * + * @return the meta object for class 'Resource Attachment Change'. + * @see org.eclipse.emf.compare.ResourceAttachmentChange + * @generated + */ + EClass getResourceAttachmentChange(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.ResourceAttachmentChange#getResourceURI Resource URI}'. + * + * + * @return the meta object for the attribute 'Resource URI'. + * @see org.eclipse.emf.compare.ResourceAttachmentChange#getResourceURI() + * @see #getResourceAttachmentChange() + * @generated + */ + EAttribute getResourceAttachmentChange_ResourceURI(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.compare.ReferenceChange Reference Change}'. + * + * + * @return the meta object for class 'Reference Change'. + * @see org.eclipse.emf.compare.ReferenceChange + * @generated + */ + EClass getReferenceChange(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.compare.ReferenceChange#getReference Reference}'. + * + * + * @return the meta object for the reference 'Reference'. + * @see org.eclipse.emf.compare.ReferenceChange#getReference() + * @see #getReferenceChange() + * @generated + */ + EReference getReferenceChange_Reference(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.compare.ReferenceChange#getValue Value}'. + * + * + * @return the meta object for the reference 'Value'. + * @see org.eclipse.emf.compare.ReferenceChange#getValue() + * @see #getReferenceChange() + * @generated + */ + EReference getReferenceChange_Value(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.compare.AttributeChange Attribute Change}'. + * + * + * @return the meta object for class 'Attribute Change'. + * @see org.eclipse.emf.compare.AttributeChange + * @generated + */ + EClass getAttributeChange(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.emf.compare.AttributeChange#getAttribute Attribute}'. + * + * + * @return the meta object for the reference 'Attribute'. + * @see org.eclipse.emf.compare.AttributeChange#getAttribute() + * @see #getAttributeChange() + * @generated + */ + EReference getAttributeChange_Attribute(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.AttributeChange#getValue Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see org.eclipse.emf.compare.AttributeChange#getValue() + * @see #getAttributeChange() + * @generated + */ + EAttribute getAttributeChange_Value(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.compare.Conflict Conflict}'. + * + * + * @return the meta object for class 'Conflict'. + * @see org.eclipse.emf.compare.Conflict + * @generated + */ + EClass getConflict(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.Conflict#getKind Kind}'. + * + * + * @return the meta object for the attribute 'Kind'. + * @see org.eclipse.emf.compare.Conflict#getKind() + * @see #getConflict() + * @generated + */ + EAttribute getConflict_Kind(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.emf.compare.Conflict#getDifferences Differences}'. + * + * + * @return the meta object for the reference list 'Differences'. + * @see org.eclipse.emf.compare.Conflict#getDifferences() + * @see #getConflict() + * @generated + */ + EReference getConflict_Differences(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.compare.Equivalence Equivalence}'. + * + * + * @return the meta object for class 'Equivalence'. + * @see org.eclipse.emf.compare.Equivalence + * @generated + */ + EClass getEquivalence(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.emf.compare.Equivalence#getDifferences Differences}'. + * + * + * @return the meta object for the reference list 'Differences'. + * @see org.eclipse.emf.compare.Equivalence#getDifferences() + * @see #getEquivalence() + * @generated + */ + EReference getEquivalence_Differences(); + + /** + * Returns the meta object for enum '{@link org.eclipse.emf.compare.DifferenceKind Difference Kind}'. + * + * + * @return the meta object for enum 'Difference Kind'. + * @see org.eclipse.emf.compare.DifferenceKind + * @generated + */ + EEnum getDifferenceKind(); + + /** + * Returns the meta object for enum '{@link org.eclipse.emf.compare.DifferenceSource Difference Source}'. + * + * + * @return the meta object for enum 'Difference Source'. + * @see org.eclipse.emf.compare.DifferenceSource + * @generated + */ + EEnum getDifferenceSource(); + + /** + * Returns the meta object for enum '{@link org.eclipse.emf.compare.DifferenceState Difference State}'. + * + * + * @return the meta object for enum 'Difference State'. + * @see org.eclipse.emf.compare.DifferenceState + * @generated + */ + EEnum getDifferenceState(); + + /** + * Returns the meta object for enum '{@link org.eclipse.emf.compare.ConflictKind Conflict Kind}'. + * + * + * @return the meta object for enum 'Conflict Kind'. + * @see org.eclipse.emf.compare.ConflictKind + * @generated + */ + EEnum getConflictKind(); + + /** + * Returns the meta object for data type '{@link java.lang.Iterable EIterable}'. + * + * + * @return the meta object for data type 'EIterable'. + * @see java.lang.Iterable + * @model instanceClass="java.lang.Iterable" typeParameters="T" + * @generated + */ + EDataType getEIterable(); + + /** + * Returns the meta object for data type '{@link org.eclipse.emf.compare.utils.IEqualityHelper IEquality Helper}'. + * + * + * @return the meta object for data type 'IEquality Helper'. + * @see org.eclipse.emf.compare.utils.IEqualityHelper + * @model instanceClass="org.eclipse.emf.compare.utils.IEqualityHelper" serializeable="false" + * @generated + */ + EDataType getIEqualityHelper(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + CompareFactory getCompareFactory(); + + /** + * + * Defines literals for the meta objects that represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @generated + */ + @SuppressWarnings("hiding") + // generated code, removing warnings + interface Literals { + /** + * The meta object literal for the '{@link org.eclipse.emf.compare.impl.ComparisonImpl Comparison}' class. + * + * + * @see org.eclipse.emf.compare.impl.ComparisonImpl + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getComparison() + * @generated + */ + EClass COMPARISON = eINSTANCE.getComparison(); + + /** + * The meta object literal for the 'Matched Resources' containment reference list feature. + * + * + * @generated + */ + EReference COMPARISON__MATCHED_RESOURCES = eINSTANCE.getComparison_MatchedResources(); + + /** + * The meta object literal for the 'Matches' containment reference list feature. + * + * + * @generated + */ + EReference COMPARISON__MATCHES = eINSTANCE.getComparison_Matches(); + + /** + * The meta object literal for the 'Conflicts' containment reference list feature. + * + * + * @generated + */ + EReference COMPARISON__CONFLICTS = eINSTANCE.getComparison_Conflicts(); + + /** + * The meta object literal for the 'Equivalences' containment reference list feature. + * + * + * @generated + */ + EReference COMPARISON__EQUIVALENCES = eINSTANCE.getComparison_Equivalences(); + + /** + * The meta object literal for the 'Three Way' attribute feature. + * + * + * @generated + */ + EAttribute COMPARISON__THREE_WAY = eINSTANCE.getComparison_ThreeWay(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.compare.impl.MatchResourceImpl Match Resource}' class. + * + * + * @see org.eclipse.emf.compare.impl.MatchResourceImpl + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getMatchResource() + * @generated + */ + EClass MATCH_RESOURCE = eINSTANCE.getMatchResource(); + + /** + * The meta object literal for the 'Left URI' attribute feature. + * + * + * @generated + */ + EAttribute MATCH_RESOURCE__LEFT_URI = eINSTANCE.getMatchResource_LeftURI(); + + /** + * The meta object literal for the 'Right URI' attribute feature. + * + * + * @generated + */ + EAttribute MATCH_RESOURCE__RIGHT_URI = eINSTANCE.getMatchResource_RightURI(); + + /** + * The meta object literal for the 'Origin URI' attribute feature. + * + * + * @generated + */ + EAttribute MATCH_RESOURCE__ORIGIN_URI = eINSTANCE.getMatchResource_OriginURI(); + + /** + * The meta object literal for the 'Left' attribute feature. + * + * + * @generated + */ + EAttribute MATCH_RESOURCE__LEFT = eINSTANCE.getMatchResource_Left(); + + /** + * The meta object literal for the 'Right' attribute feature. + * + * + * @generated + */ + EAttribute MATCH_RESOURCE__RIGHT = eINSTANCE.getMatchResource_Right(); + + /** + * The meta object literal for the 'Origin' attribute feature. + * + * + * @generated + */ + EAttribute MATCH_RESOURCE__ORIGIN = eINSTANCE.getMatchResource_Origin(); + + /** + * The meta object literal for the 'Comparison' container reference feature. + * + * + * @generated + */ + EReference MATCH_RESOURCE__COMPARISON = eINSTANCE.getMatchResource_Comparison(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.compare.impl.MatchImpl Match}' class. + * + * + * @see org.eclipse.emf.compare.impl.MatchImpl + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getMatch() + * @generated + */ + EClass MATCH = eINSTANCE.getMatch(); + + /** + * The meta object literal for the 'Submatches' containment reference list feature. + * + * + * @generated + */ + EReference MATCH__SUBMATCHES = eINSTANCE.getMatch_Submatches(); + + /** + * The meta object literal for the 'Differences' containment reference list feature. + * + * + * @generated + */ + EReference MATCH__DIFFERENCES = eINSTANCE.getMatch_Differences(); + + /** + * The meta object literal for the 'Left' reference feature. + * + * + * @generated + */ + EReference MATCH__LEFT = eINSTANCE.getMatch_Left(); + + /** + * The meta object literal for the 'Right' reference feature. + * + * + * @generated + */ + EReference MATCH__RIGHT = eINSTANCE.getMatch_Right(); + + /** + * The meta object literal for the 'Origin' reference feature. + * + * + * @generated + */ + EReference MATCH__ORIGIN = eINSTANCE.getMatch_Origin(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.compare.impl.DiffImpl Diff}' class. + * + * + * @see org.eclipse.emf.compare.impl.DiffImpl + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getDiff() + * @generated + */ + EClass DIFF = eINSTANCE.getDiff(); + + /** + * The meta object literal for the 'Match' container reference feature. + * + * + * @generated + */ + EReference DIFF__MATCH = eINSTANCE.getDiff_Match(); + + /** + * The meta object literal for the 'Requires' reference list feature. + * + * + * @generated + */ + EReference DIFF__REQUIRES = eINSTANCE.getDiff_Requires(); + + /** + * The meta object literal for the 'Required By' reference list feature. + * + * + * @generated + */ + EReference DIFF__REQUIRED_BY = eINSTANCE.getDiff_RequiredBy(); + + /** + * The meta object literal for the 'Refines' reference list feature. + * + * + * @generated + */ + EReference DIFF__REFINES = eINSTANCE.getDiff_Refines(); + + /** + * The meta object literal for the 'Refined By' reference list feature. + * + * + * @generated + */ + EReference DIFF__REFINED_BY = eINSTANCE.getDiff_RefinedBy(); + + /** + * The meta object literal for the 'Kind' attribute feature. + * + * + * @generated + */ + EAttribute DIFF__KIND = eINSTANCE.getDiff_Kind(); + + /** + * The meta object literal for the 'Source' attribute feature. + * + * + * @generated + */ + EAttribute DIFF__SOURCE = eINSTANCE.getDiff_Source(); + + /** + * The meta object literal for the 'State' attribute feature. + * + * + * @generated + */ + EAttribute DIFF__STATE = eINSTANCE.getDiff_State(); + + /** + * The meta object literal for the 'Equivalence' reference feature. + * + * + * @generated + */ + EReference DIFF__EQUIVALENCE = eINSTANCE.getDiff_Equivalence(); + + /** + * The meta object literal for the 'Conflict' reference feature. + * + * + * @generated + */ + EReference DIFF__CONFLICT = eINSTANCE.getDiff_Conflict(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.compare.impl.ResourceAttachmentChangeImpl Resource Attachment Change}' class. + * + * + * @see org.eclipse.emf.compare.impl.ResourceAttachmentChangeImpl + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getResourceAttachmentChange() + * @generated + */ + EClass RESOURCE_ATTACHMENT_CHANGE = eINSTANCE.getResourceAttachmentChange(); + + /** + * The meta object literal for the 'Resource URI' attribute feature. + * + * + * @generated + */ + EAttribute RESOURCE_ATTACHMENT_CHANGE__RESOURCE_URI = eINSTANCE + .getResourceAttachmentChange_ResourceURI(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.compare.impl.ReferenceChangeImpl Reference Change}' class. + * + * + * @see org.eclipse.emf.compare.impl.ReferenceChangeImpl + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getReferenceChange() + * @generated + */ + EClass REFERENCE_CHANGE = eINSTANCE.getReferenceChange(); + + /** + * The meta object literal for the 'Reference' reference feature. + * + * + * @generated + */ + EReference REFERENCE_CHANGE__REFERENCE = eINSTANCE.getReferenceChange_Reference(); + + /** + * The meta object literal for the 'Value' reference feature. + * + * + * @generated + */ + EReference REFERENCE_CHANGE__VALUE = eINSTANCE.getReferenceChange_Value(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.compare.impl.AttributeChangeImpl Attribute Change}' class. + * + * + * @see org.eclipse.emf.compare.impl.AttributeChangeImpl + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getAttributeChange() + * @generated + */ + EClass ATTRIBUTE_CHANGE = eINSTANCE.getAttributeChange(); + + /** + * The meta object literal for the 'Attribute' reference feature. + * + * + * @generated + */ + EReference ATTRIBUTE_CHANGE__ATTRIBUTE = eINSTANCE.getAttributeChange_Attribute(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute ATTRIBUTE_CHANGE__VALUE = eINSTANCE.getAttributeChange_Value(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.compare.impl.ConflictImpl Conflict}' class. + * + * + * @see org.eclipse.emf.compare.impl.ConflictImpl + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getConflict() + * @generated + */ + EClass CONFLICT = eINSTANCE.getConflict(); + + /** + * The meta object literal for the 'Kind' attribute feature. + * + * + * @generated + */ + EAttribute CONFLICT__KIND = eINSTANCE.getConflict_Kind(); + + /** + * The meta object literal for the 'Differences' reference list feature. + * + * + * @generated + */ + EReference CONFLICT__DIFFERENCES = eINSTANCE.getConflict_Differences(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.compare.impl.EquivalenceImpl Equivalence}' class. + * + * + * @see org.eclipse.emf.compare.impl.EquivalenceImpl + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getEquivalence() + * @generated + */ + EClass EQUIVALENCE = eINSTANCE.getEquivalence(); + + /** + * The meta object literal for the 'Differences' reference list feature. + * + * + * @generated + */ + EReference EQUIVALENCE__DIFFERENCES = eINSTANCE.getEquivalence_Differences(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.compare.DifferenceKind Difference Kind}' enum. + * + * + * @see org.eclipse.emf.compare.DifferenceKind + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getDifferenceKind() + * @generated + */ + EEnum DIFFERENCE_KIND = eINSTANCE.getDifferenceKind(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.compare.DifferenceSource Difference Source}' enum. + * + * + * @see org.eclipse.emf.compare.DifferenceSource + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getDifferenceSource() + * @generated + */ + EEnum DIFFERENCE_SOURCE = eINSTANCE.getDifferenceSource(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.compare.DifferenceState Difference State}' enum. + * + * + * @see org.eclipse.emf.compare.DifferenceState + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getDifferenceState() + * @generated + */ + EEnum DIFFERENCE_STATE = eINSTANCE.getDifferenceState(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.compare.ConflictKind Conflict Kind}' enum. + * + * + * @see org.eclipse.emf.compare.ConflictKind + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getConflictKind() + * @generated + */ + EEnum CONFLICT_KIND = eINSTANCE.getConflictKind(); + + /** + * The meta object literal for the 'EIterable' data type. + * + * + * @see java.lang.Iterable + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getEIterable() + * @generated + */ + EDataType EITERABLE = eINSTANCE.getEIterable(); + + /** + * The meta object literal for the 'IEquality Helper' data type. + * + * + * @see org.eclipse.emf.compare.utils.IEqualityHelper + * @see org.eclipse.emf.compare.impl.ComparePackageImpl#getIEqualityHelper() + * @generated + */ + EDataType IEQUALITY_HELPER = eINSTANCE.getIEqualityHelper(); + + } + +} //ComparePackage diff --git a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/Comparison.java b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/Comparison.java index 37c811e89..526b70d2a 100644 --- a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/Comparison.java +++ b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/Comparison.java @@ -1,170 +1,167 @@ -/** - * 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; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.compare.utils.IEqualityHelper; -import org.eclipse.emf.ecore.EObject; - -/** - * A representation of the model object 'Comparison'. This will act as the "root" of a comparison. It will reference - * one match for every root of the input models, along with the differences detected for each of them. - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.emf.compare.Comparison#getMatchedResources Matched Resources}
  • - *
  • {@link org.eclipse.emf.compare.Comparison#getMatches Matches}
  • - *
  • {@link org.eclipse.emf.compare.Comparison#getConflicts Conflicts}
  • - *
  • {@link org.eclipse.emf.compare.Comparison#getEquivalences Equivalences}
  • - *
  • {@link org.eclipse.emf.compare.Comparison#isThreeWay Three Way}
  • - *
- *

- * - * @see org.eclipse.emf.compare.ComparePackage#getComparison() - * @model - * @generated - */ -public interface Comparison extends EObject { - /** - * - * - * @generated - */ - 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$ - - /** - * Returns the value of the 'Matched Resources' containment reference list. The list - * contents are of type {@link org.eclipse.emf.compare.MatchResource}. This contains the mappings for each compared Resource. - * - * @return the value of the 'Matched Resources' containment reference list. - * @see org.eclipse.emf.compare.ComparePackage#getComparison_MatchedResources() - * @model containment="true" - * @generated - */ - EList getMatchedResources(); - - /** - * Returns the value of the 'Matches' containment reference list. The list contents are of - * type {@link org.eclipse.emf.compare.Match}. This contains the match tree "mimicking" the input models' hierarchy. - * - * @return the value of the 'Matches' containment reference list. - * @see org.eclipse.emf.compare.ComparePackage#getComparison_Matches() - * @model containment="true" - * @generated - */ - EList getMatches(); - - /** - * Returns the value of the 'Conflicts' containment reference list. The list contents are - * of type {@link org.eclipse.emf.compare.Conflict}. If we detected any conflict during the comparison process, this will contain them. - * - * - * @return the value of the 'Conflicts' containment reference list. - * @see org.eclipse.emf.compare.ComparePackage#getComparison_Conflicts() - * @model containment="true" - * @generated - */ - EList getConflicts(); - - /** - * Returns the value of the 'Equivalences' containment reference list. The list contents - * are of type {@link org.eclipse.emf.compare.Equivalence}. - * If we detected any equivalence between diffs during the comparison process, - * this will contain them. - * - * @return the value of the 'Equivalences' containment reference list. - * @see org.eclipse.emf.compare.ComparePackage#getComparison_Equivalences() - * @model containment="true" - * @generated - */ - EList getEquivalences(); - - /** - * Returns all differences - * contained by this Comparison and its children. - * - * @model kind="operation" - * @generated - */ - EList getDifferences(); - - /** - * Returns all differences that - * reference the given EObject (for instance, all ReferenceChanges that reference the given EObject - * through the "value" EReference). - *

- * 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 getDifferences(EObject element); - - /** - * Finds and return the Match for - * the given EObject. - * - * @param element - * The EObject for which we seek the match. - * @model - * @generated - */ - Match getMatch(EObject element); - - /** - * - * - * @model kind="operation" dataType="org.eclipse.emf.compare.IEqualityHelper" - * @generated - */ - IEqualityHelper getEqualityHelper(); - - /** - * Returns the value of the 'Three Way' attribute. - * - * @return the value of the 'Three Way' attribute. - * @see #setThreeWay(boolean) - * @see org.eclipse.emf.compare.ComparePackage#getComparison_ThreeWay() - * @model - * @generated - */ - boolean isThreeWay(); - - /** - * Sets the value of the '{@link org.eclipse.emf.compare.Comparison#isThreeWay Three Way}' - * attribute. - * - * @param value - * the new value of the 'Three Way' attribute. - * @see #isThreeWay() - * @generated - */ - void setThreeWay(boolean value); - -} // Comparison +/** + * 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; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.compare.utils.IEqualityHelper; +import org.eclipse.emf.ecore.EObject; + +/** + * A representation of the model object 'Comparison'. This will act as the "root" of a comparison. It will reference + * one match for every root of the input models, along with the differences detected for each of them. + *

+ * The following features are supported: + *

    + *
  • {@link org.eclipse.emf.compare.Comparison#getMatchedResources Matched Resources}
  • + *
  • {@link org.eclipse.emf.compare.Comparison#getMatches Matches}
  • + *
  • {@link org.eclipse.emf.compare.Comparison#getConflicts Conflicts}
  • + *
  • {@link org.eclipse.emf.compare.Comparison#getEquivalences Equivalences}
  • + *
  • {@link org.eclipse.emf.compare.Comparison#isThreeWay Three Way}
  • + *
+ *

+ * + * @see org.eclipse.emf.compare.ComparePackage#getComparison() + * @model + * @generated + */ +public interface Comparison extends EObject { + /** + * + * @generated + */ + 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$ + + /** + * Returns the value of the 'Matched Resources' containment reference list. The list + * contents are of type {@link org.eclipse.emf.compare.MatchResource}. This contains the mappings for each compared Resource. + * + * @return the value of the 'Matched Resources' containment reference list. + * @see org.eclipse.emf.compare.ComparePackage#getComparison_MatchedResources() + * @model containment="true" + * @generated + */ + EList getMatchedResources(); + + /** + * Returns the value of the 'Matches' containment reference list. The list contents are of + * type {@link org.eclipse.emf.compare.Match}. This contains the match tree "mimicking" the input models' hierarchy. + * + * @return the value of the 'Matches' containment reference list. + * @see org.eclipse.emf.compare.ComparePackage#getComparison_Matches() + * @model containment="true" + * @generated + */ + EList getMatches(); + + /** + * Returns the value of the 'Conflicts' containment reference list. The list contents are + * of type {@link org.eclipse.emf.compare.Conflict}. If we detected any conflict during the comparison process, this will contain them. + * + * + * @return the value of the 'Conflicts' containment reference list. + * @see org.eclipse.emf.compare.ComparePackage#getComparison_Conflicts() + * @model containment="true" + * @generated + */ + EList getConflicts(); + + /** + * Returns the value of the 'Equivalences' containment reference list. + * The list contents are of type {@link org.eclipse.emf.compare.Equivalence}. + * + * + * If we detected any equivalence between diffs during the comparison process, this will contain them. + * + * @return the value of the 'Equivalences' containment reference list. + * @see org.eclipse.emf.compare.ComparePackage#getComparison_Equivalences() + * @model containment="true" + * @generated + */ + EList getEquivalences(); + + /** + * Returns all differences + * contained by this Comparison and its children. + * + * @model kind="operation" + * @generated + */ + EList getDifferences(); + + /** + * Returns all differences that + * reference the given EObject (for instance, all ReferenceChanges that reference the given EObject + * through the "value" EReference). + *

+ * 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 getDifferences(EObject element); + + /** + * Finds and return the Match for + * the given EObject. + * + * @param element + * The EObject for which we seek the match. + * @model + * @generated + */ + Match getMatch(EObject element); + + /** + * + * @model kind="operation" dataType="org.eclipse.emf.compare.IEqualityHelper" + * @generated + */ + IEqualityHelper getEqualityHelper(); + + /** + * Returns the value of the 'Three Way' attribute. + * + * @return the value of the 'Three Way' attribute. + * @see #setThreeWay(boolean) + * @see org.eclipse.emf.compare.ComparePackage#getComparison_ThreeWay() + * @model + * @generated + */ + boolean isThreeWay(); + + /** + * Sets the value of the '{@link org.eclipse.emf.compare.Comparison#isThreeWay Three Way}' attribute. + * + * @param value the new value of the 'Three Way' attribute. + * @see #isThreeWay() + * @generated + */ + void setThreeWay(boolean value); + +} // Comparison diff --git a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/MatchResource.java b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/MatchResource.java index cfee0875c..44a441494 100644 --- a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/MatchResource.java +++ b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/MatchResource.java @@ -1,199 +1,228 @@ -/** - * 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; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; - -/** - * - * A representation of the model object 'Match Resource'. - * - * - * - * A MatchResource element represents the mapping between two or three resources : left, right, and their optional common ancestor. The resource will be identified through its URI. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.emf.compare.MatchResource#getLeftURI Left URI}
  • - *
  • {@link org.eclipse.emf.compare.MatchResource#getRightURI Right URI}
  • - *
  • {@link org.eclipse.emf.compare.MatchResource#getOriginURI Origin URI}
  • - *
  • {@link org.eclipse.emf.compare.MatchResource#getLeft Left}
  • - *
  • {@link org.eclipse.emf.compare.MatchResource#getRight Right}
  • - *
  • {@link org.eclipse.emf.compare.MatchResource#getOrigin Origin}
  • - *
- *

- * - * @see org.eclipse.emf.compare.ComparePackage#getMatchResource() - * @model - * @generated - */ -public interface MatchResource extends EObject { - /** - * - * - * @generated - */ - 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$ - - /** - * Returns the value of the 'Left URI' attribute. - * - * - * - * Cannot be null. Represents the URI of the left resource of this mapping. - * - * @return the value of the 'Left URI' attribute. - * @see #setLeftURI(String) - * @see org.eclipse.emf.compare.ComparePackage#getMatchResource_LeftURI() - * @model required="true" - * @generated - */ - String getLeftURI(); - - /** - * Sets the value of the '{@link org.eclipse.emf.compare.MatchResource#getLeftURI Left URI}' attribute. - * - * - * @param value the new value of the 'Left URI' attribute. - * @see #getLeftURI() - * @generated - */ - void setLeftURI(String value); - - /** - * Returns the value of the 'Right URI' attribute. - * - * - * - * Cannot be null. Represents the URI of the right resource of this mapping. - * - * @return the value of the 'Right URI' attribute. - * @see #setRightURI(String) - * @see org.eclipse.emf.compare.ComparePackage#getMatchResource_RightURI() - * @model required="true" - * @generated - */ - String getRightURI(); - - /** - * Sets the value of the '{@link org.eclipse.emf.compare.MatchResource#getRightURI Right URI}' attribute. - * - * - * @param value the new value of the 'Right URI' attribute. - * @see #getRightURI() - * @generated - */ - void setRightURI(String value); - - /** - * Returns the value of the 'Origin URI' attribute. - * - * - * - * This can be null in the case of two-way comparisons. If assigned, it will represent the URI of the origin resource for this mapping; the common ancestor of both others. - * - * @return the value of the 'Origin URI' attribute. - * @see #setOriginURI(String) - * @see org.eclipse.emf.compare.ComparePackage#getMatchResource_OriginURI() - * @model - * @generated - */ - String getOriginURI(); - - /** - * Sets the value of the '{@link org.eclipse.emf.compare.MatchResource#getOriginURI Origin URI}' attribute. - * - * - * @param value the new value of the 'Origin URI' attribute. - * @see #getOriginURI() - * @generated - */ - void setOriginURI(String value); - - /** - * Returns the value of the 'Left' attribute. - * - * - * - * Keeps a reference towards the left Resource of this Match. Might be null if this is a Comparison we have re-loaded from its serialized form and the left EResource could not be loaded. - * - * @return the value of the 'Left' attribute. - * @see #setLeft(Resource) - * @see org.eclipse.emf.compare.ComparePackage#getMatchResource_Left() - * @model transient="true" - * @generated - */ - Resource getLeft(); - - /** - * Sets the value of the '{@link org.eclipse.emf.compare.MatchResource#getLeft Left}' attribute. - * - * - * @param value the new value of the 'Left' attribute. - * @see #getLeft() - * @generated - */ - void setLeft(Resource value); - - /** - * Returns the value of the 'Right' attribute. - * - * - * - * Keeps a reference towards the right Resource of this Match. Might be null if this is a Comparison we have re-loaded from its serialized form and the right EResource could not be loaded. - * - * @return the value of the 'Right' attribute. - * @see #setRight(Resource) - * @see org.eclipse.emf.compare.ComparePackage#getMatchResource_Right() - * @model transient="true" - * @generated - */ - Resource getRight(); - - /** - * Sets the value of the '{@link org.eclipse.emf.compare.MatchResource#getRight Right}' attribute. - * - * - * @param value the new value of the 'Right' attribute. - * @see #getRight() - * @generated - */ - void setRight(Resource value); - - /** - * Returns the value of the 'Origin' attribute. - * - * - * - * Keeps a reference towards the origin Resource of this Match. Might be null if this is a Comparison we have re-loaded from its serialized form and the origin EResource could not be loaded. - * - * @return the value of the 'Origin' attribute. - * @see #setOrigin(Resource) - * @see org.eclipse.emf.compare.ComparePackage#getMatchResource_Origin() - * @model transient="true" - * @generated - */ - Resource getOrigin(); - - /** - * Sets the value of the '{@link org.eclipse.emf.compare.MatchResource#getOrigin Origin}' attribute. - * - * - * @param value the new value of the 'Origin' attribute. - * @see #getOrigin() - * @generated - */ - void setOrigin(Resource value); - -} // MatchResource +/** + * 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; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; + +/** + * + * A representation of the model object 'Match Resource'. + * + * + * + * A MatchResource element represents the mapping between two or three resources : left, right, and their optional common ancestor. The resource will be identified through its URI. + * + * + *

+ * The following features are supported: + *

    + *
  • {@link org.eclipse.emf.compare.MatchResource#getLeftURI Left URI}
  • + *
  • {@link org.eclipse.emf.compare.MatchResource#getRightURI Right URI}
  • + *
  • {@link org.eclipse.emf.compare.MatchResource#getOriginURI Origin URI}
  • + *
  • {@link org.eclipse.emf.compare.MatchResource#getLeft Left}
  • + *
  • {@link org.eclipse.emf.compare.MatchResource#getRight Right}
  • + *
  • {@link org.eclipse.emf.compare.MatchResource#getOrigin Origin}
  • + *
  • {@link org.eclipse.emf.compare.MatchResource#getComparison Comparison}
  • + *
+ *

+ * + * @see org.eclipse.emf.compare.ComparePackage#getMatchResource() + * @model + * @generated + */ +public interface MatchResource extends EObject { + /** + * + * + * @generated + */ + 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$ + + /** + * Returns the value of the 'Left URI' attribute. + * + * + * + * Cannot be null. Represents the URI of the left resource of this mapping. + * + * @return the value of the 'Left URI' attribute. + * @see #setLeftURI(String) + * @see org.eclipse.emf.compare.ComparePackage#getMatchResource_LeftURI() + * @model required="true" + * @generated + */ + String getLeftURI(); + + /** + * Sets the value of the '{@link org.eclipse.emf.compare.MatchResource#getLeftURI Left URI}' attribute. + * + * + * @param value the new value of the 'Left URI' attribute. + * @see #getLeftURI() + * @generated + */ + void setLeftURI(String value); + + /** + * Returns the value of the 'Right URI' attribute. + * + * + * + * Cannot be null. Represents the URI of the right resource of this mapping. + * + * @return the value of the 'Right URI' attribute. + * @see #setRightURI(String) + * @see org.eclipse.emf.compare.ComparePackage#getMatchResource_RightURI() + * @model required="true" + * @generated + */ + String getRightURI(); + + /** + * Sets the value of the '{@link org.eclipse.emf.compare.MatchResource#getRightURI Right URI}' attribute. + * + * + * @param value the new value of the 'Right URI' attribute. + * @see #getRightURI() + * @generated + */ + void setRightURI(String value); + + /** + * Returns the value of the 'Origin URI' attribute. + * + * + * + * This can be null in the case of two-way comparisons. If assigned, it will represent the URI of the origin resource for this mapping; the common ancestor of both others. + * + * @return the value of the 'Origin URI' attribute. + * @see #setOriginURI(String) + * @see org.eclipse.emf.compare.ComparePackage#getMatchResource_OriginURI() + * @model + * @generated + */ + String getOriginURI(); + + /** + * Sets the value of the '{@link org.eclipse.emf.compare.MatchResource#getOriginURI Origin URI}' attribute. + * + * + * @param value the new value of the 'Origin URI' attribute. + * @see #getOriginURI() + * @generated + */ + void setOriginURI(String value); + + /** + * Returns the value of the 'Left' attribute. + * + * + * + * Keeps a reference towards the left Resource of this Match. Might be null if this is a Comparison we have re-loaded from its serialized form and the left EResource could not be loaded. + * + * @return the value of the 'Left' attribute. + * @see #setLeft(Resource) + * @see org.eclipse.emf.compare.ComparePackage#getMatchResource_Left() + * @model transient="true" + * @generated + */ + Resource getLeft(); + + /** + * Sets the value of the '{@link org.eclipse.emf.compare.MatchResource#getLeft Left}' attribute. + * + * + * @param value the new value of the 'Left' attribute. + * @see #getLeft() + * @generated + */ + void setLeft(Resource value); + + /** + * Returns the value of the 'Right' attribute. + * + * + * + * Keeps a reference towards the right Resource of this Match. Might be null if this is a Comparison we have re-loaded from its serialized form and the right EResource could not be loaded. + * + * @return the value of the 'Right' attribute. + * @see #setRight(Resource) + * @see org.eclipse.emf.compare.ComparePackage#getMatchResource_Right() + * @model transient="true" + * @generated + */ + Resource getRight(); + + /** + * Sets the value of the '{@link org.eclipse.emf.compare.MatchResource#getRight Right}' attribute. + * + * + * @param value the new value of the 'Right' attribute. + * @see #getRight() + * @generated + */ + void setRight(Resource value); + + /** + * Returns the value of the 'Origin' attribute. + * + * + * + * Keeps a reference towards the origin Resource of this Match. Might be null if this is a Comparison we have re-loaded from its serialized form and the origin EResource could not be loaded. + * + * @return the value of the 'Origin' attribute. + * @see #setOrigin(Resource) + * @see org.eclipse.emf.compare.ComparePackage#getMatchResource_Origin() + * @model transient="true" + * @generated + */ + Resource getOrigin(); + + /** + * Sets the value of the '{@link org.eclipse.emf.compare.MatchResource#getOrigin Origin}' attribute. + * + * + * @param value the new value of the 'Origin' attribute. + * @see #getOrigin() + * @generated + */ + void setOrigin(Resource value); + + /** + * Returns the value of the 'Comparison' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.emf.compare.Comparison#getMatchedResources Matched Resources}'. + * + *

+ * 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: - *

    - *
  • {@link org.eclipse.emf.compare.impl.ComparisonImpl#getMatchedResources Matched Resources}
  • - *
  • {@link org.eclipse.emf.compare.impl.ComparisonImpl#getMatches Matches}
  • - *
  • {@link org.eclipse.emf.compare.impl.ComparisonImpl#getConflicts Conflicts}
  • - *
  • {@link org.eclipse.emf.compare.impl.ComparisonImpl#getEquivalences Equivalences}
  • - *
  • {@link org.eclipse.emf.compare.impl.ComparisonImpl#isThreeWay Three Way}
  • - *
- *

- * - * @generated - */ -@SuppressWarnings("boxing") -public class ComparisonImpl extends MinimalEObjectImpl implements Comparison { - /** - * - * - * @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$ - - /** - * The cached value of the '{@link #getMatchedResources() Matched Resources}' containment - * reference list. - * - * @see #getMatchedResources() - * @generated - * @ordered - */ - protected EList matchedResources; - - /** - * The cached value of the '{@link #getMatches() Matches}' containment reference list. - * - * @see #getMatches() - * @generated - * @ordered - */ - protected EList matches; - - /** - * The cached value of the '{@link #getConflicts() Conflicts}' containment reference list. - * - * @see #getConflicts() - * @generated - * @ordered - */ - protected EList conflicts; - - /** - * The cached value of the '{@link #getEquivalences() Equivalences}' containment reference list. - * - * - * @see #getEquivalences() - * @generated - * @ordered - */ - protected EList equivalences; - - /** - * The default value of the '{@link #isThreeWay() Three Way}' attribute. - * - * - * @see #isThreeWay() - * @generated - * @ordered - */ - protected static final boolean THREE_WAY_EDEFAULT = false; - - /** - * The cached value of the '{@link #isThreeWay() Three Way}' attribute. - * - * - * @see #isThreeWay() - * @generated - * @ordered - */ - protected boolean threeWay = THREE_WAY_EDEFAULT; - - /** - * - * - * @generated - */ - protected ComparisonImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return ComparePackage.Literals.COMPARISON; - } - - /** - * - * - * @generated - */ - public EList getMatchedResources() { - if (matchedResources == null) { - matchedResources = new EObjectContainmentEList(MatchResource.class, this, - ComparePackage.COMPARISON__MATCHED_RESOURCES); - } - return matchedResources; - } - - /** - * - * - * @generated - */ - public EList getMatches() { - if (matches == null) { - matches = new EObjectContainmentEList(Match.class, this, - ComparePackage.COMPARISON__MATCHES); - } - return matches; - } - - /** - * - * - * @generated - */ - public EList getConflicts() { - if (conflicts == null) { - conflicts = new EObjectContainmentEList(Conflict.class, this, - ComparePackage.COMPARISON__CONFLICTS); - } - return conflicts; - } - - /** - * - * - * @generated - */ - public EList getEquivalences() { - if (equivalences == null) { - equivalences = new EObjectContainmentEList(Equivalence.class, this, - ComparePackage.COMPARISON__EQUIVALENCES); - } - return equivalences; - } - - /** - * - * - * @generated - */ - public EList getDifferences() { - // TODO: implement this method - // Ensure that you remove @generated or mark it @generated NOT - throw new UnsupportedOperationException(); - } - - /** - * - * - * @generated - */ - public EList getDifferences(EObject element) { - // TODO: implement this method - // Ensure that you remove @generated or mark it @generated NOT - throw new UnsupportedOperationException(); - } - - /** - * - * - * @generated - */ - public Match getMatch(EObject element) { - // TODO: implement this method - // Ensure that you remove @generated or mark it @generated NOT - throw new UnsupportedOperationException(); - } - - /** - * - * - * @generated - */ - public IEqualityHelper getEqualityHelper() { - // TODO: implement this method - // Ensure that you remove @generated or mark it @generated NOT - throw new UnsupportedOperationException(); - } - - /** - * - * - * @generated - */ - public boolean isThreeWay() { - return threeWay; - } - - /** - * - * - * @generated - */ - public void setThreeWay(boolean newThreeWay) { - boolean oldThreeWay = threeWay; - threeWay = newThreeWay; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, ComparePackage.COMPARISON__THREE_WAY, - oldThreeWay, threeWay)); - } - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case ComparePackage.COMPARISON__MATCHED_RESOURCES: - return ((InternalEList)getMatchedResources()).basicRemove(otherEnd, msgs); - case ComparePackage.COMPARISON__MATCHES: - return ((InternalEList)getMatches()).basicRemove(otherEnd, msgs); - case ComparePackage.COMPARISON__CONFLICTS: - return ((InternalEList)getConflicts()).basicRemove(otherEnd, msgs); - case ComparePackage.COMPARISON__EQUIVALENCES: - return ((InternalEList)getEquivalences()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case ComparePackage.COMPARISON__MATCHED_RESOURCES: - return getMatchedResources(); - case ComparePackage.COMPARISON__MATCHES: - return getMatches(); - case ComparePackage.COMPARISON__CONFLICTS: - return getConflicts(); - case ComparePackage.COMPARISON__EQUIVALENCES: - return getEquivalences(); - case ComparePackage.COMPARISON__THREE_WAY: - return isThreeWay(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case ComparePackage.COMPARISON__MATCHED_RESOURCES: - getMatchedResources().clear(); - getMatchedResources().addAll((Collection)newValue); - return; - case ComparePackage.COMPARISON__MATCHES: - getMatches().clear(); - getMatches().addAll((Collection)newValue); - return; - case ComparePackage.COMPARISON__CONFLICTS: - getConflicts().clear(); - getConflicts().addAll((Collection)newValue); - return; - case ComparePackage.COMPARISON__EQUIVALENCES: - getEquivalences().clear(); - getEquivalences().addAll((Collection)newValue); - return; - case ComparePackage.COMPARISON__THREE_WAY: - setThreeWay((Boolean)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case ComparePackage.COMPARISON__MATCHED_RESOURCES: - getMatchedResources().clear(); - return; - case ComparePackage.COMPARISON__MATCHES: - getMatches().clear(); - return; - case ComparePackage.COMPARISON__CONFLICTS: - getConflicts().clear(); - return; - case ComparePackage.COMPARISON__EQUIVALENCES: - getEquivalences().clear(); - return; - case ComparePackage.COMPARISON__THREE_WAY: - setThreeWay(THREE_WAY_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case ComparePackage.COMPARISON__MATCHED_RESOURCES: - return matchedResources != null && !matchedResources.isEmpty(); - case ComparePackage.COMPARISON__MATCHES: - return matches != null && !matches.isEmpty(); - case ComparePackage.COMPARISON__CONFLICTS: - return conflicts != null && !conflicts.isEmpty(); - case ComparePackage.COMPARISON__EQUIVALENCES: - return equivalences != null && !equivalences.isEmpty(); - case ComparePackage.COMPARISON__THREE_WAY: - return threeWay != THREE_WAY_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (threeWay: "); //$NON-NLS-1$ - result.append(threeWay); - result.append(')'); - return result.toString(); - } - -} // ComparisonImpl +/** + * 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.EObjectContainmentWithInverseEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * An implementation of the model object 'Comparison'. + *

+ * The following features are implemented: + *

    + *
  • {@link org.eclipse.emf.compare.impl.ComparisonImpl#getMatchedResources Matched Resources}
  • + *
  • {@link org.eclipse.emf.compare.impl.ComparisonImpl#getMatches Matches}
  • + *
  • {@link org.eclipse.emf.compare.impl.ComparisonImpl#getConflicts Conflicts}
  • + *
  • {@link org.eclipse.emf.compare.impl.ComparisonImpl#getEquivalences Equivalences}
  • + *
  • {@link org.eclipse.emf.compare.impl.ComparisonImpl#isThreeWay Three Way}
  • + *
+ *

+ * + * @generated + */ +@SuppressWarnings("boxing") +public class ComparisonImpl extends MinimalEObjectImpl implements Comparison { + /** + * + * @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$ + + /** + * The cached value of the '{@link #getMatchedResources() Matched Resources}' containment reference list. + * + * @see #getMatchedResources() + * @generated + * @ordered + */ + protected EList matchedResources; + + /** + * The cached value of the '{@link #getMatches() Matches}' containment reference list. + * + * @see #getMatches() + * @generated + * @ordered + */ + protected EList matches; + + /** + * The cached value of the '{@link #getConflicts() Conflicts}' containment reference list. + * + * @see #getConflicts() + * @generated + * @ordered + */ + protected EList conflicts; + + /** + * The cached value of the '{@link #getEquivalences() Equivalences}' containment reference list. + * + * @see #getEquivalences() + * @generated + * @ordered + */ + protected EList equivalences; + + /** + * The default value of the '{@link #isThreeWay() Three Way}' attribute. + * + * + * @see #isThreeWay() + * @generated + * @ordered + */ + protected static final boolean THREE_WAY_EDEFAULT = false; + + /** + * The cached value of the '{@link #isThreeWay() Three Way}' attribute. + * + * + * @see #isThreeWay() + * @generated + * @ordered + */ + protected boolean threeWay = THREE_WAY_EDEFAULT; + + /** + * + * @generated + */ + protected ComparisonImpl() { + super(); + } + + /** + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ComparePackage.Literals.COMPARISON; + } + + /** + * + * @generated + */ + public EList getMatchedResources() { + if (matchedResources == null) { + matchedResources = new EObjectContainmentWithInverseEList(MatchResource.class, + this, ComparePackage.COMPARISON__MATCHED_RESOURCES, + ComparePackage.MATCH_RESOURCE__COMPARISON); + } + return matchedResources; + } + + /** + * + * @generated + */ + public EList getMatches() { + if (matches == null) { + matches = new EObjectContainmentEList(Match.class, this, + ComparePackage.COMPARISON__MATCHES); + } + return matches; + } + + /** + * + * @generated + */ + public EList getConflicts() { + if (conflicts == null) { + conflicts = new EObjectContainmentEList(Conflict.class, this, + ComparePackage.COMPARISON__CONFLICTS); + } + return conflicts; + } + + /** + * + * @generated + */ + public EList getEquivalences() { + if (equivalences == null) { + equivalences = new EObjectContainmentEList(Equivalence.class, this, + ComparePackage.COMPARISON__EQUIVALENCES); + } + return equivalences; + } + + /** + * + * @generated + */ + public EList getDifferences() { + // TODO: implement this method + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); + } + + /** + * + * @generated + */ + public EList getDifferences(EObject element) { + // TODO: implement this method + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); + } + + /** + * + * @generated + */ + public Match getMatch(EObject element) { + // TODO: implement this method + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); + } + + /** + * + * @generated + */ + public IEqualityHelper getEqualityHelper() { + // TODO: implement this method + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ComparePackage.COMPARISON__MATCHED_RESOURCES: + return ((InternalEList)(InternalEList)getMatchedResources()).basicAdd( + otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * @generated + */ + public boolean isThreeWay() { + return threeWay; + } + + /** + * + * @generated + */ + public void setThreeWay(boolean newThreeWay) { + boolean oldThreeWay = threeWay; + threeWay = newThreeWay; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ComparePackage.COMPARISON__THREE_WAY, + oldThreeWay, threeWay)); + } + + /** + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ComparePackage.COMPARISON__MATCHED_RESOURCES: + return ((InternalEList)getMatchedResources()).basicRemove(otherEnd, msgs); + case ComparePackage.COMPARISON__MATCHES: + return ((InternalEList)getMatches()).basicRemove(otherEnd, msgs); + case ComparePackage.COMPARISON__CONFLICTS: + return ((InternalEList)getConflicts()).basicRemove(otherEnd, msgs); + case ComparePackage.COMPARISON__EQUIVALENCES: + return ((InternalEList)getEquivalences()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ComparePackage.COMPARISON__MATCHED_RESOURCES: + return getMatchedResources(); + case ComparePackage.COMPARISON__MATCHES: + return getMatches(); + case ComparePackage.COMPARISON__CONFLICTS: + return getConflicts(); + case ComparePackage.COMPARISON__EQUIVALENCES: + return getEquivalences(); + case ComparePackage.COMPARISON__THREE_WAY: + return isThreeWay(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ComparePackage.COMPARISON__MATCHED_RESOURCES: + getMatchedResources().clear(); + getMatchedResources().addAll((Collection)newValue); + return; + case ComparePackage.COMPARISON__MATCHES: + getMatches().clear(); + getMatches().addAll((Collection)newValue); + return; + case ComparePackage.COMPARISON__CONFLICTS: + getConflicts().clear(); + getConflicts().addAll((Collection)newValue); + return; + case ComparePackage.COMPARISON__EQUIVALENCES: + getEquivalences().clear(); + getEquivalences().addAll((Collection)newValue); + return; + case ComparePackage.COMPARISON__THREE_WAY: + setThreeWay((Boolean)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ComparePackage.COMPARISON__MATCHED_RESOURCES: + getMatchedResources().clear(); + return; + case ComparePackage.COMPARISON__MATCHES: + getMatches().clear(); + return; + case ComparePackage.COMPARISON__CONFLICTS: + getConflicts().clear(); + return; + case ComparePackage.COMPARISON__EQUIVALENCES: + getEquivalences().clear(); + return; + case ComparePackage.COMPARISON__THREE_WAY: + setThreeWay(THREE_WAY_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ComparePackage.COMPARISON__MATCHED_RESOURCES: + return matchedResources != null && !matchedResources.isEmpty(); + case ComparePackage.COMPARISON__MATCHES: + return matches != null && !matches.isEmpty(); + case ComparePackage.COMPARISON__CONFLICTS: + return conflicts != null && !conflicts.isEmpty(); + case ComparePackage.COMPARISON__EQUIVALENCES: + return equivalences != null && !equivalences.isEmpty(); + case ComparePackage.COMPARISON__THREE_WAY: + return threeWay != THREE_WAY_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (threeWay: "); //$NON-NLS-1$ + result.append(threeWay); + result.append(')'); + return result.toString(); + } + +} // ComparisonImpl diff --git a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/MatchResourceImpl.java b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/MatchResourceImpl.java index a84d24964..66d9efaf3 100644 --- a/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/MatchResourceImpl.java +++ b/plugins/org.eclipse.emf.compare/src-gen/org/eclipse/emf/compare/impl/MatchResourceImpl.java @@ -1,457 +1,563 @@ -/** - * 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.common.notify.Notification; - -import org.eclipse.emf.compare.ComparePackage; -import org.eclipse.emf.compare.MatchResource; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.emf.ecore.resource.Resource; - -/** - * - * An implementation of the model object 'Match Resource'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.emf.compare.impl.MatchResourceImpl#getLeftURI Left URI}
  • - *
  • {@link org.eclipse.emf.compare.impl.MatchResourceImpl#getRightURI Right URI}
  • - *
  • {@link org.eclipse.emf.compare.impl.MatchResourceImpl#getOriginURI Origin URI}
  • - *
  • {@link org.eclipse.emf.compare.impl.MatchResourceImpl#getLeft Left}
  • - *
  • {@link org.eclipse.emf.compare.impl.MatchResourceImpl#getRight Right}
  • - *
  • {@link org.eclipse.emf.compare.impl.MatchResourceImpl#getOrigin Origin}
  • - *
- *

- * - * @generated - */ -public class MatchResourceImpl extends MinimalEObjectImpl implements MatchResource { - /** - * - * - * @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$ - - /** - * The default value of the '{@link #getLeftURI() Left URI}' attribute. - * - * - * @see #getLeftURI() - * @generated - * @ordered - */ - protected static final String LEFT_URI_EDEFAULT = null; - - /** - * The cached value of the '{@link #getLeftURI() Left URI}' attribute. - * - * - * @see #getLeftURI() - * @generated - * @ordered - */ - protected String leftURI = LEFT_URI_EDEFAULT; - - /** - * The default value of the '{@link #getRightURI() Right URI}' attribute. - * - * - * @see #getRightURI() - * @generated - * @ordered - */ - protected static final String RIGHT_URI_EDEFAULT = null; - - /** - * The cached value of the '{@link #getRightURI() Right URI}' attribute. - * - * - * @see #getRightURI() - * @generated - * @ordered - */ - protected String rightURI = RIGHT_URI_EDEFAULT; - - /** - * The default value of the '{@link #getOriginURI() Origin URI}' attribute. - * - * - * @see #getOriginURI() - * @generated - * @ordered - */ - protected static final String ORIGIN_URI_EDEFAULT = null; - - /** - * The cached value of the '{@link #getOriginURI() Origin URI}' attribute. - * - * - * @see #getOriginURI() - * @generated - * @ordered - */ - protected String originURI = ORIGIN_URI_EDEFAULT; - - /** - * The default value of the '{@link #getLeft() Left}' attribute. - * - * - * @see #getLeft() - * @generated - * @ordered - */ - protected static final Resource LEFT_EDEFAULT = null; - - /** - * The cached value of the '{@link #getLeft() Left}' attribute. - * - * - * @see #getLeft() - * @generated - * @ordered - */ - protected Resource left = LEFT_EDEFAULT; - - /** - * The default value of the '{@link #getRight() Right}' attribute. - * - * - * @see #getRight() - * @generated - * @ordered - */ - protected static final Resource RIGHT_EDEFAULT = null; - - /** - * The cached value of the '{@link #getRight() Right}' attribute. - * - * - * @see #getRight() - * @generated - * @ordered - */ - protected Resource right = RIGHT_EDEFAULT; - - /** - * The default value of the '{@link #getOrigin() Origin}' attribute. - * - * - * @see #getOrigin() - * @generated - * @ordered - */ - protected static final Resource ORIGIN_EDEFAULT = null; - - /** - * The cached value of the '{@link #getOrigin() Origin}' attribute. - * - * - * @see #getOrigin() - * @generated - * @ordered - */ - protected Resource origin = ORIGIN_EDEFAULT; - - /** - * - * - * @generated - */ - protected MatchResourceImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return ComparePackage.Literals.MATCH_RESOURCE; - } - - /** - * - * - * @generated - */ - public String getLeftURI() { - return leftURI; - } - - /** - * - * - * @generated - */ - public void setLeftURI(String newLeftURI) { - String oldLeftURI = leftURI; - leftURI = newLeftURI; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ComparePackage.MATCH_RESOURCE__LEFT_URI, - oldLeftURI, leftURI)); - } - - /** - * - * - * @generated - */ - public String getRightURI() { - return rightURI; - } - - /** - * - * - * @generated - */ - public void setRightURI(String newRightURI) { - String oldRightURI = rightURI; - rightURI = newRightURI; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ComparePackage.MATCH_RESOURCE__RIGHT_URI, - oldRightURI, rightURI)); - } - - /** - * - * - * @generated - */ - public String getOriginURI() { - return originURI; - } - - /** - * - * - * @generated - */ - public void setOriginURI(String newOriginURI) { - String oldOriginURI = originURI; - originURI = newOriginURI; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ComparePackage.MATCH_RESOURCE__ORIGIN_URI, - oldOriginURI, originURI)); - } - - /** - * - * - * @generated - */ - public Resource getLeft() { - return left; - } - - /** - * - * - * @generated - */ - public void setLeft(Resource newLeft) { - Resource oldLeft = left; - left = newLeft; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ComparePackage.MATCH_RESOURCE__LEFT, - oldLeft, left)); - } - - /** - * - * - * @generated - */ - public Resource getRight() { - return right; - } - - /** - * - * - * @generated - */ - public void setRight(Resource newRight) { - Resource oldRight = right; - right = newRight; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ComparePackage.MATCH_RESOURCE__RIGHT, - oldRight, right)); - } - - /** - * - * - * @generated - */ - public Resource getOrigin() { - return origin; - } - - /** - * - * - * @generated - */ - public void setOrigin(Resource newOrigin) { - Resource oldOrigin = origin; - origin = newOrigin; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ComparePackage.MATCH_RESOURCE__ORIGIN, - oldOrigin, origin)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case ComparePackage.MATCH_RESOURCE__LEFT_URI: - return getLeftURI(); - case ComparePackage.MATCH_RESOURCE__RIGHT_URI: - return getRightURI(); - case ComparePackage.MATCH_RESOURCE__ORIGIN_URI: - return getOriginURI(); - case ComparePackage.MATCH_RESOURCE__LEFT: - return getLeft(); - case ComparePackage.MATCH_RESOURCE__RIGHT: - return getRight(); - case ComparePackage.MATCH_RESOURCE__ORIGIN: - return getOrigin(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case ComparePackage.MATCH_RESOURCE__LEFT_URI: - setLeftURI((String)newValue); - return; - case ComparePackage.MATCH_RESOURCE__RIGHT_URI: - setRightURI((String)newValue); - return; - case ComparePackage.MATCH_RESOURCE__ORIGIN_URI: - setOriginURI((String)newValue); - return; - case ComparePackage.MATCH_RESOURCE__LEFT: - setLeft((Resource)newValue); - return; - case ComparePackage.MATCH_RESOURCE__RIGHT: - setRight((Resource)newValue); - return; - case ComparePackage.MATCH_RESOURCE__ORIGIN: - setOrigin((Resource)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case ComparePackage.MATCH_RESOURCE__LEFT_URI: - setLeftURI(LEFT_URI_EDEFAULT); - return; - case ComparePackage.MATCH_RESOURCE__RIGHT_URI: - setRightURI(RIGHT_URI_EDEFAULT); - return; - case ComparePackage.MATCH_RESOURCE__ORIGIN_URI: - setOriginURI(ORIGIN_URI_EDEFAULT); - return; - case ComparePackage.MATCH_RESOURCE__LEFT: - setLeft(LEFT_EDEFAULT); - return; - case ComparePackage.MATCH_RESOURCE__RIGHT: - setRight(RIGHT_EDEFAULT); - return; - case ComparePackage.MATCH_RESOURCE__ORIGIN: - setOrigin(ORIGIN_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case ComparePackage.MATCH_RESOURCE__LEFT_URI: - return LEFT_URI_EDEFAULT == null ? leftURI != null : !LEFT_URI_EDEFAULT.equals(leftURI); - case ComparePackage.MATCH_RESOURCE__RIGHT_URI: - return RIGHT_URI_EDEFAULT == null ? rightURI != null : !RIGHT_URI_EDEFAULT.equals(rightURI); - case ComparePackage.MATCH_RESOURCE__ORIGIN_URI: - return ORIGIN_URI_EDEFAULT == null ? originURI != null : !ORIGIN_URI_EDEFAULT - .equals(originURI); - case ComparePackage.MATCH_RESOURCE__LEFT: - return LEFT_EDEFAULT == null ? left != null : !LEFT_EDEFAULT.equals(left); - case ComparePackage.MATCH_RESOURCE__RIGHT: - return RIGHT_EDEFAULT == null ? right != null : !RIGHT_EDEFAULT.equals(right); - case ComparePackage.MATCH_RESOURCE__ORIGIN: - return ORIGIN_EDEFAULT == null ? origin != null : !ORIGIN_EDEFAULT.equals(origin); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (leftURI: "); //$NON-NLS-1$ - result.append(leftURI); - result.append(", rightURI: "); //$NON-NLS-1$ - result.append(rightURI); - result.append(", originURI: "); //$NON-NLS-1$ - result.append(originURI); - result.append(", left: "); //$NON-NLS-1$ - result.append(left); - result.append(", right: "); //$NON-NLS-1$ - result.append(right); - result.append(", origin: "); //$NON-NLS-1$ - result.append(origin); - result.append(')'); - return result.toString(); - } - -} //MatchResourceImpl +/** + * 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.common.notify.Notification; + +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.compare.ComparePackage; +import org.eclipse.emf.compare.Comparison; +import org.eclipse.emf.compare.MatchResource; + +import org.eclipse.emf.ecore.EClass; + +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.resource.Resource; +import org.eclipse.emf.ecore.util.EcoreUtil; + +/** + * + * An implementation of the model object 'Match Resource'. + * + *

+ * The following features are implemented: + *

    + *
  • {@link org.eclipse.emf.compare.impl.MatchResourceImpl#getLeftURI Left URI}
  • + *
  • {@link org.eclipse.emf.compare.impl.MatchResourceImpl#getRightURI Right URI}
  • + *
  • {@link org.eclipse.emf.compare.impl.MatchResourceImpl#getOriginURI Origin URI}
  • + *
  • {@link org.eclipse.emf.compare.impl.MatchResourceImpl#getLeft Left}
  • + *
  • {@link org.eclipse.emf.compare.impl.MatchResourceImpl#getRight Right}
  • + *
  • {@link org.eclipse.emf.compare.impl.MatchResourceImpl#getOrigin Origin}
  • + *
  • {@link org.eclipse.emf.compare.impl.MatchResourceImpl#getComparison Comparison}
  • + *
+ *

+ * + * @generated + */ +public class MatchResourceImpl extends MinimalEObjectImpl implements MatchResource { + /** + * + * + * @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$ + + /** + * The default value of the '{@link #getLeftURI() Left URI}' attribute. + * + * + * @see #getLeftURI() + * @generated + * @ordered + */ + protected static final String LEFT_URI_EDEFAULT = null; + + /** + * The cached value of the '{@link #getLeftURI() Left URI}' attribute. + * + * + * @see #getLeftURI() + * @generated + * @ordered + */ + protected String leftURI = LEFT_URI_EDEFAULT; + + /** + * The default value of the '{@link #getRightURI() Right URI}' attribute. + * + * + * @see #getRightURI() + * @generated + * @ordered + */ + protected static final String RIGHT_URI_EDEFAULT = null; + + /** + * The cached value of the '{@link #getRightURI() Right URI}' attribute. + * + * + * @see #getRightURI() + * @generated + * @ordered + */ + protected String rightURI = RIGHT_URI_EDEFAULT; + + /** + * The default value of the '{@link #getOriginURI() Origin URI}' attribute. + * + * + * @see #getOriginURI() + * @generated + * @ordered + */ + protected static final String ORIGIN_URI_EDEFAULT = null; + + /** + * The cached value of the '{@link #getOriginURI() Origin URI}' attribute. + * + * + * @see #getOriginURI() + * @generated + * @ordered + */ + protected String originURI = ORIGIN_URI_EDEFAULT; + + /** + * The default value of the '{@link #getLeft() Left}' attribute. + * + * + * @see #getLeft() + * @generated + * @ordered + */ + protected static final Resource LEFT_EDEFAULT = null; + + /** + * The cached value of the '{@link #getLeft() Left}' attribute. + * + * + * @see #getLeft() + * @generated + * @ordered + */ + protected Resource left = LEFT_EDEFAULT; + + /** + * The default value of the '{@link #getRight() Right}' attribute. + * + * + * @see #getRight() + * @generated + * @ordered + */ + protected static final Resource RIGHT_EDEFAULT = null; + + /** + * The cached value of the '{@link #getRight() Right}' attribute. + * + * + * @see #getRight() + * @generated + * @ordered + */ + protected Resource right = RIGHT_EDEFAULT; + + /** + * The default value of the '{@link #getOrigin() Origin}' attribute. + * + * + * @see #getOrigin() + * @generated + * @ordered + */ + protected static final Resource ORIGIN_EDEFAULT = null; + + /** + * The cached value of the '{@link #getOrigin() Origin}' attribute. + * + * + * @see #getOrigin() + * @generated + * @ordered + */ + protected Resource origin = ORIGIN_EDEFAULT; + + /** + * + * + * @generated + */ + protected MatchResourceImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ComparePackage.Literals.MATCH_RESOURCE; + } + + /** + * + * + * @generated + */ + public String getLeftURI() { + return leftURI; + } + + /** + * + * + * @generated + */ + public void setLeftURI(String newLeftURI) { + String oldLeftURI = leftURI; + leftURI = newLeftURI; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ComparePackage.MATCH_RESOURCE__LEFT_URI, + oldLeftURI, leftURI)); + } + + /** + * + * + * @generated + */ + public String getRightURI() { + return rightURI; + } + + /** + * + * + * @generated + */ + public void setRightURI(String newRightURI) { + String oldRightURI = rightURI; + rightURI = newRightURI; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ComparePackage.MATCH_RESOURCE__RIGHT_URI, + oldRightURI, rightURI)); + } + + /** + * + * + * @generated + */ + public String getOriginURI() { + return originURI; + } + + /** + * + * + * @generated + */ + public void setOriginURI(String newOriginURI) { + String oldOriginURI = originURI; + originURI = newOriginURI; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ComparePackage.MATCH_RESOURCE__ORIGIN_URI, + oldOriginURI, originURI)); + } + + /** + * + * + * @generated + */ + public Resource getLeft() { + return left; + } + + /** + * + * + * @generated + */ + public void setLeft(Resource newLeft) { + Resource oldLeft = left; + left = newLeft; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ComparePackage.MATCH_RESOURCE__LEFT, + oldLeft, left)); + } + + /** + * + * + * @generated + */ + public Resource getRight() { + return right; + } + + /** + * + * + * @generated + */ + public void setRight(Resource newRight) { + Resource oldRight = right; + right = newRight; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ComparePackage.MATCH_RESOURCE__RIGHT, + oldRight, right)); + } + + /** + * + * + * @generated + */ + public Resource getOrigin() { + return origin; + } + + /** + * + * + * @generated + */ + public void setOrigin(Resource newOrigin) { + Resource oldOrigin = origin; + origin = newOrigin; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ComparePackage.MATCH_RESOURCE__ORIGIN, + oldOrigin, origin)); + } + + /** + * + * + * @generated + */ + public Comparison getComparison() { + if (eContainerFeatureID() != ComparePackage.MATCH_RESOURCE__COMPARISON) + return null; + return (Comparison)eContainer(); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetComparison(Comparison newComparison, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject)newComparison, ComparePackage.MATCH_RESOURCE__COMPARISON, + msgs); + return msgs; + } + + /** + * + * + * @generated + */ + public void setComparison(Comparison newComparison) { + if (newComparison != eInternalContainer() + || (eContainerFeatureID() != ComparePackage.MATCH_RESOURCE__COMPARISON && newComparison != null)) { + if (EcoreUtil.isAncestor(this, newComparison)) + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); //$NON-NLS-1$ + NotificationChain msgs = null; + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + if (newComparison != null) + msgs = ((InternalEObject)newComparison).eInverseAdd(this, + ComparePackage.COMPARISON__MATCHED_RESOURCES, Comparison.class, msgs); + msgs = basicSetComparison(newComparison, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ComparePackage.MATCH_RESOURCE__COMPARISON, + newComparison, newComparison)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ComparePackage.MATCH_RESOURCE__COMPARISON: + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + return basicSetComparison((Comparison)otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ComparePackage.MATCH_RESOURCE__COMPARISON: + return basicSetComparison(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case ComparePackage.MATCH_RESOURCE__COMPARISON: + return eInternalContainer().eInverseRemove(this, + ComparePackage.COMPARISON__MATCHED_RESOURCES, Comparison.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ComparePackage.MATCH_RESOURCE__LEFT_URI: + return getLeftURI(); + case ComparePackage.MATCH_RESOURCE__RIGHT_URI: + return getRightURI(); + case ComparePackage.MATCH_RESOURCE__ORIGIN_URI: + return getOriginURI(); + case ComparePackage.MATCH_RESOURCE__LEFT: + return getLeft(); + case ComparePackage.MATCH_RESOURCE__RIGHT: + return getRight(); + case ComparePackage.MATCH_RESOURCE__ORIGIN: + return getOrigin(); + case ComparePackage.MATCH_RESOURCE__COMPARISON: + return getComparison(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ComparePackage.MATCH_RESOURCE__LEFT_URI: + setLeftURI((String)newValue); + return; + case ComparePackage.MATCH_RESOURCE__RIGHT_URI: + setRightURI((String)newValue); + return; + case ComparePackage.MATCH_RESOURCE__ORIGIN_URI: + setOriginURI((String)newValue); + return; + case ComparePackage.MATCH_RESOURCE__LEFT: + setLeft((Resource)newValue); + return; + case ComparePackage.MATCH_RESOURCE__RIGHT: + setRight((Resource)newValue); + return; + case ComparePackage.MATCH_RESOURCE__ORIGIN: + setOrigin((Resource)newValue); + return; + case ComparePackage.MATCH_RESOURCE__COMPARISON: + setComparison((Comparison)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ComparePackage.MATCH_RESOURCE__LEFT_URI: + setLeftURI(LEFT_URI_EDEFAULT); + return; + case ComparePackage.MATCH_RESOURCE__RIGHT_URI: + setRightURI(RIGHT_URI_EDEFAULT); + return; + case ComparePackage.MATCH_RESOURCE__ORIGIN_URI: + setOriginURI(ORIGIN_URI_EDEFAULT); + return; + case ComparePackage.MATCH_RESOURCE__LEFT: + setLeft(LEFT_EDEFAULT); + return; + case ComparePackage.MATCH_RESOURCE__RIGHT: + setRight(RIGHT_EDEFAULT); + return; + case ComparePackage.MATCH_RESOURCE__ORIGIN: + setOrigin(ORIGIN_EDEFAULT); + return; + case ComparePackage.MATCH_RESOURCE__COMPARISON: + setComparison((Comparison)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ComparePackage.MATCH_RESOURCE__LEFT_URI: + return LEFT_URI_EDEFAULT == null ? leftURI != null : !LEFT_URI_EDEFAULT.equals(leftURI); + case ComparePackage.MATCH_RESOURCE__RIGHT_URI: + return RIGHT_URI_EDEFAULT == null ? rightURI != null : !RIGHT_URI_EDEFAULT.equals(rightURI); + case ComparePackage.MATCH_RESOURCE__ORIGIN_URI: + return ORIGIN_URI_EDEFAULT == null ? originURI != null : !ORIGIN_URI_EDEFAULT + .equals(originURI); + case ComparePackage.MATCH_RESOURCE__LEFT: + return LEFT_EDEFAULT == null ? left != null : !LEFT_EDEFAULT.equals(left); + case ComparePackage.MATCH_RESOURCE__RIGHT: + return RIGHT_EDEFAULT == null ? right != null : !RIGHT_EDEFAULT.equals(right); + case ComparePackage.MATCH_RESOURCE__ORIGIN: + return ORIGIN_EDEFAULT == null ? origin != null : !ORIGIN_EDEFAULT.equals(origin); + case ComparePackage.MATCH_RESOURCE__COMPARISON: + return getComparison() != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (leftURI: "); //$NON-NLS-1$ + result.append(leftURI); + result.append(", rightURI: "); //$NON-NLS-1$ + result.append(rightURI); + result.append(", originURI: "); //$NON-NLS-1$ + result.append(originURI); + result.append(", left: "); //$NON-NLS-1$ + result.append(left); + result.append(", right: "); //$NON-NLS-1$ + result.append(right); + result.append(", origin: "); //$NON-NLS-1$ + result.append(origin); + result.append(')'); + return result.toString(); + } + +} //MatchResourceImpl -- cgit v1.2.3