Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/org.eclipse.papyrus.uml.compare.merge')
-rw-r--r--sandbox/org.eclipse.papyrus.uml.compare.merge/.classpath7
-rw-r--r--sandbox/org.eclipse.papyrus.uml.compare.merge/.project28
-rw-r--r--sandbox/org.eclipse.papyrus.uml.compare.merge/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--sandbox/org.eclipse.papyrus.uml.compare.merge/META-INF/MANIFEST.MF21
-rw-r--r--sandbox/org.eclipse.papyrus.uml.compare.merge/build.properties4
-rw-r--r--sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/Activator.java55
-rw-r--r--sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/ITransactionalMerger.java81
-rw-r--r--sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/TransactionalMergeService.java317
-rw-r--r--sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/AbstractFireMergeCommand.java76
-rw-r--r--sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/CopyXMIIDCommand.java112
-rw-r--r--sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/FireMergeDiffEndCommand.java43
-rw-r--r--sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/FireMergeDiffStartCommand.java43
-rw-r--r--sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/FireMergeOperationEndCommand.java52
-rw-r--r--sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/FireMergeOperationStartCommand.java52
-rw-r--r--sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/nested/NestedMergeUtils.java13
-rw-r--r--sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/standalone/StandaloneMergeUtils.java13
16 files changed, 0 insertions, 924 deletions
diff --git a/sandbox/org.eclipse.papyrus.uml.compare.merge/.classpath b/sandbox/org.eclipse.papyrus.uml.compare.merge/.classpath
deleted file mode 100644
index 2d1a4302f04..00000000000
--- a/sandbox/org.eclipse.papyrus.uml.compare.merge/.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/org.eclipse.papyrus.uml.compare.merge/.project b/sandbox/org.eclipse.papyrus.uml.compare.merge/.project
deleted file mode 100644
index 1ce7f4a780f..00000000000
--- a/sandbox/org.eclipse.papyrus.uml.compare.merge/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.uml.compare.merge</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/org.eclipse.papyrus.uml.compare.merge/.settings/org.eclipse.jdt.core.prefs b/sandbox/org.eclipse.papyrus.uml.compare.merge/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 44217f8c068..00000000000
--- a/sandbox/org.eclipse.papyrus.uml.compare.merge/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-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/org.eclipse.papyrus.uml.compare.merge/META-INF/MANIFEST.MF b/sandbox/org.eclipse.papyrus.uml.compare.merge/META-INF/MANIFEST.MF
deleted file mode 100644
index fcb3b8c8617..00000000000
--- a/sandbox/org.eclipse.papyrus.uml.compare.merge/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,21 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Merge
-Bundle-SymbolicName: org.eclipse.papyrus.uml.compare.merge
-Bundle-Version: 0.9.0.qualifier
-Bundle-Activator: org.eclipse.papyrus.uml.compare.merge.Activator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.papyrus.infra.tools,
- org.eclipse.emf.common,
- org.eclipse.emf.compare.diff,
- org.eclipse.emf.transaction,
- org.eclipse.emf.ecore.xmi,
- org.eclipse.papyrus.infra.emf,
- org.eclipse.papyrus.infra.core.log
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.papyrus.uml.compare.merge,
- org.eclipse.papyrus.uml.compare.merge.commands,
- org.eclipse.papyrus.uml.compare.merge.nested,
- org.eclipse.papyrus.uml.compare.merge.standalone
diff --git a/sandbox/org.eclipse.papyrus.uml.compare.merge/build.properties b/sandbox/org.eclipse.papyrus.uml.compare.merge/build.properties
deleted file mode 100644
index 41eb6ade2b4..00000000000
--- a/sandbox/org.eclipse.papyrus.uml.compare.merge/build.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .
diff --git a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/Activator.java b/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/Activator.java
deleted file mode 100644
index fcf02bf9538..00000000000
--- a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/Activator.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.eclipse.papyrus.uml.compare.merge;
-
-import org.eclipse.papyrus.infra.core.log.LogHelper;
-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.uml.compare.merge"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- /**the Papyrus log helper*/
- public static LogHelper log;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- log = new LogHelper(this);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
-}
diff --git a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/ITransactionalMerger.java b/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/ITransactionalMerger.java
deleted file mode 100644
index 78e46baf985..00000000000
--- a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/ITransactionalMerger.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 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.uml.compare.merge; import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.compare.diff.merge.DefaultMerger;
-import org.eclipse.emf.compare.diff.merge.IMerger;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-;
-
-/**
- *
- * The mergers which implement this interface are able to provide commands for the merge actions
- * TODO : rename into ITransactionalMerger
- */
-public interface ITransactionalMerger extends IMerger {
-
- /**
- * This command should have the same behavior as {@link DefaultMerger#applyInOrigin()}
- *
- * @return
- * the command to do the action
- */
- public Command getApplyInOriginCommand(final TransactionalEditingDomain domain);
-
- /**
- * This command should have the same behavior as {@link DefaultMerger#undoInTarget()}
- *
- * @param domain
- * @return
- * the command to do the action
- */
- public Command getUndoInTargetCommand(final TransactionalEditingDomain domain);
-
- /**
- * This command should have the same behavior as {@link DefaultMerger#doApplyInOrigin}
- *
- * @param domain
- * @return
- * the command to do the action
- */
- public Command getDoApplyInOriginCommand(final TransactionalEditingDomain domain);
-
- /**
- * This command should have the same behavior as {@link DefaultMerger#doUndoInTarget}
- *
- * @param domain
- * @return
- * the command to do the action
- */
- public Command getDoUndoInTargetCommand(final TransactionalEditingDomain domain);
-
- /**
- * This command should have the same behavior as {@link DefaultMerger#mergeRequiredDifferences}
- *
- * @param domain
- * @param applyInOrigin
- * @return
- * the command to do the action
- */
- public Command getMergeRequiredDifferencesCommand(final TransactionalEditingDomain domain, final boolean applyInOrigin);
-
- /**
- * This command should have the same behavior as {@link DefaultMerger#postProcess}
- *
- * @param domain
- * @return
- * the command to do the action
- */
- public Command getPostProcessCommand(final TransactionalEditingDomain domain);
-
-}
diff --git a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/TransactionalMergeService.java b/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/TransactionalMergeService.java
deleted file mode 100644
index 4ffcc4dc8d7..00000000000
--- a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/TransactionalMergeService.java
+++ /dev/null
@@ -1,317 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 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.uml.compare.merge;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CompoundCommand;
-import org.eclipse.emf.compare.diff.merge.IMergeListener;
-import org.eclipse.emf.compare.diff.merge.IMerger;
-import org.eclipse.emf.compare.diff.merge.service.MergeFactory;
-import org.eclipse.emf.compare.diff.merge.service.MergeService;
-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.transaction.TransactionalEditingDomain;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.infra.tools.util.ReflectHelper;
-import org.eclipse.papyrus.uml.compare.merge.commands.FireMergeDiffEndCommand;
-import org.eclipse.papyrus.uml.compare.merge.commands.FireMergeDiffStartCommand;
-import org.eclipse.papyrus.uml.compare.merge.commands.FireMergeOperationEndCommand;
-import org.eclipse.papyrus.uml.compare.merge.commands.FireMergeOperationStartCommand;
-
-
-/**
- *
- * This service should replace the EMF-Compare MergeService
- *
- */
-//TODO not used
-public class TransactionalMergeService {
-
- private static Method addMergeListenerMethod = null;
-
- private static Method removeMergeListenerMethod = null;
-
- // /** This copier will be used when merging references. */
- // private static EMFCompareEObjectCopier copier;
-
- /**
- * Default constructor.
- */
- private TransactionalMergeService() {
- // hides default constructor
- }
-
- /**
- * TODO this method should be covered with a JUnit test
- * Registers a new merge listener for notifications about merge operations. Has no effect if the listener
- * is already registered.
- *
- * @param listener
- * New Listener to register for notifications.
- */
- public static void addMergeListener(final IMergeListener listener) {
- if(addMergeListenerMethod == null) {
- Class<?>[] parameterTypes = new Class[1];
- parameterTypes[0] = IMergeListener.class;
- try {
- addMergeListenerMethod = ReflectHelper.getMethod(MergeService.class, "addMergeListener", parameterTypes); //$NON-NLS-1$
- } catch (SecurityException e) {
- Activator.log.error(e);
- } catch (NoSuchMethodException e) {
- Activator.log.error(e);
- }
- }
- final Object[] parameters = new Object[1];
- parameters[0] = listener;
- try {
- addMergeListenerMethod.invoke(null, parameters);
- } catch (IllegalArgumentException e) {
- Activator.log.error(e);
- } catch (IllegalAccessException e) {
- Activator.log.error(e);
- } catch (InvocationTargetException e) {
- Activator.log.error(e);
- }
- }
-
-
- // /**
- // * Returns the copier given the diff it should merge.
- // *
- // * @param diff
- // * The DiffElement for which a copier is needed.
- // * @return The copier for a given diff.
- // */
- // public static EMFCompareEObjectCopier getCopier(final DiffElement diff) {
- // final DiffModel diffModel = getContainerDiffModel(diff);
- // if (diffModel == null)
- // throw new IllegalArgumentException("The diff element should be contained in a DiffModel instance"); //$NON-NLS-1$
- // if (diffModel.eContainer() instanceof DiffResourceSet) {
- // if (copier == null) {
- // copier = new EMFCompareEObjectCopier((DiffResourceSet)diffModel.eContainer());
- // } else if (copier.getDiffResourceSet() != diffModel.eContainer()) {
- // copier.clear();
- // copier = new EMFCompareEObjectCopier((DiffResourceSet)diffModel.eContainer());
- // }
- // } else {
- // if (copier == null) {
- // copier = new EMFCompareEObjectCopier(diffModel);
- // } else if (copier.getDiffModel() != diffModel) {
- // copier.clear();
- // copier = new EMFCompareEObjectCopier(diffModel);
- // }
- // }
- // return copier;
- // }
-
- // /**
- // * Browse the diff model from the leaf to the top to find the containing {@link DiffModel} instance.
- // *
- // * @param diff
- // * any {@link DiffElement}.
- // * @return the containing {@link DiffModel} instance, null if not found.
- // */
- // private static DiffModel getContainerDiffModel(final DiffElement diff) {
- // EObject container = diff.eContainer();
- // while (container != null) {
- // if (container instanceof DiffModel)
- // return (DiffModel)container;
- // container = container.eContainer();
- // }
- // return null;
- // }
-
- /**
- * Merges a single DiffElement in the direction specified by <code>leftToRight</code>.
- * <p>
- * Will notify the list of its merge listeners before, and after the operation.
- * </p>
- *
- * @param element
- * {@link DiffElement} containing the information to merge.
- * @param leftToRight
- * <code>True</code> if the changes must be applied from the left to the right model, <code>False</code> when they have to be applied the
- * other way around.
- */
- // public static void merge(final DiffElement element, final boolean leftToRight) {
- // fireMergeOperationStart(element);
- // doMerge(element, leftToRight);
- // fireMergeOperationEnd(element);
- // }
-
- public static Command getMergeCommand(final TransactionalEditingDomain domain, final DiffElement element, final boolean leftToRight) {
- CompoundCommand cmd = new CompoundCommand("MergeCommand"); //$NON-NLS-1$
- cmd.append(new FireMergeOperationStartCommand(element, getMergeListeners()));
- cmd.append(getDoMergeCommand(domain, element, leftToRight));
- cmd.append(new FireMergeOperationEndCommand(element, getMergeListeners()));
- return cmd;
- }
-
- /**
- * Applies the changes implied by a given {@link DiffElement} in the direction specified by <code>leftToRight</code>.
- * <p>
- * Will notify the list of its merge listeners before, and after the merge.
- * </p>
- *
- * @param element
- * {@link DiffElement} containing the information to merge.
- * @param leftToRight
- * <code>True</code> if the changes must be applied from the left to the right model, <code>False</code> when they have to be applied the
- * other way around.
- */
- // protected static void doMerge(final DiffElement element, final boolean leftToRight) {
- // fireMergeDiffStart(element);
- // final IMerger merger;
- // if(element instanceof ConflictingDiffElement)
- // merger = MergeFactory.createMerger(element.getSubDiffElements().get(0));
- // else
- // merger = MergeFactory.createMerger(element);
- // if(leftToRight && merger.canUndoInTarget()) {
- // merger.undoInTarget();
- // } else if(!leftToRight && merger.canApplyInOrigin()) {
- // merger.applyInOrigin();
- // }
- // fireMergeDiffEnd(element);
- // }
-
- private static Command getDoMergeCommand(final TransactionalEditingDomain domain, final DiffElement element, final boolean leftToRight) {
- final CompoundCommand cmd = new CompoundCommand("DoMergeCommand"); //$NON-NLS-1$
- cmd.append(new FireMergeDiffStartCommand(element, getMergeListeners()));
- final IMerger merger;
-// if(element instanceof DiffGroup){
-// merger = new DiffGroupTransactionalMerger();
-// merger.setDiffElement(element);
-// }
-// else
- if(element instanceof ConflictingDiffElement) {
- merger = MergeFactory.createMerger(element.getSubDiffElements().get(0));
- } else {
-
- merger = MergeFactory.createMerger(element);
- }
- if(merger instanceof ITransactionalMerger) {
- if(leftToRight && merger.canUndoInTarget()) {
- cmd.append(((ITransactionalMerger)merger).getUndoInTargetCommand(domain));
- } else if(!leftToRight && merger.canApplyInOrigin()) {
- cmd.append(((ITransactionalMerger)merger).getApplyInOriginCommand(domain));
- }
- } else {
- throw new UnsupportedOperationException(NLS.bind("I can't found the Papyrus Merger for {0}.", element)); //$NON-NLS-1$
- }
-
- cmd.append(new FireMergeDiffEndCommand(element, getMergeListeners()));
- return cmd;
- }
-
-
- // /**
- // * Merges a list of DiffElements in the direction specified by <code>leftToRight</code>.
- // * <p>
- // * Will notify the list of its merge listeners before, and after the operation.
- // * </p>
- // *
- // * @param elements
- // * {@link DiffElement}s containing the information to merge.
- // * @param leftToRight
- // * <code>True</code> if the changes must be applied from the left to the right model, <code>False</code> when they have to be applied the
- // * other way around.
- // */
- // public static void merge(final List<DiffElement> elements, final boolean leftToRight) {
- // fireMergeOperationStart(elements);
- // for(DiffElement element : new ArrayList<DiffElement>(elements))
- // // we might remove the diff from the list before merging it
- // // (eOpposite reference)
- // if(element.eContainer() != null)
- // doMerge(element, leftToRight);
- // fireMergeOperationEnd(elements);
- // }
-
- public static Command getMergeCommand(final TransactionalEditingDomain domain, final List<DiffElement> elements, final boolean leftToRight) {
- final CompoundCommand cmd = new CompoundCommand("MergeCommand"); //$NON-NLS-1$
- cmd.append(new FireMergeOperationStartCommand(elements, getMergeListeners()));
- for(DiffElement element : new ArrayList<DiffElement>(elements)) {
- // we might remove the diff from the list before merging it
- // (eOpposite reference)
- if(element.eContainer() != null) {
- cmd.append(getDoMergeCommand(domain, element, leftToRight));
- }
- }
- cmd.append(new FireMergeOperationEndCommand(elements, getMergeListeners()));
- return cmd;
- }
-
- /**
- * removes a merge listener from the list of registered listeners. This will have no effect if the given
- * listener is not registered for notifications on this service.
- *
- * @param listener
- * New Listener to register for notifications.
- */
- public static void removeMergeListener(final IMergeListener listener) {
- if(removeMergeListenerMethod == null) {
- Class<?>[] parameterTypes = new Class[1];
- parameterTypes[0] = IMergeListener.class;
- try {
- removeMergeListenerMethod = ReflectHelper.getMethod(MergeService.class, "removeMergeListener", parameterTypes); //$NON-NLS-1$
- } catch (SecurityException e) {
- Activator.log.error(e);
- } catch (NoSuchMethodException e) {
- Activator.log.error(e);
- }
- }
- final Object[] parameters = new Object[1];
- parameters[0] = listener;
- try {
- removeMergeListenerMethod.invoke(null, parameters);
- } catch (IllegalArgumentException e) {
- Activator.log.error(e);
- } catch (IllegalAccessException e) {
- Activator.log.error(e);
- } catch (InvocationTargetException e) {
- Activator.log.error(e);
- }
- }
-
-
- @SuppressWarnings("unchecked")
- //we suppress this warning because the field is always a List of IMergeListener
- private static List<IMergeListener> getMergeListeners() {
- List<IMergeListener> listeners = null;
- Field myField = null;
- try {
- myField = MergeService.class.getDeclaredField("MERGE_LISTENERS"); //$NON-NLS-1$
- } catch (SecurityException e) {
- Activator.log.error(e);
- } catch (NoSuchFieldException e) {
- Activator.log.error(e);
- }
- myField.setAccessible(true);
- try {
- listeners = (List<IMergeListener>)myField.get(null);
- } catch (IllegalArgumentException e) {
- Activator.log.error(e);
- } catch (IllegalAccessException e) {
- Activator.log.error(e);
- }
- return listeners;
- }
-
-}
diff --git a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/AbstractFireMergeCommand.java b/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/AbstractFireMergeCommand.java
deleted file mode 100644
index 4813d954a7c..00000000000
--- a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/AbstractFireMergeCommand.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 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.uml.compare.merge.commands;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.command.AbstractCommand;
-import org.eclipse.emf.compare.diff.merge.IMergeListener;
-import org.eclipse.emf.compare.diff.metamodel.DiffElement;
-
-
-public abstract class AbstractFireMergeCommand extends AbstractCommand {
-
- /**
- * the list of the listeners
- */
- private final List<IMergeListener> listeners;
-
- /**
- * a list of the diff element
- */
- private final List<DiffElement> diffs;
-
- private final DiffElement diffElement;
-
- public AbstractFireMergeCommand(final DiffElement diffElement, final List<IMergeListener> listeners) {
- this.diffElement = diffElement;
- this.diffs = Collections.emptyList();
- this.listeners = new ArrayList<IMergeListener>(listeners);
- }
-
- public AbstractFireMergeCommand(final List<DiffElement> diffs, final List<IMergeListener> listeners) {
- this.diffElement = null;
- this.diffs = new ArrayList<DiffElement>(diffs);
- this.listeners = new ArrayList<IMergeListener>(listeners);
- }
-
- public boolean canRedo() {
- return canExecute();
- }
-
- public List<IMergeListener> getMergeListeners() {
- return Collections.unmodifiableList(listeners);
- }
-
- public List<DiffElement> getDiffElementsList() {
- return Collections.unmodifiableList(this.diffs);
- }
-
- public DiffElement getDiffElement() {
- return this.diffElement;
- }
-
- @Override
- protected boolean prepare() {
- return true;
- }
-
- public void redo() {
- execute();
-
- }
-}
diff --git a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/CopyXMIIDCommand.java b/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/CopyXMIIDCommand.java
deleted file mode 100644
index 46ea50ebc3d..00000000000
--- a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/CopyXMIIDCommand.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 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.uml.compare.merge.commands;
-
-import org.eclipse.emf.common.command.AbstractCommand;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.xmi.XMIResource;
-import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-
-/**
- *
- * This command allows to copy the XMI_ID from one EObject to another one, only if they are not owned by the same resource
- *
- */
-//TODO should be moved in infra.emf plugin when the problem of the sa¨me resource will be corrected in Papyrus
-public class CopyXMIIDCommand extends AbstractCommand {
-
- /**
- * the EObject which provides the XMI_ID
- */
- private final EObject source;
-
- /**
- * the EObject which receive the XMI_ID
- */
- private final EObject target;
-
- /**
- * the initial XMI_ID of the target
- */
- private String initialID;
-
- /**
- *
- * Constructor.
- *
- * @param source
- * the EObject which provides the XMI_ID
- * @param target
- * the EObject which receive the XMI_ID
- */
- public CopyXMIIDCommand(final EObject source, final EObject target) {
- this.source = source;
- this.target = target;
- this.initialID = null;
- setLabel("Copy XMI_ID command"); //$NON-NLS-1$
- }
-
- /**
- *
- * @see org.eclipse.emf.common.command.Command#execute()
- *
- */
- public void execute() {
- final Resource sourceResource = source.eResource();
- final Resource targetResource = target.eResource();
- if(sourceResource instanceof XMIResource && targetResource instanceof XMIResource) {
- //TODO : this test is commented because the result of this command is worse with the test than without...
- // if(sourceResource != targetResource) {
- final String xmi_id = EMFHelper.getXMIID(this.source);
- this.initialID = EMFHelper.getXMIID(target);
- ((XMIResource)this.target.eResource()).setID(this.target, xmi_id);
- // }
- }
- }
-
- /**
- *
- * @see org.eclipse.emf.common.command.Command#redo()
- *
- */
- public void redo() {
- execute();
- }
-
- /**
- *
- * @see org.eclipse.emf.common.command.AbstractCommand#prepare()
- *
- * @return
- */
- @Override
- protected boolean prepare() {
- return true;
- }
-
- /**
- *
- * @see org.eclipse.emf.common.command.AbstractCommand#undo()
- *
- */
- @Override
- public void undo() {
- final Resource targetResource = target.eResource();
- if(targetResource instanceof XMIResource) {
- ((XMIResource)this.target.eResource()).setID(this.target, this.initialID);
- }
- }
-
-}
diff --git a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/FireMergeDiffEndCommand.java b/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/FireMergeDiffEndCommand.java
deleted file mode 100644
index 660ab98bbf4..00000000000
--- a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/FireMergeDiffEndCommand.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 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.uml.compare.merge.commands;
-
-import java.util.List;
-
-import org.eclipse.emf.compare.diff.merge.IMergeListener;
-import org.eclipse.emf.compare.diff.merge.MergeEvent;
-import org.eclipse.emf.compare.diff.metamodel.DiffElement;
-
-
-public class FireMergeDiffEndCommand extends AbstractFireMergeCommand {
-
- public FireMergeDiffEndCommand(final DiffElement diffElement, final List<IMergeListener> listeners) {
- super(diffElement, listeners);
- }
-
- public void execute() {
- List<IMergeListener> listeners = getMergeListeners();
- if(getDiffElement() != null) {
- for(IMergeListener current : listeners) {
- current.mergeDiffStart(new MergeEvent(getDiffElement()));
- }
-
- }
- }
-
- @Override
- public void undo() {
- //TODO?
- }
-}
diff --git a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/FireMergeDiffStartCommand.java b/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/FireMergeDiffStartCommand.java
deleted file mode 100644
index e0d274e5e12..00000000000
--- a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/FireMergeDiffStartCommand.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 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.uml.compare.merge.commands;
-
-import java.util.List;
-
-import org.eclipse.emf.compare.diff.merge.IMergeListener;
-import org.eclipse.emf.compare.diff.merge.MergeEvent;
-import org.eclipse.emf.compare.diff.metamodel.DiffElement;
-
-
-public class FireMergeDiffStartCommand extends AbstractFireMergeCommand {
-
- public FireMergeDiffStartCommand(final DiffElement diffElement, final List<IMergeListener> listeners) {
- super(diffElement, listeners);
- }
-
- public void execute() {
- List<IMergeListener> listeners = getMergeListeners();
- if(getDiffElement() != null) {
- for(IMergeListener current : listeners) {
- current.mergeDiffEnd(new MergeEvent(getDiffElement()));
- }
-
- }
- }
-
- @Override
- public void undo() {
- //TODO?
- }
-}
diff --git a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/FireMergeOperationEndCommand.java b/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/FireMergeOperationEndCommand.java
deleted file mode 100644
index 2043fdbc9c0..00000000000
--- a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/FireMergeOperationEndCommand.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 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.uml.compare.merge.commands;
-
-import java.util.List;
-
-import org.eclipse.emf.compare.diff.merge.IMergeListener;
-import org.eclipse.emf.compare.diff.merge.MergeEvent;
-import org.eclipse.emf.compare.diff.metamodel.DiffElement;
-
-
-public class FireMergeOperationEndCommand extends AbstractFireMergeCommand {
-
- public FireMergeOperationEndCommand(final DiffElement diffElement, final List<IMergeListener> listeners) {
- super(diffElement, listeners);
- }
-
- public FireMergeOperationEndCommand(final List<DiffElement> diffs, final List<IMergeListener> listeners) {
- super(diffs, listeners);
- }
-
- public void execute() {
- List<IMergeListener> listeners = getMergeListeners();
- if(!getDiffElementsList().isEmpty()) {
- for(IMergeListener current : listeners) {
- current.mergeOperationEnd(new MergeEvent(getDiffElementsList()));
- }
- }
- if(getDiffElement() != null) {
- for(IMergeListener current : listeners) {
- current.mergeOperationEnd(new MergeEvent(getDiffElement()));
- }
-
- }
- }
-
- @Override
- public void undo() {
- //TODO?
- }
-}
diff --git a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/FireMergeOperationStartCommand.java b/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/FireMergeOperationStartCommand.java
deleted file mode 100644
index e9273d43149..00000000000
--- a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/commands/FireMergeOperationStartCommand.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 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.uml.compare.merge.commands;
-
-import java.util.List;
-
-import org.eclipse.emf.compare.diff.merge.IMergeListener;
-import org.eclipse.emf.compare.diff.merge.MergeEvent;
-import org.eclipse.emf.compare.diff.metamodel.DiffElement;
-
-
-public class FireMergeOperationStartCommand extends AbstractFireMergeCommand {
-
- public FireMergeOperationStartCommand(final DiffElement diffElement, final List<IMergeListener> listeners) {
- super(diffElement, listeners);
- }
-
- public FireMergeOperationStartCommand(final List<DiffElement> diffs, final List<IMergeListener> listeners) {
- super(diffs, listeners);
- }
-
- public void execute() {
- List<IMergeListener> listeners = getMergeListeners();
- if(!getDiffElementsList().isEmpty()) {
- for(IMergeListener current : listeners) {
- current.mergeOperationStart(new MergeEvent(getDiffElementsList()));
- }
- }
- if(getDiffElement() != null) {
- for(IMergeListener current : listeners) {
- current.mergeOperationStart(new MergeEvent(getDiffElement()));
- }
-
- }
- }
-
- @Override
- public void undo() {
- //TODO?
- }
-}
diff --git a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/nested/NestedMergeUtils.java b/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/nested/NestedMergeUtils.java
deleted file mode 100644
index af7487acfdc..00000000000
--- a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/nested/NestedMergeUtils.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.eclipse.papyrus.uml.compare.merge.nested;
-
-import java.util.HashMap;
-import java.util.Map;
-
-
-public class NestedMergeUtils {
-
- public static final Map<String, Object> getMergeOptions(){
- final Map<String, Object> options = new HashMap<String, Object>();
- return options;
- }
-}
diff --git a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/standalone/StandaloneMergeUtils.java b/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/standalone/StandaloneMergeUtils.java
deleted file mode 100644
index bcf7ca4686b..00000000000
--- a/sandbox/org.eclipse.papyrus.uml.compare.merge/src/org/eclipse/papyrus/uml/compare/merge/standalone/StandaloneMergeUtils.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.eclipse.papyrus.uml.compare.merge.standalone;
-
-import java.util.HashMap;
-import java.util.Map;
-
-
-public class StandaloneMergeUtils {
-
- public static final Map<String, Object> getMergeOptions(){
- final Map<String, Object> options = new HashMap<String, Object>();
- return options;
- }
-}

Back to the top