Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2015-01-26 13:51:18 +0000
committerVincent Lorenzo2015-01-26 13:51:18 +0000
commiteacb549b6a001a645c2d8f9d01350f9ff885c1ea (patch)
tree73c80a85f1d10f724146ea5bb6b72d185cbddbd8 /sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare
parent6ea239d144a3b745cabcc4c4ccdce0f7252374c9 (diff)
downloadorg.eclipse.papyrus-eacb549b6a001a645c2d8f9d01350f9ff885c1ea.tar.gz
org.eclipse.papyrus-eacb549b6a001a645c2d8f9d01350f9ff885c1ea.tar.xz
org.eclipse.papyrus-eacb549b6a001a645c2d8f9d01350f9ff885c1ea.zip
[Clean] Sandbox : remove all plugins concerning old emf compare integrationlast/org.eclipse.papyrus.infra.emf.compare
Diffstat (limited to 'sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare')
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/.classpath7
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/.project28
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/.settings/org.eclipse.jdt.ui.prefs108
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/META-INF/MANIFEST.MF26
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/build.properties5
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/plugin.xml27
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/Activator.java126
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/actions/CompareTwoElementsAction.java193
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/AbstractPapyrusDefaultMerger.java60
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/AttributeChangeLeftTargetMerger.java80
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/AttributeChangeRightTargetMerger.java80
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/AttributeOrderChangeMerger.java227
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/DiffExtensionMerger.java69
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/DiffGroupMerger.java49
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/ModelElementChangeRightTargetMerger.java146
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/MoveModelElementMerger.java103
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/PapyrusModelElementChangeLeftTargetMerger.java167
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/PapyrusUpdateAttributeMerger.java77
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/ReferenceChangeLeftTargetMerger.java149
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/ReferenceChangeRightTargetMerger.java150
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/ReferenceOrderChangeMerger.java83
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/UpdateReferenceMerger.java93
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/provider/MergeCommandProvider.java230
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/provider/PapyrusMergeCommandProvider.java56
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/provider/PapyrusMergerProvider.java86
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/service/SaveEMFCompareListener.java107
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/utils/CompareEditorConfiguration.java261
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/utils/Utils.java55
29 files changed, 0 insertions, 2856 deletions
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/.classpath b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/.classpath
deleted file mode 100644
index 2d1a4302f04..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/.project b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/.project
deleted file mode 100644
index 498925e84ad..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.infra.emf.compare</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/.settings/org.eclipse.jdt.core.prefs b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 84e4cf4b517..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Mon Nov 28 11:49:55 CET 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/.settings/org.eclipse.jdt.ui.prefs b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 3a12994bde4..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,108 +0,0 @@
-#Thu Dec 01 17:08:16 CET 2011
-cleanup.add_default_serial_version_id=true
-cleanup.add_generated_serial_version_id=false
-cleanup.add_missing_annotations=true
-cleanup.add_missing_deprecated_annotations=true
-cleanup.add_missing_methods=true
-cleanup.add_missing_nls_tags=false
-cleanup.add_missing_override_annotations=true
-cleanup.add_missing_override_annotations_interface_methods=false
-cleanup.add_serial_version_id=false
-cleanup.always_use_blocks=true
-cleanup.always_use_parentheses_in_expressions=false
-cleanup.always_use_this_for_non_static_field_access=true
-cleanup.always_use_this_for_non_static_method_access=true
-cleanup.convert_to_enhanced_for_loop=true
-cleanup.correct_indentation=true
-cleanup.format_source_code=true
-cleanup.format_source_code_changes_only=false
-cleanup.make_local_variable_final=true
-cleanup.make_parameters_final=true
-cleanup.make_private_fields_final=true
-cleanup.make_type_abstract_if_missing_method=false
-cleanup.make_variable_declarations_final=true
-cleanup.never_use_blocks=false
-cleanup.never_use_parentheses_in_expressions=true
-cleanup.organize_imports=true
-cleanup.qualify_static_field_accesses_with_declaring_class=true
-cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-cleanup.qualify_static_member_accesses_with_declaring_class=true
-cleanup.qualify_static_method_accesses_with_declaring_class=true
-cleanup.remove_private_constructors=true
-cleanup.remove_trailing_whitespaces=true
-cleanup.remove_trailing_whitespaces_all=true
-cleanup.remove_trailing_whitespaces_ignore_empty=false
-cleanup.remove_unnecessary_casts=true
-cleanup.remove_unnecessary_nls_tags=true
-cleanup.remove_unused_imports=true
-cleanup.remove_unused_local_variables=false
-cleanup.remove_unused_private_fields=true
-cleanup.remove_unused_private_members=false
-cleanup.remove_unused_private_methods=true
-cleanup.remove_unused_private_types=true
-cleanup.sort_members=false
-cleanup.sort_members_all=false
-cleanup.use_blocks=true
-cleanup.use_blocks_only_for_return_and_throw=false
-cleanup.use_parentheses_in_expressions=false
-cleanup.use_this_for_non_static_field_access=true
-cleanup.use_this_for_non_static_field_access_only_if_necessary=false
-cleanup.use_this_for_non_static_method_access=false
-cleanup.use_this_for_non_static_method_access_only_if_necessary=false
-cleanup_profile=_CustomPapyrusCleanUpProfile
-cleanup_settings_version=2
-eclipse.preferences.version=1
-editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-sp_cleanup.add_default_serial_version_id=true
-sp_cleanup.add_generated_serial_version_id=false
-sp_cleanup.add_missing_annotations=true
-sp_cleanup.add_missing_deprecated_annotations=true
-sp_cleanup.add_missing_methods=false
-sp_cleanup.add_missing_nls_tags=false
-sp_cleanup.add_missing_override_annotations=true
-sp_cleanup.add_missing_override_annotations_interface_methods=false
-sp_cleanup.add_serial_version_id=false
-sp_cleanup.always_use_blocks=true
-sp_cleanup.always_use_parentheses_in_expressions=false
-sp_cleanup.always_use_this_for_non_static_field_access=true
-sp_cleanup.always_use_this_for_non_static_method_access=false
-sp_cleanup.convert_to_enhanced_for_loop=true
-sp_cleanup.correct_indentation=true
-sp_cleanup.format_source_code=true
-sp_cleanup.format_source_code_changes_only=false
-sp_cleanup.make_local_variable_final=true
-sp_cleanup.make_parameters_final=true
-sp_cleanup.make_private_fields_final=true
-sp_cleanup.make_type_abstract_if_missing_method=false
-sp_cleanup.make_variable_declarations_final=true
-sp_cleanup.never_use_blocks=false
-sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=true
-sp_cleanup.organize_imports=true
-sp_cleanup.qualify_static_field_accesses_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_with_declaring_class=true
-sp_cleanup.qualify_static_method_accesses_with_declaring_class=true
-sp_cleanup.remove_private_constructors=true
-sp_cleanup.remove_trailing_whitespaces=true
-sp_cleanup.remove_trailing_whitespaces_all=true
-sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
-sp_cleanup.remove_unnecessary_casts=true
-sp_cleanup.remove_unnecessary_nls_tags=true
-sp_cleanup.remove_unused_imports=true
-sp_cleanup.remove_unused_local_variables=false
-sp_cleanup.remove_unused_private_fields=true
-sp_cleanup.remove_unused_private_members=false
-sp_cleanup.remove_unused_private_methods=true
-sp_cleanup.remove_unused_private_types=true
-sp_cleanup.sort_members=false
-sp_cleanup.sort_members_all=false
-sp_cleanup.use_blocks=true
-sp_cleanup.use_blocks_only_for_return_and_throw=false
-sp_cleanup.use_parentheses_in_expressions=true
-sp_cleanup.use_this_for_non_static_field_access=true
-sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=false
-sp_cleanup.use_this_for_non_static_method_access=false
-sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/META-INF/MANIFEST.MF b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/META-INF/MANIFEST.MF
deleted file mode 100644
index 280fb4fab18..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,26 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Papyrus CompEMF are
-Bundle-SymbolicName: org.eclipse.papyrus.infra.emf.compare;singleton:=true
-Bundle-Version: 0.9.0.qualifier
-Bundle-Activator: org.eclipse.papyrus.infra.emf.compare.Activator
-Bundle-Vendor: Eclipse Modeling Project
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.team.ui,
- org.eclipse.emf.ecore,
- org.eclipse.emf.compare.match,
- org.eclipse.emf.compare,
- org.eclipse.emf.compare.diff,
- org.eclipse.emf.compare.ui,
- org.eclipse.compare,
- com.google.collect,
- org.eclipse.papyrus.infra.services.edit,
- org.eclipse.gmf.runtime.emf.type.core
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-ActivationPolicy: lazy
-Export-Package: org.eclipse.papyrus.infra.emf.compare,
- org.eclipse.papyrus.infra.emf.compare.actions,
- org.eclipse.papyrus.infra.emf.compare.merger,
- org.eclipse.papyrus.infra.emf.compare.merger.provider,
- org.eclipse.papyrus.infra.emf.compare.utils
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/build.properties b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/build.properties
deleted file mode 100644
index 6f20375d6c7..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/plugin.xml b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/plugin.xml
deleted file mode 100644
index c68b79c5e35..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/plugin.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.ui.commands">
- <command
- description="Compare UML Elements"
- id="org.eclipse.papyrus.infra.emf.compare.uml.element.papyrus"
- name="Compare UML Elements">
- </command>
- </extension>
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- commandId="org.eclipse.papyrus.infra.emf.compare.uml.element.papyrus">
- </handler>
- </extension>
- <extension
- point="org.eclipse.emf.compare.diff.mergerprovider">
- <mergerprovider
- fileExtension="uml"
- mergerProviderClass="org.eclipse.papyrus.infra.emf.compare.merger.provider.PapyrusMergerProvider"
- priority="low">
- </mergerprovider>
- </extension>
-
-</plugin>
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/Activator.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/Activator.java
deleted file mode 100644
index d0d62c15e14..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/Activator.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.emf.compare;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.commands.IExecutionListener;
-import org.eclipse.papyrus.infra.core.log.LogHelper;
-import org.eclipse.papyrus.infra.emf.compare.service.SaveEMFCompareListener;
-import org.eclipse.papyrus.infra.emf.compare.utils.CompareEditorConfiguration;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.emf.compare"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- /** listener on the command service to catch the save and saveAll action */
- private IExecutionListener commandServiceListener;
-
- /** this map contains the compare editor configuration */
- private static final Map<IEditorPart, CompareEditorConfiguration> configuration = new HashMap<IEditorPart, CompareEditorConfiguration>();
-
- public static LogHelper log;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(final BundleContext context) throws Exception {
- super.start(context);
- Activator.plugin = this;
- Activator.log = new LogHelper(this);
- //we add a listener on the command service
- this.commandServiceListener = new SaveEMFCompareListener();
- final ICommandService service = (ICommandService)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(ICommandService.class);
- service.addExecutionListener(this.commandServiceListener);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(final BundleContext context) throws Exception {
- Activator.plugin = null;
- //we remove the listener on the command service
- final ICommandService service = (ICommandService)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(ICommandService.class);
- service.removeExecutionListener(this.commandServiceListener);
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return Activator.plugin;
- }
-
- /**
- *
- * @param editor
- * an editor
- * @return
- * the configuration mapped with this editor (can be <code>null</code>)
- */
- public CompareEditorConfiguration getConfigurationFor(final IEditorPart editor) {
- return Activator.configuration.get(editor);
- }
-
- /**
- * map an editor and a configuration
- *
- * @param editor
- * an editor
- * @param configuration
- * a configuration
- */
- public void addConfiguration(final IEditorPart editor, final CompareEditorConfiguration configuration) {
- Activator.configuration.put(editor, configuration);
- }
-
- /**
- * Remove the configuration
- *
- * @param editor
- * a editor
- */
- public void removeConfiguration(final IEditorPart editor) {
- Activator.configuration.remove(editor);
- }
-
-}
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/actions/CompareTwoElementsAction.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/actions/CompareTwoElementsAction.java
deleted file mode 100644
index 01b8af392b8..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/actions/CompareTwoElementsAction.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tatiana Fesenko (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.emf.compare.actions;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.team.internal.ui.actions.TeamAction;
-
-/**
- * Action to compare two arbitrary elements.
- * Availbale in the context menu of the model explorer.
- */
-public class CompareTwoElementsAction extends TeamAction {
-
- @Override
- protected void execute(IAction action) throws InvocationTargetException, InterruptedException {
- // TODO Auto-generated method stub
-
- }
-
-// /* (non-Javadoc)
-// * @see org.eclipse.team.internal.ui.actions.TeamAction#execute(org.eclipse.jface.action.IAction)
-// */
-// protected void execute(IAction action) throws InvocationTargetException, InterruptedException {
-//
-// Object[] selectedElements = getSelection().toArray();
-// if(selectedElements.length != 2) {
-//// Activator.logInfo(Messages.bind(Messages.CompareTwoElementsAction_only_only_element_is_selected, selectedElements.length));
-// return;
-// }
-//
-// EObject left = getElementFor(selectedElements[0]);
-// EObject right = getElementFor(selectedElements[1]);
-// if(left == null) {
-//// Activator.logInfo(Messages.CompareTwoElementsAction_left_element_is_null);
-// return;
-// }
-//
-// if(right == null) {
-//// Activator.logInfo(Messages.CompareTwoElementsAction_right_element_is_null);
-// return;
-// }
-//
-// ComparisonResourceSnapshot snapshot = doContentCompare(left, right);
-// openInCompare(snapshot);
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
-// */
-// public boolean isEnabled() {
-// Object[] selectedElements = getSelection().toArray();
-// if(selectedElements.length != 2) {
-// return false;
-// }
-// EObject left = getElementFor(selectedElements[0]);
-// EObject right = getElementFor(selectedElements[1]);
-// return left != null && right != null;
-// }
-//
-// /**
-// * Open in compare.
-// *
-// * @param snapshot the snapshot
-// */
-// private void openInCompare(ComparisonSnapshot snapshot) {
-// CompareUI.openCompareEditor(new ModelCompareEditorInput(snapshot) {
-//
-// @Override
-// protected ModelContentMergeViewer createMergeViewer(CompareViewerPane pane, CompareConfiguration config) {
-// return new UMLModelContentMergeViewer(pane, config) {
-// @Override
-// protected IMergeViewerContentProvider createMergeViewerContentProvider() {
-// return new ElementContentMergeContentProvider(configuration);
-// }
-// };
-// }
-//
-// @Override
-// public Control createOutlineContents(Composite parent, int direction) {
-// Control result = super.createOutlineContents(parent, direction);
-// structureMergeViewer.setLabelProvider(new UMLStyledStructureLabelProvider(new PapyrusLabelProvider()));
-// return result;
-// }
-//
-// });
-// }
-//
-// /**
-// * Do content compare.
-// *
-// * @param left the left
-// * @param right the right
-// * @return the comparison resource snapshot
-// */
-// protected ComparisonResourceSnapshot doContentCompare(final EObject left, final EObject right) {
-// final ComparisonResourceSnapshot snapshot = DiffFactory.eINSTANCE.createComparisonResourceSnapshot();
-//
-// try {
-// PlatformUI.getWorkbench().getProgressService().busyCursorWhile(new IRunnableWithProgress() {
-//
-// public void run(IProgressMonitor monitor) throws InterruptedException {
-// final MatchModel match = contentMatch(left, right, monitor);
-// final DiffModel diff = contentDiff(left, right, match);
-//
-// snapshot.setDiff(diff);
-// snapshot.setMatch(match);
-// }
-//
-// });
-// } catch (final InterruptedException e) {
-// Activator.logError(e);
-// } catch (final EMFCompareException e) {
-// Activator.logError(e);
-// } catch (final InvocationTargetException e) {
-// Activator.logError(e);
-// }
-// return snapshot;
-// }
-//
-// /**
-// * Content diff.
-// *
-// * @param left the left
-// * @param right the right
-// * @param match the match
-// * @return the diff model
-// */
-// protected DiffModel contentDiff(final EObject left, final EObject right, final MatchModel match) {
-// ElementContentDiffEngine engine = new ElementContentDiffEngine(left, right);
-// final DiffModel diff = engine.doDiff(match);
-// final Collection<AbstractDiffExtension> extensions = DiffService.getCorrespondingDiffExtensions(match);
-// for(final AbstractDiffExtension ext : extensions) {
-// if(ext != null) {
-// ext.visit(diff);
-// }
-// }
-//
-// engine.reset();
-// return diff;
-// }
-//
-// /**
-// * Content match.
-// *
-// * @param left the left
-// * @param right the right
-// * @param monitor the monitor
-// * @return the match model
-// * @throws InterruptedException the interrupted exception
-// */
-// protected MatchModel contentMatch(final EObject left, final EObject right, IProgressMonitor monitor) throws InterruptedException {
-// final Map<String, Object> options = new EMFCompareMap<String, Object>();
-// options.put(MatchOptions.OPTION_PROGRESS_MONITOR, monitor);
-// options.put(MatchOptions.OPTION_MATCH_SCOPE_PROVIDER, new GenericMatchScopeProvider(left.eResource(), right.eResource()));
-// options.put(MatchOptions.OPTION_IGNORE_ID, Boolean.TRUE);
-// options.put(MatchOptions.OPTION_IGNORE_XMI_ID, Boolean.TRUE);
-//
-// final IMatchEngine matchEngine = new ElementContentMatchEngine(left, right);
-// final MatchModel match = matchEngine.contentMatch(left, right, options);
-// return match;
-// }
-//
-// /**
-// * Gets the element for.
-// *
-// * @param object the object
-// * @return the element for
-// */
-// protected EObject getElementFor(Object object) {
-// if(object instanceof IAdaptable) {
-// return (EObject)((IAdaptable)object).getAdapter(EObject.class);
-// }
-//
-// if(object instanceof EObject) {
-// return (EObject)object;
-// }
-// return null;
-// }
-
-}
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/AbstractPapyrusDefaultMerger.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/AbstractPapyrusDefaultMerger.java
deleted file mode 100644
index b8d51df7396..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/AbstractPapyrusDefaultMerger.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.emf.compare.merger;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.compare.diff.merge.DefaultMerger;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-
-public abstract class AbstractPapyrusDefaultMerger extends DefaultMerger {
-
- protected Command getCommand(final Object objectToEdit, final IEditCommandRequest request) {
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(objectToEdit);
- if(provider != null) {
- return new GMFtoEMFCommandWrapper(provider.getEditCommand(request));
- }
- return null;
- }
-
- protected TransactionalEditingDomain getEditingDomain() {
- //FIXME
- return TransactionalEditingDomain.Factory.INSTANCE.createEditingDomain();
- }
-
- protected Command getDestroyElementCommand(final EObject element) {
- final TransactionalEditingDomain domain = getEditingDomain();
- Command command = null;
- if(domain != null) {
- final IEditCommandRequest request = new DestroyElementRequest(domain, element, false);
- command = getCommand(element, request);
- }
- return command;
- }
-
- protected boolean usePapyrusEditService() {
- return false;
- }
-
-
-
- public abstract Command doApplyInOriginCommand();
-
- public abstract Command doUndoInTargetCommand();
-}
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/AttributeChangeLeftTargetMerger.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/AttributeChangeLeftTargetMerger.java
deleted file mode 100644
index 12389a92dc6..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/AttributeChangeLeftTargetMerger.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 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.papyrus.infra.emf.compare.merger;
-
-import java.util.List;
-
-import org.eclipse.emf.compare.EMFComparePlugin;
-import org.eclipse.emf.compare.FactoryException;
-import org.eclipse.emf.compare.diff.merge.DefaultMerger;
-import org.eclipse.emf.compare.diff.metamodel.AttributeChangeLeftTarget;
-import org.eclipse.emf.compare.util.EFactory;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * Merger for an {@link AttributeChangeLeftTarget} operation.<br/>
- * <p>
- * Are considered for this merger :
- * <ul>
- * <li>{@link RemoveAttribute}</li>
- * <li>{@link RemoteAddAttribute}</li>
- * </ul>
- * </p>
- *
- * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
- */
-public class AttributeChangeLeftTargetMerger extends DefaultMerger {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.api.AbstractMerger#doApplyInOrigin()
- */
- @Override
- public void doApplyInOrigin() {
- final AttributeChangeLeftTarget theDiff = (AttributeChangeLeftTarget)this.diff;
- final EObject origin = theDiff.getLeftElement();
- final Object value = theDiff.getLeftTarget();
- final EAttribute attr = theDiff.getAttribute();
- try {
- EFactory.eRemove(origin, attr.getName(), value);
- } catch (FactoryException e) {
- EMFComparePlugin.log(e, true);
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.api.AbstractMerger#doUndoInTarget()
- */
- @Override
- public void doUndoInTarget() {
- final AttributeChangeLeftTarget theDiff = (AttributeChangeLeftTarget)this.diff;
- final EObject target = theDiff.getRightElement();
- final Object value = theDiff.getLeftTarget();
- final EAttribute attr = theDiff.getAttribute();
- try {
- int valueIndex = -1;
- if (attr.isMany()) {
- final EObject leftElement = theDiff.getLeftElement();
- final Object leftValues = leftElement.eGet(attr);
- if (leftValues instanceof List) {
- final List leftValuesList = (List)leftValues;
- valueIndex = leftValuesList.indexOf(value);
- }
- }
- EFactory.eAdd(target, attr.getName(), value, valueIndex);
- } catch (FactoryException e) {
- EMFComparePlugin.log(e, true);
- }
- }
-}
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/AttributeChangeRightTargetMerger.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/AttributeChangeRightTargetMerger.java
deleted file mode 100644
index 2017294052f..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/AttributeChangeRightTargetMerger.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 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.papyrus.infra.emf.compare.merger;
-
-import java.util.List;
-
-import org.eclipse.emf.compare.EMFComparePlugin;
-import org.eclipse.emf.compare.FactoryException;
-import org.eclipse.emf.compare.diff.merge.DefaultMerger;
-import org.eclipse.emf.compare.diff.metamodel.AttributeChangeRightTarget;
-import org.eclipse.emf.compare.util.EFactory;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * Merger for an {@link AttributeChangeRightTarget} operation.<br/>
- * <p>
- * Are considered for this merger :
- * <ul>
- * <li>{@link AddAttribute}</li>
- * <li>{@link RemoteRemoveAttribute}</li>
- * </ul>
- * </p>
- *
- * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
- */
-public class AttributeChangeRightTargetMerger extends DefaultMerger {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.api.AbstractMerger#doApplyInOrigin()
- */
- @Override
- public void doApplyInOrigin() {
- final AttributeChangeRightTarget theDiff = (AttributeChangeRightTarget)this.diff;
- final EObject origin = theDiff.getLeftElement();
- final Object value = theDiff.getRightTarget();
- final EAttribute attr = theDiff.getAttribute();
- try {
- int valueIndex = -1;
- if (attr.isMany()) {
- final EObject rightElement = theDiff.getRightElement();
- final Object rightValues = rightElement.eGet(attr);
- if (rightValues instanceof List) {
- final List rightValuesList = (List)rightValues;
- valueIndex = rightValuesList.indexOf(value);
- }
- }
- EFactory.eAdd(origin, attr.getName(), value, valueIndex);
- } catch (FactoryException e) {
- EMFComparePlugin.log(e, true);
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.api.AbstractMerger#doUndoInTarget()
- */
- @Override
- public void doUndoInTarget() {
- final AttributeChangeRightTarget theDiff = (AttributeChangeRightTarget)this.diff;
- final EObject target = theDiff.getRightElement();
- final Object value = theDiff.getRightTarget();
- final EAttribute attr = theDiff.getAttribute();
- try {
- EFactory.eRemove(target, attr.getName(), value);
- } catch (FactoryException e) {
- EMFComparePlugin.log(e, true);
- }
- }
-}
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/AttributeOrderChangeMerger.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/AttributeOrderChangeMerger.java
deleted file mode 100644
index 6117d20fda7..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/AttributeOrderChangeMerger.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 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.papyrus.infra.emf.compare.merger;
-
-import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.compare.diff.merge.DefaultMerger;
-import org.eclipse.emf.compare.diff.metamodel.AttributeOrderChange;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EEnumLiteral;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.FeatureMap;
-
-/**
- * Merger for an {@link AttributeOrderChange} operation.
- *
- * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
- */
-@SuppressWarnings("unchecked")
-public class AttributeOrderChangeMerger extends DefaultMerger {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.DefaultMerger#doApplyInOrigin()
- */
- @Override
- public void doApplyInOrigin() {
- final AttributeOrderChange theDiff = (AttributeOrderChange)this.diff;
- final EAttribute attribute = theDiff.getAttribute();
- final EObject leftElement = theDiff.getLeftElement();
- final EObject rightElement = theDiff.getRightElement();
-
- final List<Object> leftList = (List<Object>)leftElement.eGet(attribute);
- final List<Object> rightList = (List<Object>)rightElement.eGet(attribute);
-
- /*
- * We need to transform the "left" list into the "right" list, modulo missing values. In practical
- * terms, this means that we'll simply leave untouched any element that has no match in the "right"
- * list (elements that were deleted) while reordering the others in the order they have in the "right"
- * list.
- */
- final List<Object> leftCopy = new ArrayList<Object>(leftList);
- final List<Object> result = new ArrayList<Object>(leftList.size());
- // Add all unmatched values in the result list
- for (int i = 0; i < leftList.size(); i++) {
- final Object left = leftList.get(i);
-
- boolean hasMatch = false;
- for (int j = 0; !hasMatch && j < rightList.size(); j++) {
- hasMatch = !areDistinctValues(left, rightList.get(j));
- }
-
- if (!hasMatch) {
- leftCopy.remove(left);
- result.add(left);
- }
- }
- // Then reorder according to the right list's order
- for (int i = 0; i < rightList.size(); i++) {
- final Object right = rightList.get(i);
-
- Object leftMatch = null;
- for (int j = 0; leftMatch == null && j < leftCopy.size(); j++) {
- if (!areDistinctValues(right, leftCopy.get(j))) {
- leftMatch = leftCopy.get(j);
- }
- }
-
- if (leftMatch != null) {
- leftCopy.remove(leftMatch);
- result.add(leftMatch);
- }
- }
- // Finally, set the value of our attribute to this new list
- leftElement.eSet(attribute, result);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.DefaultMerger#doUndoInTarget()
- */
- @Override
- public void doUndoInTarget() {
- final AttributeOrderChange theDiff = (AttributeOrderChange)this.diff;
- final EAttribute attribute = theDiff.getAttribute();
- final EObject leftElement = theDiff.getLeftElement();
- final EObject rightElement = theDiff.getRightElement();
-
- final List<Object> leftList = (List<Object>)leftElement.eGet(attribute);
- final List<Object> rightList = (List<Object>)rightElement.eGet(attribute);
-
- /*
- * We need to transform the "right" list into the "left" list, modulo missing values. In practical
- * terms, this means that we'll simply leave untouched any element that has no match in the "left"
- * list (elements that were added) while reordering the others in the order they have in the "left"
- * list.
- */
- final List<Object> rightCopy = new ArrayList<Object>(rightList);
- final List<Object> result = new ArrayList<Object>(rightList.size());
- // Add all unmatched values in the result list
- for (int i = 0; i < rightList.size(); i++) {
- final Object right = rightList.get(i);
-
- boolean hasMatch = false;
- for (int j = 0; !hasMatch && j < leftList.size(); j++) {
- hasMatch = !areDistinctValues(right, leftList.get(j));
- }
-
- if (!hasMatch) {
- rightCopy.remove(right);
- result.add(right);
- }
- }
- // Then reorder according to the left list's order
- for (int i = 0; i < leftList.size(); i++) {
- final Object left = leftList.get(i);
-
- Object rightMatch = null;
- for (int j = 0; rightMatch == null && j < rightCopy.size(); j++) {
- if (!areDistinctValues(left, rightCopy.get(j))) {
- rightMatch = rightCopy.get(j);
- }
- }
-
- if (rightMatch != null) {
- rightCopy.remove(rightMatch);
- result.add(rightMatch);
- }
- }
- // Finally, set the value of our attribute to this new list
- rightElement.eSet(attribute, result);
- }
-
- /**
- * Compare values by equality handling specifics of EMF.
- *
- * @param left
- * object 1.
- * @param right
- * object 2
- * @return true if both objects are not equals.
- */
- private static boolean areDistinctValues(Object left, Object right) {
- final boolean distinct;
- if (left instanceof EEnumLiteral && right instanceof EEnumLiteral) {
- final StringBuilder value1 = new StringBuilder();
- value1.append(((EEnumLiteral)left).getLiteral()).append(((EEnumLiteral)left).getValue());
- final StringBuilder value2 = new StringBuilder();
- value2.append(((EEnumLiteral)right).getLiteral()).append(((EEnumLiteral)right).getValue());
- distinct = !value1.toString().equals(value2.toString());
- } else if (left != null && left.getClass().isArray()) {
- // [299641] compare arrays by their content instead of instance equality
- distinct = areDistinctArrays(left, right);
- } else if (left instanceof FeatureMap.Entry || right instanceof FeatureMap.Entry) {
- distinct = areDistinctEntries(left, right);
- } else {
- distinct = left != null && !left.equals(right) || left == null && left != right;
- }
- return distinct;
- }
-
- /**
- * Compares the two given value while assuming one or both is a {@link FeatureMap.Entry}.
- *
- * @param left
- * Left of the two values to compare.
- * @param right
- * Right of the two values to compare.
- * @return <code>true</code> if the two values are distinct, <code>false</code> otherwise.
- */
- private static boolean areDistinctEntries(Object left, Object right) {
- final boolean distinct;
- if (left instanceof FeatureMap.Entry && right instanceof FeatureMap.Entry) {
- distinct = areDistinctValues(((FeatureMap.Entry)left).getValue(),
- ((FeatureMap.Entry)right).getValue());
- } else if (left instanceof FeatureMap.Entry) {
- distinct = areDistinctValues(((FeatureMap.Entry)left).getValue(), right);
- } else {
- distinct = areDistinctValues(left, ((FeatureMap.Entry)right).getValue());
- }
- return distinct;
- }
-
- /**
- * Compares two values as arrays, checking that the length and content of both matches each other.
- *
- * @param left
- * The value of the attribute from the left compare resource.
- * @param right
- * The value of the attribute from the right compare resource.
- * @return <code>true</code> if the <code>left</code> value is distinct from the <code>right</code> value.
- */
- private static boolean areDistinctArrays(Object left, Object right) {
- boolean distinct = false;
- // we know left is a non-null array.
- if (right == null || !right.getClass().isArray()) {
- distinct = true;
- } else {
- final int leftLength = Array.getLength(left);
- final int rightLength = Array.getLength(right);
- if (leftLength != rightLength) {
- distinct = true;
- } else {
- for (int i = 0; i < leftLength; i++) {
- final Object leftElement = Array.get(left, i);
- final Object rightElement = Array.get(right, i);
- if (areDistinctValues(leftElement, rightElement)) {
- distinct = true;
- break;
- }
- }
- }
- }
- return distinct;
- }
-}
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/DiffExtensionMerger.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/DiffExtensionMerger.java
deleted file mode 100644
index f6342acc602..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/DiffExtensionMerger.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 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.papyrus.infra.emf.compare.merger;
-
-import org.eclipse.emf.compare.diff.merge.DefaultMerger;
-
-/**
- * Merger for an {@link DiffExtension} operation.<br/>
- *
- * @author <a href="mailto:cedric.brun@obeo.fr">Cedric Brun</a>
- */
-public class DiffExtensionMerger extends DefaultMerger {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.api.AbstractMerger#doApplyInOrigin()
- */
-
- @Override
- public void doApplyInOrigin() {
- // TODO code diff extension merger
- // final AbstractDiffExtension extension = (AbstractDiffExtension)this.diff;
- // if (!extension.providesMerger()) {
- // /*
- // * No merger is provided so we'll browse the hidden elements and merge them..
- // */
- // for (final Iterator<DiffElement> iterator = extension.getHideElements().iterator();
- // iterator.hasNext(); ) {
- // final DiffElement hidden = iterator.next();
- // final AbstractMerger merger = MergeFactory.createMerger(hidden);
- // merger.applyInOrigin();
- // }
- // } else {
- // extension.getMerger().applyInOrigin();
- // }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.api.AbstractMerger#doUndoInTarget()
- */
- @Override
- public void doUndoInTarget() {
- // TODO code diff extension merger
- // final AbstractDiffExtension extension = (AbstractDiffExtension)this.diff;
- // if (!extension.providesMerger()) {
- // /*
- // * No merger is provided so we'll browse the hidden elements and merge them..
- // */
- // for (final Iterator<DiffElement> iterator = extension.getHideElements().iterator();
- // iterator.hasNext(); ) {
- // final DiffElement hidden = iterator.next();
- // final AbstractMerger merger = MergeFactory.createMerger(hidden);
- // merger.undoInTarget();
- // }
- // } else {
- // extension.getMerger().undoInTarget();
- // }
- }
-}
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/DiffGroupMerger.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/DiffGroupMerger.java
deleted file mode 100644
index b04da1a0f90..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/DiffGroupMerger.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 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.papyrus.infra.emf.compare.merger;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.compare.diff.merge.DefaultMerger;
-import org.eclipse.emf.compare.diff.merge.service.MergeService;
-import org.eclipse.emf.compare.diff.metamodel.DiffElement;
-
-/**
- * This merger will handle DiffGroup merging by recursively create mergers on each of its contents.
- *
- * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
- */
-public class DiffGroupMerger extends DefaultMerger {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.DefaultMerger#applyInOrigin()
- */
- @Override
- public void applyInOrigin() {
- // Creates a temporary list to avoid ConcurentModificationExceptions
- final List<DiffElement> subDiffs = new ArrayList<DiffElement>(diff.getSubDiffElements());
- MergeService.merge(subDiffs, false);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.DefaultMerger#undoInTarget()
- */
- @Override
- public void undoInTarget() {
- // Creates a temporary list to avoid ConcurentModificationExceptions
- final List<DiffElement> subDiffs = new ArrayList<DiffElement>(diff.getSubDiffElements());
- MergeService.merge(subDiffs, true);
- }
-}
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/ModelElementChangeRightTargetMerger.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/ModelElementChangeRightTargetMerger.java
deleted file mode 100644
index ae884c33194..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/ModelElementChangeRightTargetMerger.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 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.papyrus.infra.emf.compare.merger;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.emf.compare.EMFComparePlugin;
-import org.eclipse.emf.compare.FactoryException;
-import org.eclipse.emf.compare.diff.merge.DefaultMerger;
-import org.eclipse.emf.compare.diff.metamodel.DiffElement;
-import org.eclipse.emf.compare.diff.metamodel.ModelElementChangeRightTarget;
-import org.eclipse.emf.compare.diff.metamodel.ReferenceChangeRightTarget;
-import org.eclipse.emf.compare.diff.metamodel.ReferenceOrderChange;
-import org.eclipse.emf.compare.util.EFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-
-/**
- * Merger for an {@link ModelElementChangeRightTarget} operation.<br/>
- * <p>
- * Are considered for this merger :
- * <ul>
- * <li>RemoveModelElement</li>
- * <li>RemoteAddModelElement</li>
- * </ul>
- * </p>
- *
- * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
- */
-public class ModelElementChangeRightTargetMerger extends DefaultMerger {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.api.AbstractMerger#doApplyInOrigin()
- */
- @Override
- public void doApplyInOrigin() {
- final ModelElementChangeRightTarget theDiff = (ModelElementChangeRightTarget)this.diff;
- final EObject origin = theDiff.getLeftParent();
- final EObject element = theDiff.getRightElement();
- final EObject newOne = copy(element);
- final EReference ref = element.eContainmentFeature();
- if (ref != null) {
- try {
- int expectedIndex = -1;
- if (ref.isMany()) {
- final Object containmentRefVal = element.eContainer().eGet(ref);
- if (containmentRefVal instanceof List<?>) {
- @SuppressWarnings("unchecked")
- final List<EObject> listVal = (List<EObject>)containmentRefVal;
- expectedIndex = listVal.indexOf(element);
- }
- }
- EFactory.eAdd(origin, ref.getName(), newOne, expectedIndex, true);
- setXMIID(newOne, getXMIID(element));
- } catch (final FactoryException e) {
- EMFComparePlugin.log(e, true);
- }
- } else if (origin == null && getDiffModel().getLeftRoots().size() > 0) {
- getDiffModel().getLeftRoots().get(0).eResource().getContents().add(newOne);
- } else if (origin != null) {
- origin.eResource().getContents().add(newOne);
- } else {
- // FIXME Throw exception : couldn't merge this
- }
- // we should now have a look for AddReferencesLinks needing this object
- final Iterator<EObject> siblings = getDiffModel().eAllContents();
- while (siblings.hasNext()) {
- final DiffElement op = (DiffElement)siblings.next();
- if (op instanceof ReferenceChangeRightTarget) {
- final ReferenceChangeRightTarget link = (ReferenceChangeRightTarget)op;
- // now if I'm in the target References I should put my copy in the origin
- if (link.getLeftTarget() != null && link.getLeftTarget() == element) {
- link.setRightTarget(newOne);
- }
- } else if (op instanceof ReferenceOrderChange) {
- final ReferenceOrderChange link = (ReferenceOrderChange)op;
- if (link.getLeftElement() == origin && link.getReference() == ref) {
- final ListIterator<EObject> targetIterator = link.getLeftTarget().listIterator();
- boolean replaced = false;
- while (!replaced && targetIterator.hasNext()) {
- final EObject target = targetIterator.next();
- if (target.eIsProxy()
- && equalProxyURIs(((InternalEObject)target).eProxyURI(),
- EcoreUtil.getURI(element))) {
- targetIterator.set(newOne);
- replaced = true;
- }
- }
- }
- }
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.api.AbstractMerger#doUndoInTarget()
- */
- @Override
- public void doUndoInTarget() {
- final ModelElementChangeRightTarget theDiff = (ModelElementChangeRightTarget)this.diff;
- final EObject element = theDiff.getRightElement();
- final EObject parent = theDiff.getRightElement().eContainer();
- EcoreUtil.remove(element);
- // now removes all the dangling references
- removeDanglingReferences(parent);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.DefaultMerger#canUndoInTarget()
- */
- @Override
- public boolean canUndoInTarget() {
- final ModelElementChangeRightTarget theDiff = (ModelElementChangeRightTarget)this.diff;
- final boolean isRightElementNotNull = theDiff.getRightElement() != null;
- return isRightElementNotNull;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.DefaultMerger#getDependencies(boolean)
- */
- @Override
- protected List<DiffElement> getDependencies(boolean applyInOrigin) {
- if (applyInOrigin) {
- return diff.getRequires();
- }
- return super.getDependencies(applyInOrigin);
- }
-}
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/MoveModelElementMerger.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/MoveModelElementMerger.java
deleted file mode 100644
index e48facd10b0..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/MoveModelElementMerger.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 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.papyrus.infra.emf.compare.merger;
-
-import java.util.List;
-
-import org.eclipse.emf.compare.EMFComparePlugin;
-import org.eclipse.emf.compare.FactoryException;
-import org.eclipse.emf.compare.diff.merge.DefaultMerger;
-import org.eclipse.emf.compare.diff.metamodel.MoveModelElement;
-import org.eclipse.emf.compare.util.EFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-
-/**
- * Merger for a {@link MoveModelElement} operation.
- *
- * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
- */
-public class MoveModelElementMerger extends DefaultMerger {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.api.AbstractMerger#doApplyInOrigin()
- */
- @SuppressWarnings("unchecked")
- @Override
- public void doApplyInOrigin() {
- final MoveModelElement theDiff = (MoveModelElement)this.diff;
- final EObject leftTarget = theDiff.getLeftTarget();
- final EObject leftElement = theDiff.getLeftElement();
- final EReference ref = theDiff.getRightElement().eContainmentFeature();
- if (ref != null) {
- // ordering handling:
- int index = -1;
- final EObject rightElementParent = theDiff.getRightElement().eContainer();
- final Object rightRefValue = rightElementParent.eGet(ref);
- if (rightRefValue instanceof List) {
- final List<Object> refRightValueList = (List<Object>)rightRefValue;
- index = refRightValueList.indexOf(theDiff.getRightElement());
- }
-
- try {
- // We'll store the element's ID because moving an element deletes its XMI ID
- final String elementID = getXMIID(leftElement);
- EcoreUtil.remove(leftElement);
- EFactory.eAdd(leftTarget, ref.getName(), leftElement, index, true);
- // Sets anew the element's ID
- setXMIID(leftElement, elementID);
- } catch (FactoryException e) {
- EMFComparePlugin.log(e, true);
- }
- } else {
- // shouldn't be here
- assert false;
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.api.AbstractMerger#doUndoInTarget()
- */
- @SuppressWarnings("unchecked")
- @Override
- public void doUndoInTarget() {
- final MoveModelElement theDiff = (MoveModelElement)this.diff;
- final EObject rightTarget = theDiff.getRightTarget();
- final EObject rightElement = theDiff.getRightElement();
- final EReference ref = theDiff.getLeftElement().eContainmentFeature();
- if (ref != null) {
- // ordering handling:
- int index = -1;
- final EObject leftElementParent = theDiff.getLeftElement().eContainer();
- final Object leftRefValue = leftElementParent.eGet(ref);
- if (leftRefValue instanceof List) {
- final List<Object> refLeftValueList = (List<Object>)leftRefValue;
- index = refLeftValueList.indexOf(theDiff.getLeftElement());
- }
-
- try {
- final String elementID = getXMIID(rightElement);
- EcoreUtil.remove(rightElement);
- EFactory.eAdd(rightTarget, ref.getName(), rightElement, index, true);
- setXMIID(rightElement, elementID);
- } catch (FactoryException e) {
- EMFComparePlugin.log(e, true);
- }
- } else {
- // shouldn't be here
- assert false;
- }
- }
-}
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/PapyrusModelElementChangeLeftTargetMerger.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/PapyrusModelElementChangeLeftTargetMerger.java
deleted file mode 100644
index b92e8cbcec3..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/PapyrusModelElementChangeLeftTargetMerger.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 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.papyrus.infra.emf.compare.merger;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.compare.EMFComparePlugin;
-import org.eclipse.emf.compare.FactoryException;
-import org.eclipse.emf.compare.diff.internal.merge.impl.ModelElementChangeLeftTargetMerger;
-import org.eclipse.emf.compare.diff.metamodel.DiffElement;
-import org.eclipse.emf.compare.diff.metamodel.ModelElementChangeLeftTarget;
-import org.eclipse.emf.compare.diff.metamodel.ReferenceChangeLeftTarget;
-import org.eclipse.emf.compare.diff.metamodel.ReferenceOrderChange;
-import org.eclipse.emf.compare.util.EFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.papyrus.infra.emf.compare.Activator;
-import org.eclipse.papyrus.infra.emf.compare.merger.provider.PapyrusMergeCommandProvider;
-import org.eclipse.papyrus.infra.emf.compare.utils.CompareEditorConfiguration;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Merger for an {@link ModelElementChangeLeftTarget} operation.<br/>
- * <p>
- * Are considered for this merger :
- * <ul>
- * <li>AddModelElement</li>
- * <li>RemoteRemoveModelElement</li>
- * </ul>
- * </p>
- *
- * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
- */
-public class PapyrusModelElementChangeLeftTargetMerger extends ModelElementChangeLeftTargetMerger {
-
-private boolean useEditService(){
- CompareEditorConfiguration config = getConfiguration();
- return config != null && config.isEditServiceUsing();
-}
-
-private CompareEditorConfiguration getConfiguration(){
- IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- return Activator.getDefault().getConfigurationFor(editor);
-}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.api.AbstractMerger#doApplyInOrigin()
- */
- @Override
- protected void doApplyInOrigin() {
-
- if(useEditService()) {
- System.out.println("Synchronization avec le diagramme : " + useEditService());
- final ModelElementChangeLeftTarget theDiff = (ModelElementChangeLeftTarget)this.diff;
- final EObject element = theDiff.getLeftElement();
- TransactionalEditingDomain domain = getConfiguration().getEditingDomain();
- Command cmd = PapyrusMergeCommandProvider.INSTANCE.getDestroyCommand(domain, element);
- domain.getCommandStack().execute(cmd);
- } else {
- System.out.println("Synchronization avec le diagramme : " + useEditService());
- super.doApplyInOrigin();
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.api.AbstractMerger#doUndoInTarget()
- */
- @Override
- protected void doUndoInTarget() {
- final ModelElementChangeLeftTarget theDiff = (ModelElementChangeLeftTarget)this.diff;
- // we should copy the element to the Origin one.
- final EObject origin = theDiff.getRightParent();
- final EObject element = theDiff.getLeftElement();
- final EObject newOne = copy(element);
- final EReference ref = element.eContainmentFeature();
- if(ref != null) {
- try {
- int elementIndex = -1;
- if(ref.isMany()) {
- final Object containmentRefVal = element.eContainer().eGet(ref);
- if(containmentRefVal instanceof List<?>) {
- @SuppressWarnings("unchecked")
- final List<EObject> listVal = (List<EObject>)containmentRefVal;
- elementIndex = listVal.indexOf(element);
- }
- }
- EFactory.eAdd(origin, ref.getName(), newOne, elementIndex, true);
- setXMIID(newOne, getXMIID(element));
- } catch (final FactoryException e) {
- EMFComparePlugin.log(e, true);
- }
- } else if(origin == null && getDiffModel().getRightRoots().size() > 0) {
- getDiffModel().getRightRoots().get(0).eResource().getContents().add(newOne);
- } else if(origin != null) {
- origin.eResource().getContents().add(newOne);
- } else {
- // FIXME throw exception : couldn't merge this
- }
- // we should now have a look for RemovedReferencesLinks needing elements to apply
- final Iterator<EObject> siblings = getDiffModel().eAllContents();
- while(siblings.hasNext()) {
- final Object op = siblings.next();
- if(op instanceof ReferenceChangeLeftTarget) {
- final ReferenceChangeLeftTarget link = (ReferenceChangeLeftTarget)op;
- // now if I'm in the target References I should put my copy in the origin
- if(link.getRightTarget() != null && link.getRightTarget() == element) {
- link.setLeftTarget(newOne);
- }
- } else if(op instanceof ReferenceOrderChange) {
- final ReferenceOrderChange link = (ReferenceOrderChange)op;
- if(link.getRightElement() == origin && link.getReference() == ref) {
- final ListIterator<EObject> targetIterator = link.getRightTarget().listIterator();
- boolean replaced = false;
- while(!replaced && targetIterator.hasNext()) {
- final EObject target = targetIterator.next();
- if(target.eIsProxy() && equalProxyURIs(((InternalEObject)target).eProxyURI(), EcoreUtil.getURI(element))) {
- targetIterator.set(newOne);
- replaced = true;
- }
- }
- }
- }
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.DefaultMerger#getDependencies(boolean)
- */
- @Override
- protected List<DiffElement> getDependencies(boolean applyInOrigin) {
- if(!applyInOrigin) {
- return diff.getRequires();
- }
- return super.getDependencies(applyInOrigin);
- }
-
- public Command doApplyInOriginCommand() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Command doUndoInTargetCommand() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/PapyrusUpdateAttributeMerger.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/PapyrusUpdateAttributeMerger.java
deleted file mode 100644
index ce96c500e57..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/PapyrusUpdateAttributeMerger.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.eclipse.papyrus.infra.emf.compare.merger;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.compare.EMFComparePlugin;
-import org.eclipse.emf.compare.FactoryException;
-import org.eclipse.emf.compare.diff.internal.merge.impl.UpdateAttributeMerger;
-import org.eclipse.emf.compare.diff.metamodel.UpdateAttribute;
-import org.eclipse.emf.compare.util.EFactory;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.papyrus.infra.emf.compare.merger.provider.PapyrusMergeCommandProvider;
-import org.eclipse.papyrus.infra.emf.compare.utils.Utils;
-
-
-public class PapyrusUpdateAttributeMerger extends UpdateAttributeMerger {
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.api.AbstractMerger#doApplyInOrigin()
- */
- @Override
- public void doApplyInOrigin() {
- final UpdateAttribute theDiff = (UpdateAttribute)this.diff;
- final EObject element = theDiff.getRightElement();
- final EObject origin = theDiff.getLeftElement();
- final EAttribute attr = theDiff.getAttribute();
- if(Utils.useEditService()) {
- final TransactionalEditingDomain domain = Utils.getConfiguration().getEditingDomain();
- Command cmd = null;
- try {
- cmd = PapyrusMergeCommandProvider.INSTANCE.getSetCommand(domain, origin, origin.eClass().getEStructuralFeature(attr.getName()), EFactory.eGet(element, attr.getName()));
- } catch (final FactoryException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- domain.getCommandStack().execute(cmd);
- } else {
- try {
- EFactory.eSet(origin, attr.getName(), EFactory.eGet(element, attr.getName()));
- } catch (final FactoryException e) {
- EMFComparePlugin.log(e, true);
- }
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.api.AbstractMerger#doUndoInTarget()
- */
- @Override
- public void doUndoInTarget() {
- final UpdateAttribute theDiff = (UpdateAttribute)this.diff;
- final EObject element = theDiff.getRightElement();
- final EObject origin = theDiff.getLeftElement();
- final EAttribute attr = theDiff.getAttribute();
- if(Utils.useEditService()) {
- final TransactionalEditingDomain domain = Utils.getConfiguration().getEditingDomain();
- Command cmd = null;
- try {
- cmd = PapyrusMergeCommandProvider.INSTANCE.getSetCommand(domain, element, element.eClass().getEStructuralFeature(attr.getName()), EFactory.eGet(origin, attr.getName()));
- } catch (final FactoryException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- domain.getCommandStack().execute(cmd);
- } else {
- try {
- EFactory.eSet(element, attr.getName(), EFactory.eGet(origin, attr.getName()));
- } catch (final FactoryException e) {
- EMFComparePlugin.log(e, true);
- }
- }
- }
-}
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/ReferenceChangeLeftTargetMerger.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/ReferenceChangeLeftTargetMerger.java
deleted file mode 100644
index 108a07395d6..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/ReferenceChangeLeftTargetMerger.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 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.papyrus.infra.emf.compare.merger;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.emf.compare.EMFComparePlugin;
-import org.eclipse.emf.compare.FactoryException;
-import org.eclipse.emf.compare.diff.merge.DefaultMerger;
-import org.eclipse.emf.compare.diff.merge.service.MergeService;
-import org.eclipse.emf.compare.diff.metamodel.DiffElement;
-import org.eclipse.emf.compare.diff.metamodel.ReferenceChangeLeftTarget;
-import org.eclipse.emf.compare.diff.metamodel.ReferenceOrderChange;
-import org.eclipse.emf.compare.diff.metamodel.ResourceDependencyChange;
-import org.eclipse.emf.compare.util.EFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-
-/**
- * Merger for an {@link ReferenceChangeLeftTarget} operation.<br/>
- * <p>
- * Are considered for this merger :
- * <ul>
- * <li>AddReferenceValue</li>
- * <li>RemoteRemoveReferenceValue</li>
- * </ul>
- * </p>
- *
- * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
- */
-public class ReferenceChangeLeftTargetMerger extends DefaultMerger {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.DefaultMerger#doApplyInOrigin()
- */
- @Override
- public void doApplyInOrigin() {
- final ReferenceChangeLeftTarget theDiff = (ReferenceChangeLeftTarget)this.diff;
- final EObject element = theDiff.getLeftElement();
- final EObject leftTarget = theDiff.getLeftTarget();
- try {
- EFactory.eRemove(element, theDiff.getReference().getName(), leftTarget);
- } catch (final FactoryException e) {
- EMFComparePlugin.log(e, true);
- }
- // we should now have a look for AddReferencesLinks needing this object
- final Iterator<EObject> siblings = getDiffModel().eAllContents();
- while (siblings.hasNext()) {
- final DiffElement op = (DiffElement)siblings.next();
- if (op instanceof ReferenceChangeLeftTarget) {
- final ReferenceChangeLeftTarget link = (ReferenceChangeLeftTarget)op;
- // now if I'm in the target References I should put my copy in the origin
- if (link.getReference().equals(theDiff.getReference().getEOpposite())
- && link.getLeftTarget().equals(element)) {
- removeFromContainer(link);
- }
- } else if (op instanceof ResourceDependencyChange) {
- final ResourceDependencyChange link = (ResourceDependencyChange)op;
- final Resource res = link.getRoots().get(0).eResource();
- if (res == leftTarget.eResource()) {
- EcoreUtil.remove(link);
- res.unload();
- }
- }
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.DefaultMerger#doUndoInTarget()
- */
- @Override
- public void doUndoInTarget() {
- final ReferenceChangeLeftTarget theDiff = (ReferenceChangeLeftTarget)this.diff;
- final EReference reference = theDiff.getReference();
- final EObject element = theDiff.getRightElement();
- final EObject leftTarget = theDiff.getLeftTarget();
- final EObject rightTarget = theDiff.getRightTarget();
-
- int index = -1;
- if (reference.isMany()) {
- final EObject leftElement = theDiff.getLeftElement();
- final Object leftRefValue = leftElement.eGet(reference);
- if (leftRefValue instanceof List) {
- final List refLeftValueList = (List)leftRefValue;
- index = refLeftValueList.indexOf(leftTarget);
- }
- }
- final EObject copiedValue = MergeService.getCopier(diff).copyReferenceValue(reference, element,
- leftTarget, rightTarget, index);
-
- // we should now have a look for AddReferencesLinks needing this object
- final Iterator<EObject> siblings = getDiffModel().eAllContents();
- while (siblings.hasNext()) {
- final DiffElement op = (DiffElement)siblings.next();
- if (op instanceof ReferenceChangeLeftTarget) {
- final ReferenceChangeLeftTarget link = (ReferenceChangeLeftTarget)op;
- // now if I'm in the target References I should put my copy in the origin
- if (link.getReference().equals(reference.getEOpposite())
- && link.getLeftTarget().equals(element)) {
- removeFromContainer(link);
- }
- } else if (op instanceof ReferenceOrderChange) {
- final ReferenceOrderChange link = (ReferenceOrderChange)op;
- if (link.getLeftElement() == element && link.getReference() == reference) {
- final ListIterator<EObject> targetIterator = link.getLeftTarget().listIterator();
- boolean replaced = false;
- while (!replaced && targetIterator.hasNext()) {
- final EObject target = targetIterator.next();
- if (target.eIsProxy()
- && equalProxyURIs(((InternalEObject)target).eProxyURI(),
- EcoreUtil.getURI(leftTarget))) {
- targetIterator.set(copiedValue);
- replaced = true;
- }
- }
- }
- }
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.DefaultMerger#getDependencies(boolean)
- */
- @Override
- protected List<DiffElement> getDependencies(boolean applyInOrigin) {
- if (!applyInOrigin) {
- return diff.getRequires();
- }
- return super.getDependencies(applyInOrigin);
- }
-}
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/ReferenceChangeRightTargetMerger.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/ReferenceChangeRightTargetMerger.java
deleted file mode 100644
index e88a5c4928d..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/ReferenceChangeRightTargetMerger.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 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.papyrus.infra.emf.compare.merger;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.emf.compare.EMFComparePlugin;
-import org.eclipse.emf.compare.FactoryException;
-import org.eclipse.emf.compare.diff.merge.DefaultMerger;
-import org.eclipse.emf.compare.diff.merge.service.MergeService;
-import org.eclipse.emf.compare.diff.metamodel.DiffElement;
-import org.eclipse.emf.compare.diff.metamodel.ReferenceChangeRightTarget;
-import org.eclipse.emf.compare.diff.metamodel.ReferenceOrderChange;
-import org.eclipse.emf.compare.diff.metamodel.ResourceDependencyChange;
-import org.eclipse.emf.compare.util.EFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-
-/**
- * Merger for an {@link ReferenceChangeRightTarget} operation.<br/>
- * <p>
- * Are considered for this merger :
- * <ul>
- * <li>RemoveReferenceValue</li>
- * <li>RemoteAddReferenceValue</li>
- * </ul>
- * </p>
- *
- * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
- */
-public class ReferenceChangeRightTargetMerger extends DefaultMerger {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.api.AbstractMerger#doApplyInOrigin()
- */
- @Override
- public void doApplyInOrigin() {
- final ReferenceChangeRightTarget theDiff = (ReferenceChangeRightTarget)this.diff;
- final EReference reference = theDiff.getReference();
- final EObject element = theDiff.getLeftElement();
- final EObject rightTarget = theDiff.getRightTarget();
- final EObject leftTarget = theDiff.getLeftTarget();
-
- // ordering handling:
- int index = -1;
- if (reference.isMany()) {
- final EObject rightElement = theDiff.getRightElement();
- final Object rightRefValue = rightElement.eGet(reference);
- if (rightRefValue instanceof List) {
- final List refRightValueList = (List)rightRefValue;
- index = refRightValueList.indexOf(rightTarget);
- }
- }
- final EObject copiedValue = MergeService.getCopier(diff).copyReferenceValue(reference, element,
- rightTarget, leftTarget, index);
-
- // We'll now look through this reference's eOpposite as they are already taken care of
- final Iterator<EObject> related = getDiffModel().eAllContents();
- while (related.hasNext()) {
- final DiffElement op = (DiffElement)related.next();
- if (op instanceof ReferenceChangeRightTarget) {
- final ReferenceChangeRightTarget link = (ReferenceChangeRightTarget)op;
- // If this is my eOpposite, delete it from the DiffModel (merged along with this one)
- if (link.getReference().equals(theDiff.getReference().getEOpposite())
- && link.getRightTarget().equals(element)) {
- removeFromContainer(link);
- }
- } else if (op instanceof ReferenceOrderChange) {
- final ReferenceOrderChange link = (ReferenceOrderChange)op;
- if (link.getLeftElement() == element && link.getReference() == reference) {
- final ListIterator<EObject> targetIterator = link.getLeftTarget().listIterator();
- boolean replaced = false;
- while (!replaced && targetIterator.hasNext()) {
- final EObject target = targetIterator.next();
- if (target.eIsProxy()
- && equalProxyURIs(((InternalEObject)target).eProxyURI(),
- EcoreUtil.getURI(rightTarget))) {
- targetIterator.set(copiedValue);
- replaced = true;
- }
- }
- }
- }
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.api.AbstractMerger#doUndoInTarget()
- */
- @Override
- public void doUndoInTarget() {
- final ReferenceChangeRightTarget theDiff = (ReferenceChangeRightTarget)this.diff;
- final EObject element = theDiff.getRightElement();
- final EObject rightTarget = theDiff.getRightTarget();
- try {
- EFactory.eRemove(element, theDiff.getReference().getName(), rightTarget);
- } catch (final FactoryException e) {
- EMFComparePlugin.log(e, true);
- }
- // we should now have a look for AddReferencesLinks needing this object
- final Iterator<EObject> related = getDiffModel().eAllContents();
- while (related.hasNext()) {
- final DiffElement op = (DiffElement)related.next();
- if (op instanceof ReferenceChangeRightTarget) {
- final ReferenceChangeRightTarget link = (ReferenceChangeRightTarget)op;
- // now if I'm in the target References I should put my copy in the origin
- if (link.getReference().equals(theDiff.getReference().getEOpposite())
- && link.getRightTarget().equals(element)) {
- removeFromContainer(link);
- }
- } else if (op instanceof ResourceDependencyChange) {
- final ResourceDependencyChange link = (ResourceDependencyChange)op;
- final Resource res = link.getRoots().get(0).eResource();
- if (res == rightTarget.eResource()) {
- EcoreUtil.remove(link);
- res.unload();
- }
- }
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.DefaultMerger#getDependencies(boolean)
- */
- @Override
- protected List<DiffElement> getDependencies(boolean applyInOrigin) {
- if (applyInOrigin) {
- return diff.getRequires();
- }
- return super.getDependencies(applyInOrigin);
- }
-}
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/ReferenceOrderChangeMerger.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/ReferenceOrderChangeMerger.java
deleted file mode 100644
index 8e614ab6410..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/ReferenceOrderChangeMerger.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 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.papyrus.infra.emf.compare.merger;
-
-import com.google.common.base.Predicate;
-import com.google.common.collect.Collections2;
-
-import java.util.Collection;
-
-import org.eclipse.emf.compare.EMFComparePlugin;
-import org.eclipse.emf.compare.FactoryException;
-import org.eclipse.emf.compare.diff.merge.DefaultMerger;
-import org.eclipse.emf.compare.diff.metamodel.ReferenceOrderChange;
-import org.eclipse.emf.compare.util.EFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.InternalEObject;
-
-/**
- * Merger for a {@link ReferenceOrderChange} operation.
- *
- * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
- *
- * FIXME : remove google dependencies!
- */
-public class ReferenceOrderChangeMerger extends DefaultMerger {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.DefaultMerger#doApplyInOrigin()
- */
- @Override
- public void doApplyInOrigin() {
- final ReferenceOrderChange theDiff = (ReferenceOrderChange)this.diff;
- final EObject leftElement = theDiff.getLeftElement();
-
- final Collection<EObject> target = Collections2.filter(theDiff.getLeftTarget(),
- new Predicate<EObject>() {
- public boolean apply(EObject input) {
- return !input.eIsProxy()
- || !DefaultMerger.isEMFCompareProxy(((InternalEObject)input).eProxyURI());
- }
- });
-
- try {
- EFactory.eSet(leftElement, theDiff.getReference().getName(), target);
- } catch (final FactoryException e) {
- EMFComparePlugin.log(e, true);
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.DefaultMerger#doUndoInTarget()
- */
- @Override
- public void doUndoInTarget() {
- final ReferenceOrderChange theDiff = (ReferenceOrderChange)this.diff;
- final EObject rightElement = theDiff.getRightElement();
-
- final Collection<EObject> target = Collections2.filter(theDiff.getRightTarget(),
- new Predicate<EObject>() {
- public boolean apply(EObject input) {
- return !input.eIsProxy()
- || !DefaultMerger.isEMFCompareProxy(((InternalEObject)input).eProxyURI());
- }
- });
-
- try {
- EFactory.eSet(rightElement, theDiff.getReference().getName(), target);
- } catch (final FactoryException e) {
- EMFComparePlugin.log(e, true);
- }
- }
-}
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/UpdateReferenceMerger.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/UpdateReferenceMerger.java
deleted file mode 100644
index 1ef32c9823d..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/UpdateReferenceMerger.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 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.papyrus.infra.emf.compare.merger;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.compare.diff.merge.DefaultMerger;
-import org.eclipse.emf.compare.diff.merge.service.MergeService;
-import org.eclipse.emf.compare.diff.metamodel.DiffElement;
-import org.eclipse.emf.compare.diff.metamodel.ModelElementChangeLeftTarget;
-import org.eclipse.emf.compare.diff.metamodel.ModelElementChangeRightTarget;
-import org.eclipse.emf.compare.diff.metamodel.UpdateReference;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-
-/**
- * Merger for an {@link UpdateUniqueReferenceValue} operation.
- *
- * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
- */
-public class UpdateReferenceMerger extends DefaultMerger {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.api.AbstractMerger#doApplyInOrigin()
- */
- @Override
- public void doApplyInOrigin() {
- final UpdateReference theDiff = (UpdateReference)this.diff;
- final EReference reference = theDiff.getReference();
- final EObject element = theDiff.getLeftElement();
- final EObject leftTarget = (EObject)theDiff.getRightElement().eGet(reference);
- final EObject matchedLeftTarget = theDiff.getLeftTarget();
-
- if (leftTarget == null) {
- // We're unsetting the value, no need to copy
- element.eUnset(reference);
- } else {
- MergeService.getCopier(diff).copyReferenceValue(reference, element, leftTarget,
- matchedLeftTarget, -1);
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.api.AbstractMerger#doUndoInTarget()
- */
- @Override
- public void doUndoInTarget() {
- final UpdateReference theDiff = (UpdateReference)this.diff;
- final EReference reference = theDiff.getReference();
- final EObject element = theDiff.getRightElement();
- final EObject rightTarget = (EObject)theDiff.getLeftElement().eGet(reference);
- final EObject matchedRightTarget = theDiff.getRightTarget();
-
- if (rightTarget == null) {
- // We're unsetting the value, no need to copy
- element.eUnset(reference);
- } else {
- MergeService.getCopier(diff).copyReferenceValue(reference, element, rightTarget,
- matchedRightTarget, -1);
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.DefaultMerger#getDependencies(boolean)
- */
- @Override
- protected List<DiffElement> getDependencies(boolean applyInOrigin) {
- final List<DiffElement> diffs = diff.getRequires();
- final List<DiffElement> result = new ArrayList<DiffElement>();
- for (DiffElement diffElement : diffs) {
- if (applyInOrigin && diffElement instanceof ModelElementChangeRightTarget) {
- result.add(diffElement);
- } else if (!applyInOrigin && diffElement instanceof ModelElementChangeLeftTarget) {
- result.add(diffElement);
- }
- }
- return result;
- }
-}
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/provider/MergeCommandProvider.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/provider/MergeCommandProvider.java
deleted file mode 100644
index c33fe4b1923..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/provider/MergeCommandProvider.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.emf.compare.merger.provider;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.compare.diff.metamodel.AttributeChange;
-import org.eclipse.emf.compare.diff.metamodel.AttributeChangeLeftTarget;
-import org.eclipse.emf.compare.diff.metamodel.AttributeChangeRightTarget;
-import org.eclipse.emf.compare.diff.metamodel.AttributeOrderChange;
-import org.eclipse.emf.compare.diff.metamodel.ConflictingDiffElement;
-import org.eclipse.emf.compare.diff.metamodel.DiffElement;
-import org.eclipse.emf.compare.diff.metamodel.DiffGroup;
-import org.eclipse.emf.compare.diff.metamodel.ModelElementChange;
-import org.eclipse.emf.compare.diff.metamodel.ModelElementChangeLeftTarget;
-import org.eclipse.emf.compare.diff.metamodel.ModelElementChangeRightTarget;
-import org.eclipse.emf.compare.diff.metamodel.MoveModelElement;
-import org.eclipse.emf.compare.diff.metamodel.ReferenceChange;
-import org.eclipse.emf.compare.diff.metamodel.ReferenceChangeLeftTarget;
-import org.eclipse.emf.compare.diff.metamodel.ReferenceChangeRightTarget;
-import org.eclipse.emf.compare.diff.metamodel.ReferenceOrderChange;
-import org.eclipse.emf.compare.diff.metamodel.ResourceDependencyChange;
-import org.eclipse.emf.compare.diff.metamodel.ResourceDependencyChangeLeftTarget;
-import org.eclipse.emf.compare.diff.metamodel.ResourceDependencyChangeRightTarget;
-import org.eclipse.emf.compare.diff.metamodel.ResourceDiff;
-import org.eclipse.emf.compare.diff.metamodel.UpdateAttribute;
-import org.eclipse.emf.compare.diff.metamodel.UpdateContainmentFeature;
-import org.eclipse.emf.compare.diff.metamodel.UpdateModelElement;
-import org.eclipse.emf.compare.diff.metamodel.UpdateReference;
-import org.eclipse.emf.compare.diff.metamodel.impl.AttributeChangeImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-
-
-public class MergeCommandProvider {//TODO create an interface?
-
- public Command getMergeCommand(final Object container, final boolean confirmationRequired, final DiffElement diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain, final EObject elementToDestroy) {
- Command cmd = null;
- if(diffElement instanceof AttributeChangeImpl) {
- cmd = getMergeCommandForAttributeChange(container, confirmationRequired, (AttributeChange)diffElement, leftToRight, editingDomain);
- } else if(diffElement instanceof ConflictingDiffElement) {
- cmd = getMergeCommandForConflictingDiffElement(container, confirmationRequired, (ConflictingDiffElement)diffElement, leftToRight, editingDomain);
- } else if(diffElement instanceof DiffGroup) {
- cmd = getMergeCommandForDiffGroup(container, confirmationRequired, (DiffGroup)diffElement, leftToRight, editingDomain);
- } else if(diffElement instanceof ModelElementChange) {
- cmd = getMergeCommandForModelElementChange(container, confirmationRequired, (ModelElementChange)diffElement, leftToRight, editingDomain);
- } else if(diffElement instanceof ReferenceChange) {
- cmd = getMergeCommandForReferenceChange(container, confirmationRequired, (ReferenceChange)diffElement, leftToRight, editingDomain);
- } else if(diffElement instanceof ResourceDiff) {
- cmd = getMergeCommandForResourceDiff(container, confirmationRequired, (ResourceDiff)diffElement, leftToRight, editingDomain);
- } else {
- //TODO log an error;
- }
- return cmd;
- }
-
- protected Command getMergeCommandForAttributeChange(final Object container, final boolean confirmationRequired, final AttributeChange diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {
- Command cmd = null;
- if(diffElement instanceof AttributeChangeLeftTarget) {
- cmd = getMergeCommandForAttributeChangeLeftTarget(container, confirmationRequired, diffElement, leftToRight, editingDomain);
- } else if(diffElement instanceof AttributeChangeRightTarget) {
- cmd = getMergeCommandForAttributeChangeRightTarget(container, confirmationRequired, diffElement, leftToRight, editingDomain);
- } else if(diffElement instanceof AttributeOrderChange) {
- cmd = getMergeCommandForAttributeOrderChange(container, confirmationRequired, diffElement, leftToRight, editingDomain);
- } else if(diffElement instanceof UpdateAttribute) {
- cmd = getMergeCommandForUpdateAttribute(container, confirmationRequired, diffElement, leftToRight, editingDomain);
- } else {
- //TODO
- }
- return cmd;
- }
-
- protected Command getMergeCommandForAttributeChangeLeftTarget(final Object container, final boolean confirmationRequired, final DiffElement diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {//TODO
- return null;
- }
-
- protected Command getMergeCommandForAttributeChangeRightTarget(final Object container, final boolean confirmationRequired, final DiffElement diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {
- //TODO
- return null;
- }
-
- protected Command getMergeCommandForAttributeOrderChange(final Object container, final boolean confirmationRequired, final DiffElement diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {//TODO
- return null;
- }
-
- protected Command getMergeCommandForUpdateAttribute(final Object container, final boolean confirmationRequired, final DiffElement diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {
- //TODO
- return null;
- }
-
- protected Command getMergeCommandForConflictingDiffElement(final Object container, final boolean confirmationRequired, final ConflictingDiffElement diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {
- //TODO
- return null;
- }
-
- protected Command getMergeCommandForDiffGroup(final Object container, final boolean confirmationRequired, final DiffGroup diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {
- //TODO
- return null;
- }
-
- protected Command getMergeCommandForModelElementChange(final Object container, final boolean confirmationRequired, final ModelElementChange diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {
- Command cmd = null;
- if(diffElement instanceof ModelElementChangeLeftTarget) {
- cmd = getMergeCommandForModelElementChangeLeftTarget(container, confirmationRequired, (ModelElementChangeLeftTarget)diffElement, leftToRight, editingDomain);
- } else if(diffElement instanceof ModelElementChangeRightTarget) {
- cmd = getMergeCommandForModelElementChangeRightTarget(container, confirmationRequired, (ModelElementChangeRightTarget)diffElement, leftToRight, editingDomain);
- } else if(diffElement instanceof UpdateModelElement) {
- cmd = getMergeCommandForUpdateModelElement(container, confirmationRequired, diffElement, leftToRight, editingDomain);
- } else {
- //TODO
- }
- return cmd;
- }
-
- protected Command getMergeCommandForModelElementChangeLeftTarget(final Object container, final boolean confirmationRequired, final ModelElementChangeLeftTarget diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {
- //TODO
-
- return null;
- }
-
- protected Command getMergeCommandForModelElementChangeRightTarget(final Object container, final boolean confirmationRequired, final ModelElementChangeRightTarget diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {
- //TODO
- return null;
- }
-
- protected Command getMergeCommandForUpdateModelElement(final Object container, final boolean confirmationRequired, final DiffElement diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {
- Command cmd = null;
- if(diffElement instanceof MoveModelElement) {
- cmd = getMergeCommandForMoveModelElement(container, confirmationRequired, (MoveModelElement)diffElement, leftToRight, editingDomain);
- } else {
- //TODO
- }
- return cmd;
- }
-
- protected Command getMergeCommandForMoveModelElement(final Object container, final boolean confirmationRequired, final MoveModelElement diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {
- Command cmd = null;
- if(diffElement instanceof UpdateContainmentFeature) {
- cmd = getMergeCommandForUpdateContainmentFeature(container, confirmationRequired, (UpdateContainmentFeature)diffElement, leftToRight, editingDomain);
- } else {
- //TODO
- }
- return cmd;
-
- }
-
- protected Command getMergeCommandForUpdateContainmentFeature(final Object container, final boolean confirmationRequired, final UpdateContainmentFeature diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {
- //TODO
- return null;
- }
-
- protected Command getMergeCommandForReferenceChange(final Object container, final boolean confirmationRequired, final ReferenceChange diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {//TODO
- Command cmd = null;
- if(diffElement instanceof ReferenceChangeLeftTarget) {
- cmd = getMergeCommandForReferenceChangeLeftTarget(container, confirmationRequired, (ReferenceChangeLeftTarget)diffElement, leftToRight, editingDomain);
- } else if(diffElement instanceof ReferenceChangeRightTarget) {
- cmd = getMergeCommandForReferenceChangeRightTarget(container, confirmationRequired, (ReferenceChangeRightTarget)diffElement, leftToRight, editingDomain);
- } else if(diffElement instanceof ReferenceOrderChange) {
- cmd = getMergeCommandForReferenceOrderChange(container, confirmationRequired, (ReferenceOrderChange)diffElement, leftToRight, editingDomain);
- } else if(diffElement instanceof UpdateReference) {
- cmd = getMergeCommandForUpdateReference(container, confirmationRequired, (UpdateReference)diffElement, leftToRight, editingDomain);
- } else {
- //TODO
- }
- return cmd;
- }
-
- protected Command getMergeCommandForReferenceChangeLeftTarget(final Object container, final boolean confirmationRequired, final ReferenceChangeLeftTarget diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {
- //TODO
- return null;
- }
-
- protected Command getMergeCommandForReferenceChangeRightTarget(final Object container, final boolean confirmationRequired, final ReferenceChangeRightTarget diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {
- //TODO
- return null;
- }
-
- protected Command getMergeCommandForReferenceOrderChange(final Object container, final boolean confirmationRequired, final ReferenceOrderChange diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {
- //TODO
- return null;
- }
-
- protected Command getMergeCommandForUpdateReference(final Object container, final boolean confirmationRequired, final UpdateReference diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {
- //TODO
- return null;
- }
-
- protected Command getMergeCommandForResourceDiff(final Object container, final boolean confirmationRequired, final ResourceDiff diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {
- Command cmd = null;
- if(diffElement instanceof ResourceDependencyChange) {
- cmd = getMergeCommandForResourceDependencyChange(container, confirmationRequired, diffElement, leftToRight, editingDomain);
- } else {
- //TODO
- }
- return cmd;
- }
-
- protected Command getMergeCommandForResourceDependencyChange(final Object container, final boolean confirmationRequired, final DiffElement diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {//TODO
- Command cmd = null;
- if(diffElement instanceof ResourceDependencyChangeLeftTarget) {
- cmd = getMergeCommandForResourceDependencyChangeLeftTarget(container, confirmationRequired, (ResourceDependencyChangeLeftTarget)diffElement, leftToRight, editingDomain);
- } else if(diffElement instanceof ResourceDependencyChangeRightTarget) {
- cmd = getMergeCommandForResourceDependencyChangeRightTarget(container, confirmationRequired, (ResourceDependencyChangeRightTarget)diffElement, leftToRight, editingDomain);
- } else {
- //TODO
- }
- return cmd;
- }
-
- protected Command getMergeCommandForResourceDependencyChangeLeftTarget(final Object container, final boolean confirmationRequired, final ResourceDependencyChangeLeftTarget diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {
- //TODO
- return null;
- }
-
- protected Command getMergeCommandForResourceDependencyChangeRightTarget(final Object container, final boolean confirmationRequired, final ResourceDependencyChangeRightTarget diffElement, final boolean leftToRight, final TransactionalEditingDomain editingDomain) {
- //TODO
- return null;
- }
-
-}
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/provider/PapyrusMergeCommandProvider.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/provider/PapyrusMergeCommandProvider.java
deleted file mode 100644
index 2b7248bcb67..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/provider/PapyrusMergeCommandProvider.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.emf.compare.merger.provider;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-
-
-public class PapyrusMergeCommandProvider {
-
- public static PapyrusMergeCommandProvider INSTANCE = new PapyrusMergeCommandProvider();
-
- private PapyrusMergeCommandProvider() {
-
- }
-
- public Command getDestroyCommand(final TransactionalEditingDomain domain, final EObject element) {
- final IEditCommandRequest request = new DestroyElementRequest(domain, element, false);
- return getCommand(element, request);
- }
-
- private Command getCommand(final EObject elementToEdit, final IEditCommandRequest request) {
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(elementToEdit);
- if(provider != null) {
- return new GMFtoEMFCommandWrapper(provider.getEditCommand(request));
- }
- return null;
- }
-
- public Command getSetCommand(final TransactionalEditingDomain domain, final EObject element, final EStructuralFeature feature, final Object value) {
- final IEditCommandRequest request = new SetRequest(domain, element, feature, value);
- return getCommand(element, request);
- }
-
-
-
-}
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/provider/PapyrusMergerProvider.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/provider/PapyrusMergerProvider.java
deleted file mode 100644
index e8cf53aa0fb..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/merger/provider/PapyrusMergerProvider.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.emf.compare.merger.provider;
-
-import java.util.Map;
-
-import org.eclipse.emf.compare.diff.internal.merge.DefaultMergerProvider;
-import org.eclipse.emf.compare.diff.merge.IMerger;
-import org.eclipse.emf.compare.diff.merge.IMergerProvider;
-import org.eclipse.emf.compare.diff.metamodel.AttributeChangeLeftTarget;
-import org.eclipse.emf.compare.diff.metamodel.AttributeChangeRightTarget;
-import org.eclipse.emf.compare.diff.metamodel.AttributeOrderChange;
-import org.eclipse.emf.compare.diff.metamodel.DiffElement;
-import org.eclipse.emf.compare.diff.metamodel.DiffGroup;
-import org.eclipse.emf.compare.diff.metamodel.ModelElementChangeLeftTarget;
-import org.eclipse.emf.compare.diff.metamodel.ModelElementChangeRightTarget;
-import org.eclipse.emf.compare.diff.metamodel.MoveModelElement;
-import org.eclipse.emf.compare.diff.metamodel.ReferenceChangeLeftTarget;
-import org.eclipse.emf.compare.diff.metamodel.ReferenceChangeRightTarget;
-import org.eclipse.emf.compare.diff.metamodel.ReferenceOrderChange;
-import org.eclipse.emf.compare.diff.metamodel.UpdateAttribute;
-import org.eclipse.emf.compare.diff.metamodel.UpdateReference;
-import org.eclipse.emf.compare.util.EMFCompareMap;
-import org.eclipse.papyrus.infra.emf.compare.merger.AttributeChangeLeftTargetMerger;
-import org.eclipse.papyrus.infra.emf.compare.merger.AttributeChangeRightTargetMerger;
-import org.eclipse.papyrus.infra.emf.compare.merger.AttributeOrderChangeMerger;
-import org.eclipse.papyrus.infra.emf.compare.merger.DiffGroupMerger;
-import org.eclipse.papyrus.infra.emf.compare.merger.ModelElementChangeRightTargetMerger;
-import org.eclipse.papyrus.infra.emf.compare.merger.MoveModelElementMerger;
-import org.eclipse.papyrus.infra.emf.compare.merger.PapyrusModelElementChangeLeftTargetMerger;
-import org.eclipse.papyrus.infra.emf.compare.merger.PapyrusUpdateAttributeMerger;
-import org.eclipse.papyrus.infra.emf.compare.merger.ReferenceChangeLeftTargetMerger;
-import org.eclipse.papyrus.infra.emf.compare.merger.ReferenceChangeRightTargetMerger;
-import org.eclipse.papyrus.infra.emf.compare.merger.ReferenceOrderChangeMerger;
-import org.eclipse.papyrus.infra.emf.compare.merger.UpdateReferenceMerger;
-
-
-public class PapyrusMergerProvider implements IMergerProvider {
-
- /**
- * This map keeps a bridge between a given {@link DiffElement}'s class and the most accurate merger's
- * class for that particular {@link DiffElement}.
- */
- private Map<Class<? extends DiffElement>, Class<? extends IMerger>> mergerTypes;
-
- /**
- * The default merge provide
- */
- private final IMergerProvider defaultMergeProvider = new DefaultMergerProvider();
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diff.merge.IMergerProvider#getMergers()
- */
- public Map<Class<? extends DiffElement>, Class<? extends IMerger>> getMergers() {
- if(this.mergerTypes == null) {
- this.mergerTypes = new EMFCompareMap<Class<? extends DiffElement>, Class<? extends IMerger>>();
- this.mergerTypes.put(DiffGroup.class, DiffGroupMerger.class);
- this.mergerTypes.put(ModelElementChangeRightTarget.class, ModelElementChangeRightTargetMerger.class);
- this.mergerTypes.put(ModelElementChangeLeftTarget.class, PapyrusModelElementChangeLeftTargetMerger.class);
- this.mergerTypes.put(MoveModelElement.class, MoveModelElementMerger.class);
- this.mergerTypes.put(ReferenceChangeRightTarget.class, ReferenceChangeRightTargetMerger.class);
- this.mergerTypes.put(ReferenceChangeLeftTarget.class, ReferenceChangeLeftTargetMerger.class);
- this.mergerTypes.put(UpdateReference.class, UpdateReferenceMerger.class);
- this.mergerTypes.put(AttributeChangeRightTarget.class, AttributeChangeRightTargetMerger.class);
- this.mergerTypes.put(AttributeChangeLeftTarget.class, AttributeChangeLeftTargetMerger.class);
- this.mergerTypes.put(UpdateAttribute.class, PapyrusUpdateAttributeMerger.class);
- this.mergerTypes.put(ReferenceOrderChange.class, ReferenceOrderChangeMerger.class);
- this.mergerTypes.put(AttributeOrderChange.class, AttributeOrderChangeMerger.class);
- }
- return this.mergerTypes;
- }
-
-}
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/service/SaveEMFCompareListener.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/service/SaveEMFCompareListener.java
deleted file mode 100644
index acded6e0fa9..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/service/SaveEMFCompareListener.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.emf.compare.service;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IExecutionListener;
-import org.eclipse.core.commands.NotHandledException;
-import org.eclipse.papyrus.infra.emf.compare.Activator;
-import org.eclipse.papyrus.infra.emf.compare.utils.CompareEditorConfiguration;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-
-/**
- *
- * This listener is used to catch the Save and the SaveAll actions to save the diResource linked to the modified uml Resource
- *
- */
-public class SaveEMFCompareListener implements IExecutionListener {
-
- /** the id of the save action */
- public static final String SAVE = "org.eclipse.ui.file.save";
-
- /** the id of the saveAll action */
- public static final String SAVE_ALL = "org.eclipse.ui.file.saveAll";
-
- /**
- *
- * {@inheritDoc}
- *
- * @param commandId
- * @param exception
- */
- public void notHandled(final String commandId, final NotHandledException exception) {
- //nothing to do
- }
-
- /**
- *
- * {@inheritDoc}
- *
- * @param commandId
- * @param exception
- */
- public void postExecuteFailure(final String commandId, final ExecutionException exception) {
- //nothing to do
- }
-
- /**
- *
- * {@inheritDoc}
- *
- * @param commandId
- * @param returnValue
- */
- public void postExecuteSuccess(final String commandId, final Object returnValue) {
- if(commandId.equals(SaveEMFCompareListener.SAVE)) {
- final IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- save(Collections.singletonList(editor));
- } else if(commandId.equals(SaveEMFCompareListener.SAVE_ALL)) {
- final IEditorPart editors[] = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getDirtyEditors();
- save(Arrays.asList(editors));
- }
- }
-
- /**
- *
- * {@inheritDoc}
- *
- * @param commandId
- * @param event
- */
- public void preExecute(final String commandId, final ExecutionEvent event) {
- //nothing to do!
- }
-
- /**
- * Save resources
- *
- * @param dirtyEditor
- * the list of the Resource to Save
- */
- private void save(final List<IEditorPart> dirtyEditor) {
- for(final IEditorPart current : dirtyEditor) {
- final CompareEditorConfiguration config = Activator.getDefault().getConfigurationFor(current);
- if(config != null) {
- config.save();
- }
- }
- }
-
-}
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/utils/CompareEditorConfiguration.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/utils/CompareEditorConfiguration.java
deleted file mode 100644
index 931b586caad..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/utils/CompareEditorConfiguration.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.emf.compare.utils;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.edit.domain.IEditingDomainProvider;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.ui.IEditorPart;
-
-/**
- *
- * This class contains all the information and the methods to do UML file comparison with the Eclipse Viewer
- *
- */
-public class CompareEditorConfiguration {
-
- /**
- * the left diResource
- */
- private Resource leftDiResource;
-
- /**
- * the right diResource
- */
- private Resource rightDiResource;
-
- /**
- * the editing domain for the merge
- */
- private TransactionalEditingDomain domain;
-
- /**
- * the right uml resource
- */
- private Resource rightUMLResource;
-
- /**
- * the left uml resource
- */
- private Resource leftUMLResource;
-
- /**
- * a boolean to know if we should use the edit service
- */
- private boolean isEditServiceUsing = false;
-
- /** this boolean is used to know if the editing domain is provided by the editor or has been created by this class */
- private boolean provideTransactionalEditingDomain = false;//TODO pourrait être supprimer en regardant lors du dispose si l'éditeur est un domain provider!
-
- /**
- * the list of the metamodels for the customization manager
- */
- private Set<EPackage> metamodels;
-
- /**
- *
- * Constructor.
- *
- * @param editor
- * the compare editor
- * @param leftUMLResource
- * the left UML Resource
- * @param rightUMLResource
- * the right UMLResource
- */
- public CompareEditorConfiguration(final IEditorPart editor, final Resource leftUMLResource, final Resource rightUMLResource) {
- this.leftUMLResource = leftUMLResource;
- this.rightUMLResource = rightUMLResource;
- if(editor instanceof IEditingDomainProvider) {
- //we assume it will be always the case...
- this.domain = (TransactionalEditingDomain)((IEditingDomainProvider)editor).getEditingDomain();
- }
- if(this.leftUMLResource == null) {
- return;
- }
- Assert.isNotNull(rightUMLResource);
- Assert.isNotNull(rightUMLResource);
- initialize();
- }
-
- /**
- * initialize the field
- */
- private void initialize() {
- initializeEditingDomain();
- initializeDiResource();
- }
-
- /**
- * Returns <code>true</code> if we should use the edit service
- *
- * @return
- * Getter for {@link #isEditServiceUsing}
- */
- public boolean isEditServiceUsing() {
- return this.isEditServiceUsing;
- }
-
- /**
- * Setter for {@link #isEditServiceUsing()}
- *
- * @param use
- * <code>true</code> if we should use the edit service
- */
- public void setUseEditService(final boolean use) {
- this.isEditServiceUsing = use;
- }
-
- /**
- * Initialize the editing domain used for the action
- */
- private void initializeEditingDomain() {
- if(this.domain == null) {
- this.domain = TransactionUtil.getEditingDomain(this.leftUMLResource);
- if(this.domain == null) {
- this.domain = TransactionalEditingDomain.Factory.INSTANCE.createEditingDomain(this.leftUMLResource.getResourceSet());
- this.provideTransactionalEditingDomain = true;
- }
- }
-
- }
-
- /**
- * initialize the di resource
- */
- private void initializeDiResource() {
- URI uri;
- URI diURI;
- ResourceSet set;
- //the left :
- uri = this.leftUMLResource.getURI();
- diURI = URI.createPlatformResourceURI(uri.toPlatformString(false).replace("uml", "di"), false);//TODO FIXME avoid to duplicate these string?
- set = this.leftUMLResource.getResourceSet();
- if(set.getURIConverter().exists(diURI, null)) {
- this.leftDiResource = set.getResource(diURI, true);
- try {
- this.leftDiResource.load(null);
- } catch (final IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- //the right
- uri = this.rightUMLResource.getURI();
- diURI = URI.createPlatformResourceURI(uri.toPlatformString(false).replace("uml", "di"), false);//TODO FIXME avoid to duplicate these string?
- set = this.rightUMLResource.getResourceSet();
- if(set.getURIConverter().exists(diURI, null)) {
- this.rightDiResource = set.getResource(diURI, true);
- try {
- this.rightDiResource.load(null);
- } catch (final IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
-
- /**
- * save the di resource
- */
- public void save() {
- final Map<?, ?> options = null;
- if(this.leftDiResource != null) {
- try {
- this.leftDiResource.save(options);
- } catch (final IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- if(this.rightDiResource != null) {
- try {
- this.rightDiResource.save(options);
- } catch (final IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
-
- /**
- * Getter for {@link #domain}
- *
- * @return
- * {@link #domain}
- */
- public TransactionalEditingDomain getEditingDomain() {
- return this.domain;
- }
-
- /**
- *
- * @return
- * <code>true</code> if there is diResource associated to the UML Resource
- */
- public boolean manageDiResource() {
- return this.leftDiResource != null || this.rightDiResource != null;
- }
-
- /**
- *
- * @return
- * the list of the metamodel managed for the CustomizationManager
- */
- public Set<EPackage> getMetamodels() {
- if(this.metamodels == null) {
- this.metamodels = new HashSet<EPackage>();
- if(this.leftUMLResource != null && this.rightUMLResource != null) {
- final List<EObject> contents = new ArrayList<EObject>(this.leftUMLResource.getContents());
- contents.addAll(this.rightUMLResource.getContents());
- for(final EObject current : contents) {
- this.metamodels.add(current.eClass().getEPackage());
- }
- }
- }
- return this.metamodels;
- }
-
- public void dispose() {
- //we detach the editingdomain of the resourceset
- if(this.provideTransactionalEditingDomain) {
- this.domain.dispose();
- //if not the editing domain comes from the editor, we doesn't manage it!
- }
- final Map<?, ?> options = null;
- if(this.leftDiResource != null) {
- this.leftDiResource.unload();
- }
- if(this.rightDiResource != null) {
- this.rightDiResource.unload();
- }
- this.metamodels.clear();
- }
-
-}
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/utils/Utils.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/utils/Utils.java
deleted file mode 100644
index 3bf9b3c0e98..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare/src/org/eclipse/papyrus/infra/emf/compare/utils/Utils.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.emf.compare.utils;
-
-import org.eclipse.papyrus.infra.emf.compare.Activator;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-
-public class Utils {
-
- private Utils() {
- //nothing to do
- }
-
- //FIXME refactore this class in an upper plugin->yes!
- public static final IEditorPart getCurrentEditor() {
- final IWorkbench workbench = PlatformUI.getWorkbench();
- if(workbench != null) {
- final IWorkbenchWindow activeWorkbench = workbench.getActiveWorkbenchWindow();
- if(activeWorkbench != null) {
- final IWorkbenchPage activePage = activeWorkbench.getActivePage();
- if(activePage != null) {
- activePage.getActiveEditor();
- }
- }
- }
- return null;
- }
-
-
- public static boolean useEditService() {
- final CompareEditorConfiguration config = Utils.getConfiguration();
- return config != null && config.isEditServiceUsing();
- }
-
- public static CompareEditorConfiguration getConfiguration() {
- final IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- return Activator.getDefault().getConfigurationFor(editor);
- }
-}

Back to the top