Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2012-05-07 15:03:20 +0000
committervlorenzo2012-05-07 15:03:20 +0000
commit61391e5a4b8ab60c1a111f5622ece8535e84693d (patch)
tree2a814b20d81f7f8a53c6637d1296321bcb5ecb88 /incoming
parentb3d624274ca21b4bceef7e2dca71ea8f4604cb41 (diff)
downloadorg.eclipse.papyrus-61391e5a4b8ab60c1a111f5622ece8535e84693d.tar.gz
org.eclipse.papyrus-61391e5a4b8ab60c1a111f5622ece8535e84693d.tar.xz
org.eclipse.papyrus-61391e5a4b8ab60c1a111f5622ece8535e84693d.zip
378689: [Releng] Add EMF-Compare projects to releng
https://bugs.eclipse.org/bugs/show_bug.cgi?id=378689
Diffstat (limited to 'incoming')
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/.classpath7
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/.project28
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/META-INF/MANIFEST.MF26
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/about.html28
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/build.properties11
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/icons/papyrus_compare_editor.gifbin956 -> 0 bytes
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/plugin.pdoc4
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/plugin.properties3
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/plugin.xml63
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/Activator.java69
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/content/viewer/UMLModelContentMergeDiffTab.java26
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/content/viewer/UMLModelContentMergeTabFolder.java52
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/content/viewer/UMLTransactionalModelContentMergeViewer.java57
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/editor/UMLCompareEditor.java180
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/factory/UMLCompareEditorFactory.java31
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/handler/UMLCompareEditorHandler.java60
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/tatiana/ElementContentDiffEngine.java99
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/tatiana/ElementContentMatchEngine.java110
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/tatiana/PapyrusDiffEngine.java210
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/tatiana/PapyrusMatchEngine.java69
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/RootObject.java57
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/UMLDiffEngine.java41
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/UMLDiffService.java100
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/UMLMatchEngine.java106
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/UMLModelCompareEditorInput.java58
-rw-r--r--incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/UMLSimilarityChecker.java76
27 files changed, 0 insertions, 1578 deletions
diff --git a/incoming/org.eclipse.papyrus.uml.compare/.classpath b/incoming/org.eclipse.papyrus.uml.compare/.classpath
deleted file mode 100644
index 6b1d83e2207..00000000000
--- a/incoming/org.eclipse.papyrus.uml.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 excluding="org/eclipse/papyrus/uml/compare/tatiana/PapyrusDiffEngine.java|org/eclipse/papyrus/uml/compare/tatiana/PapyrusMatchEngine.java|org/eclipse/papyrus/uml/compare/tatiana/ElementContentDiffEngine.java|org/eclipse/papyrus/uml/compare/tatiana/ElementContentMatchEngine.java" kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/incoming/org.eclipse.papyrus.uml.compare/.project b/incoming/org.eclipse.papyrus.uml.compare/.project
deleted file mode 100644
index ef210cd5556..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.uml.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/incoming/org.eclipse.papyrus.uml.compare/.settings/org.eclipse.jdt.core.prefs b/incoming/org.eclipse.papyrus.uml.compare/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 44217f8c068..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/.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/incoming/org.eclipse.papyrus.uml.compare/META-INF/MANIFEST.MF b/incoming/org.eclipse.papyrus.uml.compare/META-INF/MANIFEST.MF
deleted file mode 100644
index 1ee2c562fb9..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,26 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.papyrus.uml.compare;singleton:=true
-Bundle-Version: 0.9.0.qualifier
-Bundle-Activator: org.eclipse.papyrus.uml.compare.Activator
-Bundle-Vendor: %providerName
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.papyrus.infra.core.log,
- org.eclipse.papyrus.infra.emf.compare.common;bundle-version="0.9.0",
- org.eclipse.papyrus.infra.core,
- org.eclipse.papyrus.infra.emf.compare.instance;bundle-version="0.9.0",
- org.eclipse.uml2.uml;bundle-version="4.0.0",
- org.eclipse.compare;bundle-version="3.5.300",
- org.eclipse.emf.compare.diff,
- org.eclipse.papyrus.infra.emf.compare.ui,
- org.eclipse.emf.compare.ui,
- org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.2.0",
- org.eclipse.emf.compare,
- org.eclipse.emf.compare.match;bundle-version="1.3.1",
- org.eclipse.papyrus.infra.tools;bundle-version="0.9.0"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-ActivationPolicy: lazy
-Export-Package: org.eclipse.papyrus.uml.compare.editor
-Bundle-Localization: plugin
diff --git a/incoming/org.eclipse.papyrus.uml.compare/about.html b/incoming/org.eclipse.papyrus.uml.compare/about.html
deleted file mode 100644
index 82d49bf5f81..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
diff --git a/incoming/org.eclipse.papyrus.uml.compare/build.properties b/incoming/org.eclipse.papyrus.uml.compare/build.properties
deleted file mode 100644
index 75d692705a5..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/build.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- plugin.pdoc,\
- icons/,\
- build.properties,\
- about.html,\
- plugin.properties
-src.includes = about.html
diff --git a/incoming/org.eclipse.papyrus.uml.compare/icons/papyrus_compare_editor.gif b/incoming/org.eclipse.papyrus.uml.compare/icons/papyrus_compare_editor.gif
deleted file mode 100644
index e817df6ff0c..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/icons/papyrus_compare_editor.gif
+++ /dev/null
Binary files differ
diff --git a/incoming/org.eclipse.papyrus.uml.compare/plugin.pdoc b/incoming/org.eclipse.papyrus.uml.compare/plugin.pdoc
deleted file mode 100644
index 5c9b957330e..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/plugin.pdoc
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<doc:Documentation xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:doc="http://www.eclipse.org/papyrus/documentation/plugin/documentation" description="This plugin provides a UML Compare Editor for Papyrus. This CompareEditor is done&#xD;&#xA;to be opened in the sasheditor as the others papyrus editors (diagram and table)&#xD;&#xA;This editor is &quot;partially volatile&quot;, that is to say, we lose all its information when we close it, &#xD;&#xA;but we don't lose it when we close Papyrus or Eclipse (see bug 371606)&#xD;&#xA;">
- <referent firstName="vincent" lastName="lorenzo" eMail="vincent.lorenzo@cea.fr" currentCompany="CEA-LIST"/>
-</doc:Documentation>
diff --git a/incoming/org.eclipse.papyrus.uml.compare/plugin.properties b/incoming/org.eclipse.papyrus.uml.compare/plugin.properties
deleted file mode 100644
index a1f9b656864..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/plugin.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-#Properties file for org.eclipse.papyrus.uml.compare
-providerName = Eclipse Modeling Project
-pluginName = Papyrus UML Compare Editor (Incubation) \ No newline at end of file
diff --git a/incoming/org.eclipse.papyrus.uml.compare/plugin.xml b/incoming/org.eclipse.papyrus.uml.compare/plugin.xml
deleted file mode 100644
index 5ca3853758e..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/plugin.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.papyrus.infra.core.papyrusDiagram">
- <editorDiagram
- factoryClass="org.eclipse.papyrus.uml.compare.factory.UMLCompareEditorFactory"
- icon="icons/papyrus_compare_editor.gif">
- </editorDiagram>
- </extension>
- <extension
- point="org.eclipse.ui.commands">
- <command
- categoryId="org.eclipse.papyrus.editor.category"
- description="Create a UML Compare Editor"
- id="org.eclipse.papyrus.uml.compare.command"
- name="UML Compare Editor">
- </command>
- </extension>
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.papyrus.uml.compare.handler.UMLCompareEditorHandler"
- commandId="org.eclipse.papyrus.uml.compare.command">
- <activeWhen>
- <and>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
- </and>
- </activeWhen>
- </handler>
- </extension>
- <extension
- point="org.eclipse.ui.menus">
- <menuContribution
- allPopups="false"
- locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup">
- <command
- commandId="org.eclipse.papyrus.uml.compare.command"
- icon="icons/papyrus_compare_editor.gif"
- label="Compare 2 elements"
- style="push"
- tooltip="Compare 2 elements">
- <visibleWhen
- checkEnabled="false">
- <and>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
- </and>
- </visibleWhen>
- </command>
- </menuContribution>
- </extension>
-
-</plugin>
diff --git a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/Activator.java b/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/Activator.java
deleted file mode 100644
index 133ba809d72..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/Activator.java
+++ /dev/null
@@ -1,69 +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;
-
-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"; //$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;
- }
-
- /*
- * (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/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/content/viewer/UMLModelContentMergeDiffTab.java b/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/content/viewer/UMLModelContentMergeDiffTab.java
deleted file mode 100644
index d2f83ef8be0..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/content/viewer/UMLModelContentMergeDiffTab.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.eclipse.papyrus.uml.compare.content.viewer;
-
-import org.eclipse.emf.compare.ui.viewer.content.part.ModelContentMergeTabFolder;
-import org.eclipse.emf.compare.ui.viewer.content.part.diff.ModelContentMergeDiffTab;
-import org.eclipse.papyrus.uml.compare.utils.RootObject;
-import org.eclipse.swt.widgets.Composite;
-
-
-public class UMLModelContentMergeDiffTab extends ModelContentMergeDiffTab {
-
- public UMLModelContentMergeDiffTab(final Composite parentComposite, final int side, final ModelContentMergeTabFolder parentFolder) {
- super(parentComposite, side, parentFolder);
- }
-
- @Override
- public void setReflectiveInput(final Object object) {
- if(object instanceof RootObject) {
- clearCaches();
- setInput(object);
- setupCaches();
- needsRedraw = true;
- } else {
- super.setReflectiveInput(object);
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/content/viewer/UMLModelContentMergeTabFolder.java b/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/content/viewer/UMLModelContentMergeTabFolder.java
deleted file mode 100644
index 07d1b381e25..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/content/viewer/UMLModelContentMergeTabFolder.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.eclipse.papyrus.uml.compare.content.viewer;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.compare.ui.viewer.content.ModelContentMergeViewer;
-import org.eclipse.emf.compare.ui.viewer.content.part.IModelContentMergeViewerTab;
-import org.eclipse.emf.compare.util.AdapterUtils;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.papyrus.infra.emf.compare.ui.content.viewer.PapyrusModelContentMergeTabFolder;
-import org.eclipse.papyrus.uml.compare.utils.RootObject;
-import org.eclipse.swt.widgets.Composite;
-
-
-public class UMLModelContentMergeTabFolder extends PapyrusModelContentMergeTabFolder {
-
- public UMLModelContentMergeTabFolder(ModelContentMergeViewer viewer, Composite composite, int side) {
- super(viewer, composite, side);
- }
-
- /**
- *
- * @returnZ
- */
- protected IContentProvider createDiffTabContentProvider() {
- return new UMLModelContentMergeDiffTabContentProvider(AdapterUtils.getAdapterFactory());
- }
-
-
- @Override
- protected IModelContentMergeViewerTab createModelContentMergeDiffTab(Composite parent) {
- diffTab = new UMLModelContentMergeDiffTab(parent, partSide, this);
- diffTab.setContentProvider(createDiffTabContentProvider());
- return diffTab;
- }
-
- public class UMLModelContentMergeDiffTabContentProvider extends ModelContentMergeDiffTabContentProvider {
-
- public UMLModelContentMergeDiffTabContentProvider(AdapterFactory factory) {
- super(factory);
- }
-
- @Override
- public Object[] getElements(Object object) {
- if(object instanceof RootObject) {
- Object[] result = new Object[1];
- result[0] = ((RootObject)object).getRepresentedObject();
- return result;
- }
- return super.getElements(object);
- }
-
- }
-}
diff --git a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/content/viewer/UMLTransactionalModelContentMergeViewer.java b/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/content/viewer/UMLTransactionalModelContentMergeViewer.java
deleted file mode 100644
index 6dd55c290da..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/content/viewer/UMLTransactionalModelContentMergeViewer.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.eclipse.papyrus.uml.compare.content.viewer;
-
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.compare.contentmergeviewer.IMergeViewerContentProvider;
-import org.eclipse.emf.compare.ui.viewer.content.ModelContentMergeContentProvider;
-import org.eclipse.emf.compare.ui.viewer.content.part.ModelContentMergeTabFolder;
-import org.eclipse.papyrus.infra.emf.compare.ui.content.transactional.viewer.PapyrusTransactionalModelContentMergeViewer;
-import org.eclipse.papyrus.uml.compare.utils.RootObject;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-
-
-public class UMLTransactionalModelContentMergeViewer extends PapyrusTransactionalModelContentMergeViewer {
-
-
- public UMLTransactionalModelContentMergeViewer(final Composite parent, final CompareConfiguration config, final IEditorPart editor) {
- super(parent, config, editor);
- }
-
-
- @Override
- protected IMergeViewerContentProvider createMergeViewerContentProvider() {
- return new ModelContentMergeContentProvider(configuration) {
-
- @Override
- public Object getLeftContent(final Object element) {
- if(element != null) {
- return new RootObject(configuration.getProperty(RootObject.LEFT_OBJECT_KEY));
- }
- return null;
- }
-
- @Override
- public Object getRightContent(final Object element) {
- if(element != null) {
- return new RootObject(configuration.getProperty(RootObject.RIGHT_OBJECT_KEY));
- }
- return null;
- }
- };
-
- }
-
- /**
- *
- * {@inheritDoc}
- *
- * @param composite
- * @param side
- * @return
- */
- @Override
- protected ModelContentMergeTabFolder createModelContentMergeTabFolder(final Composite composite, final int side) {
- return new UMLModelContentMergeTabFolder(this, composite, side);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/editor/UMLCompareEditor.java b/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/editor/UMLCompareEditor.java
deleted file mode 100644
index 4665547934f..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/editor/UMLCompareEditor.java
+++ /dev/null
@@ -1,180 +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.editor;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.compare.diff.metamodel.ComparisonSnapshot;
-import org.eclipse.emf.compare.diff.metamodel.DiffElement;
-import org.eclipse.emf.compare.diff.metamodel.DiffModel;
-import org.eclipse.emf.compare.diff.metamodel.MoveModelElement;
-import org.eclipse.emf.compare.match.MatchOptions;
-import org.eclipse.emf.compare.match.engine.GenericMatchScopeProvider;
-import org.eclipse.emf.compare.match.engine.IMatchEngine;
-import org.eclipse.emf.compare.match.engine.IMatchScopeProvider;
-import org.eclipse.emf.compare.match.metamodel.MatchModel;
-import org.eclipse.emf.compare.ui.editor.ModelCompareEditorInput;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.infra.emf.compare.common.editor.EMFCompareEditor;
-import org.eclipse.papyrus.infra.emf.compare.common.utils.PapyrusModelCompareEditorInput;
-import org.eclipse.papyrus.infra.emf.compare.instance.papyrusemfcompareinstance.PapyrusEMFCompareInstance;
-import org.eclipse.papyrus.uml.compare.utils.RootObject;
-import org.eclipse.papyrus.uml.compare.utils.UMLDiffService;
-import org.eclipse.papyrus.uml.compare.utils.UMLMatchEngine;
-import org.eclipse.papyrus.uml.compare.utils.UMLModelCompareEditorInput;
-import org.eclipse.uml2.uml.NamedElement;
-
-
-
-public class UMLCompareEditor extends EMFCompareEditor {
-
- /** the type of the editor */
- public static final String EDITOR_TYPE = "PapyrusUMLCompare"; //$NON-NLS-1$
-
- /**
- * @param servicesRegistry
- * @param rawModel
- *
- */
- public UMLCompareEditor(final ServicesRegistry servicesRegistry, final PapyrusEMFCompareInstance rawModel) {
- super(servicesRegistry, rawModel);
- }
-
- /**
- *
- * @see org.eclipse.papyrus.infra.emf.compare.common.editor.AbstractPapyrusCompareEditor#getCompareOptions(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject)
- *
- * @param monitor
- * @param leftObject
- * @param rightObject
- * @return
- */
- @Override
- protected Map<String, Object> getCompareOptions(final IProgressMonitor monitor, final EObject leftObject, final EObject rightObject) {
- final Map<String, Object> options = super.getCompareOptions(monitor, leftObject, rightObject);
- //we override the options for the comparison
- options.put(MatchOptions.OPTION_PROGRESS_MONITOR, monitor);
- options.put(MatchOptions.OPTION_IGNORE_ID, Boolean.TRUE);
- options.put(MatchOptions.OPTION_IGNORE_XMI_ID, Boolean.TRUE);
- options.put(MatchOptions.OPTION_MATCH_SCOPE_PROVIDER, getMatchScopeProvider(leftObject, rightObject));
- return options;
- }
-
- /**
- *
- * @see org.eclipse.papyrus.infra.emf.compare.common.editor.AbstractPapyrusCompareEditor#getMatchScopeProvider(org.eclipse.emf.ecore.EObject,
- * org.eclipse.emf.ecore.EObject)
- *
- * @param left
- * @param right
- * @return
- */
- @Override
- protected IMatchScopeProvider getMatchScopeProvider(final EObject left, final EObject right) {
- return new GenericMatchScopeProvider(left, right);
- }
-
-
- @Override
- protected MatchModel doContentMatch(final EObject left, final EObject right, final Map<String, Object> options) throws InterruptedException {
- final IMatchEngine engine = new UMLMatchEngine();
- final MatchModel result = engine.contentMatch(left, right, options);
- engine.reset();
- return result;
- }
-
- @Override
- protected ComparisonSnapshot doContentCompare(final EObject left, final EObject right) {
- final ComparisonSnapshot snapshot = super.doContentCompare(left, right);
- cleanSnapshot(snapshot);
- return snapshot;
- }
-
- /**
- * A part of this method is duplicated from DiffService#doDiff
- *
- * @param match
- * @return
- */
- @Override
- protected DiffModel doDiff(final MatchModel match) {
- return UMLDiffService.doDiff(match, false);
- }
-
- /**
- * This method allows to remove unnecessary differences :
- * we don't show element move from the root element (see bug 377143)
- *
- * @param snapshot
- * the snapshot
- */
- private void cleanSnapshot(final ComparisonSnapshot snapshot) {
- final EList<EObject> contents = snapshot.eContents();
- final DiffModel root = (DiffModel)contents.get(0);
- final EList<DiffElement> differences = root.getDifferences();
- final List<DiffElement> toRemove = new ArrayList<DiffElement>();
- for(DiffElement current : differences) {
- if(current instanceof MoveModelElement) {
- EObject leftTarget = ((MoveModelElement)current).getLeftTarget();
- EObject rightTarget = ((MoveModelElement)current).getRightTarget();
- if(leftTarget == null && rightTarget == null) {
- toRemove.add(current);
- }
- }
- }
- for(DiffElement current : toRemove) {
- EcoreUtil.remove(current);
- }
- }
-
-
- @Override
- protected ModelCompareEditorInput createModelCompareEditorInput(final ComparisonSnapshot snapshot) {
- return new UMLModelCompareEditorInput(snapshot, this);
- }
-
- @Override
- protected void configureInput(final PapyrusModelCompareEditorInput input) {
-
- //TODO : warning if we use a label provider, warnign to the stereotype use
- CompareConfiguration cc = input.getCompareConfiguration();
- ILabelProvider prov = getLabelProvider();
- String leftQName = null;
- String rightQName = null;
- EObject left = this.rawModel.getLeft();
- if(left instanceof NamedElement) {
- leftQName = ((NamedElement)left).getQualifiedName();
- }
- EObject right = this.rawModel.getRight();
- if(right instanceof NamedElement) {
- rightQName = ((NamedElement)right).getQualifiedName();
- }
-
- cc.setLeftLabel(leftQName);
- cc.setRightLabel(rightQName);
- cc.setLeftImage(prov.getImage(left));
- cc.setRightImage(prov.getImage(right));
- cc.setProperty(RootObject.LEFT_OBJECT_KEY, rawModel.getLeft());
- cc.setProperty(RootObject.RIGHT_OBJECT_KEY, rawModel.getRight());
- };
-}
diff --git a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/factory/UMLCompareEditorFactory.java b/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/factory/UMLCompareEditorFactory.java
deleted file mode 100644
index 62073e895f1..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/factory/UMLCompareEditorFactory.java
+++ /dev/null
@@ -1,31 +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.factory;
-
-import org.eclipse.papyrus.infra.emf.compare.common.factory.AbstractEMFCompareEditorFactory;
-import org.eclipse.papyrus.uml.compare.editor.UMLCompareEditor;
-
-
-public class UMLCompareEditorFactory extends AbstractEMFCompareEditorFactory {
-
- /**
- * Constructor.
- *
- * @param diagramClass
- * @param expectedType
- */
- public UMLCompareEditorFactory() {
- super(UMLCompareEditor.class, UMLCompareEditor.EDITOR_TYPE);
- }
-}
diff --git a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/handler/UMLCompareEditorHandler.java b/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/handler/UMLCompareEditorHandler.java
deleted file mode 100644
index bfda63037a1..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/handler/UMLCompareEditorHandler.java
+++ /dev/null
@@ -1,60 +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.handler;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.infra.emf.compare.common.handler.AbstractEMFCompareEditorHandler;
-import org.eclipse.papyrus.uml.compare.editor.UMLCompareEditor;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * The handler for the UML Compare Editor
- */
-public class UMLCompareEditorHandler extends AbstractEMFCompareEditorHandler {
-
- public UMLCompareEditorHandler() {
- super(UMLCompareEditor.EDITOR_TYPE);
- }
-
- /**
- *
- * @see org.eclipse.papyrus.infra.emf.compare.common.handler.AbstractEMFCompareEditorHandler#getSelection()
- *
- * @return
- */
- @Override
- protected List<EObject> getSelection() {
- List<EObject> umlSelection = new ArrayList<EObject>();
- for(EObject current : super.getSelection()) {
- if(current instanceof Element) {
- umlSelection.add(current);
- }
- }
- return umlSelection;
- }
-
- @Override
- public boolean isEnabled() {
- boolean enabled = super.isEnabled();
- if(enabled) {
- EObject left = getSelection().get(0);
- EObject right = getSelection().get(1);
- return left.getClass() == right.getClass();
- }
- return false;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/tatiana/ElementContentDiffEngine.java b/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/tatiana/ElementContentDiffEngine.java
deleted file mode 100644
index 385ae1e7cfd..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/tatiana/ElementContentDiffEngine.java
+++ /dev/null
@@ -1,99 +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.uml.compare.tatiana;
-
-import org.eclipse.emf.compare.diff.engine.GenericDiffEngine;
-import org.eclipse.emf.compare.diff.metamodel.DiffElement;
-import org.eclipse.emf.compare.diff.metamodel.DiffGroup;
-import org.eclipse.emf.compare.diff.metamodel.DiffModel;
-import org.eclipse.emf.compare.diff.metamodel.MoveModelElement;
-import org.eclipse.emf.ecore.EObject;
-
-
-/**
- /**
- * The implementation of DiffEngine to compare two arbitrary elements, not nesseserily diagrams
- */
-public class ElementContentDiffEngine extends GenericDiffEngine/*PapyrusDiffEngine*/ {
-
- /** The my left. */
- private final EObject myLeft;
-
- /** The my right. */
- private final EObject myRight;
-
- /**
- * Instantiates a new element content diff engine.
- *
- * @param left the left
- * @param right the right
- */
- public ElementContentDiffEngine(EObject left, EObject right) {
- this.myLeft = left;
- this.myRight = right;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.emf.compare.diff.engine.GenericDiffEngine#addInContainerPackage(org.eclipse.emf.compare.diff.metamodel.DiffGroup, org.eclipse.emf.compare.diff.metamodel.DiffElement, org.eclipse.emf.ecore.EObject)
- */
- @Override
- protected void addInContainerPackage(DiffGroup root, DiffElement operation, EObject targetParent) {
-// if(targetParent == myLeft || targetParent == myRight) {
-// root.getSubDiffElements().add(operation);
-// return;
-// }
- super.addInContainerPackage(root, operation, targetParent);
- }
-
-// /* (non-Javadoc)
-// * @see org.eclipse.papyrus.uml.compare.diff.PapyrusDiffEngine#postProcess(org.eclipse.emf.compare.diff.metamodel.DiffModel)
-// */
-// @Override
-// protected DiffModel postProcess(DiffModel diffModel) {
-// super.postProcess(diffModel);
-// //#336361 - [UML Compare] Compare two elements: show right element as root
-// DiffElement newRoot = findDiffElementFor(diffModel, myRight);
-// CompareTwoElementsDiffModel newRootExt = buildCompareTwoElementsDiff(diffModel, newRoot);
-// return newRootExt;
-// }
-
- /**
- * Builds the compare two elements diff.
- *
- * @param object the object
- * @param newRott the new rott
- * @return the compare two elements diff model
- */
-// private CompareTwoElementsDiffModel buildCompareTwoElementsDiff(DiffModel object, DiffElement newRott) {
-// CompareTwoElementsDiffModel newElement = UMLDiffFactory.eINSTANCE.createCompareTwoElementsDiffModel();
-// newElement.getLeftRoots().add(myLeft);
-// newElement.getRightRoots().add(myRight);
-//// newElement.getAncestorRoots().addAll(object.getAncestorRoots());
-// newElement.getOwnedElements().add(newRott);
-// return newElement;
-// }
-
- /* (non-Javadoc)
- * @see org.eclipse.papyrus.uml.compare.diff.PapyrusDiffEngine#visitElement(org.eclipse.emf.compare.diff.metamodel.DiffModel, org.eclipse.emf.compare.diff.metamodel.DiffElement)
- */
-// @Override
-// protected void visitElement(DiffModel root, DiffElement diffElement) {
-// super.visitElement(root, diffElement);
-// if (diffElement instanceof MoveModelElement) {
-// // don't show 'element moved for the root elements'
-// hideElement(diffElement, null);
-// }
-// }
-
-}
diff --git a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/tatiana/ElementContentMatchEngine.java b/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/tatiana/ElementContentMatchEngine.java
deleted file mode 100644
index 63ef73a4fc1..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/tatiana/ElementContentMatchEngine.java
+++ /dev/null
@@ -1,110 +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.uml.compare.tatiana;
-
-import org.eclipse.emf.compare.FactoryException;
-import org.eclipse.emf.compare.match.engine.AbstractSimilarityChecker;
-import org.eclipse.emf.compare.match.engine.GenericMatchEngine;
-import org.eclipse.emf.compare.match.statistic.MetamodelFilter;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-
-/**
- * The implementation of MatchEngine to compare two arbitrary elements, not nesseserily diagrams
- */
-public class ElementContentMatchEngine extends GenericMatchEngine{ //PapyrusMatchEngine {
-
- /** The my left. */
- private final EObject myLeft;
-
- /** The my right. */
- private final EObject myRight;
-
- /**
- * Instantiates a new element content match engine.
- *
- * @param left the left
- * @param right the right
- */
- public ElementContentMatchEngine(EObject left, EObject right) {
- this.myLeft = left;
- this.myRight = right;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.papyrus.uml.compare.match.PapyrusMatchEngine#prepareChecker()
- */
- @Override
- protected AbstractSimilarityChecker prepareChecker() {
- return new AlwaysSimilarChecker(filter, super.prepareChecker());
- }
-
- /**
- * The Class AlwaysSimilarChecker.
- */
- private class AlwaysSimilarChecker extends AbstractSimilarityChecker {
-
- /** The delegate. */
- private AbstractSimilarityChecker delegate;
-
- /**
- * Instantiates a new always similar checker.
- *
- * @param filter the filter
- * @param fallback the fallback
- */
- public AlwaysSimilarChecker(MetamodelFilter filter, AbstractSimilarityChecker fallback) {
- super(filter);
- this.delegate = fallback;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.emf.compare.match.engine.AbstractSimilarityChecker#isSimilar(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject)
- */
- /**
- * The standard AbstractSimilarityChecker checks the parent of the elements,
- * thus, compared elements won't be considered similar.
- * To avoid this problem this method always returns true
- **/
- @Override
- public boolean isSimilar(EObject obj1, EObject obj2) throws FactoryException {
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.emf.compare.match.engine.AbstractSimilarityChecker#init(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject)
- */
- @Override
- public void init(EObject leftObject, EObject rightObject) throws FactoryException {
- delegate.init(leftObject, rightObject);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.emf.compare.match.engine.AbstractSimilarityChecker#init(org.eclipse.emf.ecore.resource.Resource, org.eclipse.emf.ecore.resource.Resource)
- */
- @Override
- public void init(Resource leftResource, Resource rightResource) throws FactoryException {
- delegate.init(leftResource, rightResource);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.emf.compare.match.engine.AbstractSimilarityChecker#absoluteMetric(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject)
- */
- @Override
- public double absoluteMetric(EObject obj1, EObject obj2) throws FactoryException {
- return delegate.absoluteMetric(obj1, obj2);
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/tatiana/PapyrusDiffEngine.java b/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/tatiana/PapyrusDiffEngine.java
deleted file mode 100644
index e7bc3bed97f..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/tatiana/PapyrusDiffEngine.java
+++ /dev/null
@@ -1,210 +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.uml.compare.tatiana;
-
-
-import java.util.Iterator;
-
-import org.eclipse.emf.compare.diff.engine.GenericDiffEngine;
-import org.eclipse.emf.compare.diff.engine.check.ReferencesCheck;
-import org.eclipse.emf.compare.diff.metamodel.AbstractDiffExtension;
-import org.eclipse.emf.compare.diff.metamodel.DiffElement;
-import org.eclipse.emf.compare.diff.metamodel.DiffFactory;
-import org.eclipse.emf.compare.diff.metamodel.DiffGroup;
-import org.eclipse.emf.compare.diff.metamodel.DiffModel;
-import org.eclipse.emf.compare.diff.metamodel.util.DiffSwitch;
-import org.eclipse.emf.compare.match.metamodel.MatchModel;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.uml.compare.UMLCompareUtils;
-import org.eclipse.papyrus.uml.compare.diff.extension.DiffElementExtensionBuilder;
-import org.eclipse.papyrus.uml.compare.diff.metamodel.uml_diff_extension.UMLDiffFactory;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.util.UMLUtil;
-
-
-/**
- * Implementation of DiffEngine for UML Diagrams:
- * <li>Properly processes changes stereotypes and tagged values,</li>
- * <li>doesn't show numerous bulk changes as described in Bug 316819#c1</li>
- */
-public class PapyrusDiffEngine extends GenericDiffEngine {
-
- /** The my diff element builder. */
- private DiffSwitch<AbstractDiffExtension> myDiffElementBuilder = new DiffElementExtensionBuilder();
-
- /** The my get model element switch. */
- private DiffSwitch<EObject> myGetModelElementSwitch = new ModelElementSwitch();
-
- /* (non-Javadoc)
- * @see org.eclipse.emf.compare.diff.engine.GenericDiffEngine#getReferencesChecker()
- */
- @Override
- protected ReferencesCheck getReferencesChecker() {
- return new UMLReferenceCheck(matchCrossReferencer);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.emf.compare.diff.engine.GenericDiffEngine#doDiff(org.eclipse.emf.compare.match.metamodel.MatchModel, boolean)
- */
- @Override
- public DiffModel doDiff(MatchModel match, boolean threeWay) {
- DiffModel result = super.doDiff(match, threeWay);
- return postProcess(result);
- }
-
-
- /**
- * Post process default result of Diff.
- * Processes changes stereotypes and tagged values
- *
- * @param diffModel the diff model
- * @return the diff model
- */
- protected DiffModel postProcess(DiffModel diffModel) {
- final Iterator<EObject> it = diffModel.eAllContents();
- while(it.hasNext()) {
- DiffElement diffElement = (DiffElement)it.next();
- visitElement(diffModel, diffElement);
- }
- return diffModel;
- }
-
- /**
- * Visit element.
- *
- * @param root the root
- * @param diffElement the diff element
- */
- protected void visitElement(DiffModel root, DiffElement diffElement) {
- if(diffElement instanceof DiffGroup) {
- return;
- }
- EObject stereotypeApplication = getModelElementFor(diffElement);
- if(UMLCompareUtils.isStereotypeApplication(stereotypeApplication)) {
-
- Element newVisualParent = UMLUtil.getBaseElement(stereotypeApplication);
- DiffElement newDiffParent = findOrCreateDiffElementFor(root, newVisualParent);
- AbstractDiffExtension taggedValueDiff = createDiffExtentionElementFor(diffElement);
-
- newDiffParent.getSubDiffElements().add((DiffElement)taggedValueDiff);
- hideElement(diffElement, taggedValueDiff);
- }
- }
-
- /**
- * Hide element.
- *
- * @param diffElement the diff element
- * @param diffExtension the diff extension
- */
- protected void hideElement(DiffElement diffElement, AbstractDiffExtension diffExtension) {
- if(diffExtension == null) {
- diffExtension = UMLDiffFactory.eINSTANCE.createAddStereotypeApplication();
- }
- diffExtension.getHideElements().add(diffElement);
- }
-
- /**
- * Find or create diff element for.
- *
- * @param root the root
- * @param object the object
- * @return the diff element
- */
- private DiffElement findOrCreateDiffElementFor(DiffModel root, EObject object) {
- if(object == null) {
- if(!root.getOwnedElements().isEmpty()) {
- return root.getOwnedElements().get(0);
- }
- DiffGroup diffRoot = DiffFactory.eINSTANCE.createDiffGroup();
- root.getOwnedElements().add(diffRoot);
- return diffRoot;
- }
- DiffElement element = findDiffElementFor(root, object);
- if(element != null) {
- return element;
- }
-
- DiffElement diffParent = findOrCreateDiffElementFor(root, getParent(object));
- DiffGroup diffElementForObject = DiffFactory.eINSTANCE.createDiffGroup();
- diffElementForObject.setRightParent(object);
-
- diffParent.getSubDiffElements().add(diffElementForObject);
- return diffElementForObject;
- }
-
- /**
- * Gets the parent.
- *
- * @param modelElement the model element
- * @return the parent
- */
- private EObject getParent(EObject modelElement) {
- return modelElement.eContainer();
- }
-
- /**
- * Find diff element for.
- *
- * @param root the root
- * @param modelElement the model element
- * @return the diff element
- */
- protected final DiffElement findDiffElementFor(DiffModel root, EObject modelElement) {
- if(modelElement == null) {
- return null;
- }
- final Iterator<EObject> it = root.eAllContents();
- while(it.hasNext()) {
- final DiffElement element = (DiffElement)it.next();
- if(isPertinentDiff(element, modelElement)) {
- return element;
- }
- }
- return null;
- }
-
- /**
- * Checks if is pertinent diff.
- *
- * @param diff the diff
- * @param modelElement the model element
- * @return true, if is pertinent diff
- */
- private boolean isPertinentDiff(DiffElement diff, EObject modelElement) {
- EObject domainElement = getModelElementFor(diff);
- return modelElement.equals(domainElement) || modelElement.equals(getMatchedEObject(domainElement));
- }
-
- /**
- * Gets the model element for.
- *
- * @param diff the diff
- * @return the model element for
- */
- protected EObject getModelElementFor(DiffElement diff) {
- return myGetModelElementSwitch.doSwitch(diff);
- }
-
- /**
- * Creates the diff extention element for.
- *
- * @param diffElement the diff element
- * @return the abstract diff extension
- */
- protected AbstractDiffExtension createDiffExtentionElementFor(DiffElement diffElement) {
- return myDiffElementBuilder.doSwitch(diffElement);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/tatiana/PapyrusMatchEngine.java b/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/tatiana/PapyrusMatchEngine.java
deleted file mode 100644
index 329d13a1709..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/tatiana/PapyrusMatchEngine.java
+++ /dev/null
@@ -1,69 +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.uml.compare.tatiana;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.compare.match.MatchOptions;
-import org.eclipse.emf.compare.match.engine.GenericMatchEngine;
-import org.eclipse.emf.compare.match.engine.IMatchScope;
-import org.eclipse.emf.compare.match.metamodel.MatchModel;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.uml2.uml.Element;
-
-
-/**
- * Implementation of MatchEngine for UML Diagrams:
- * <li>Processes changes in stereotypes and tagged values as children of the base element, not of resource</li>
- */
-public class PapyrusMatchEngine extends GenericMatchEngine {
-
- /* (non-Javadoc)
- * @see org.eclipse.emf.compare.match.engine.GenericMatchEngine#resourceMatch(org.eclipse.emf.ecore.resource.Resource, org.eclipse.emf.ecore.resource.Resource, java.util.Map)
- */
- @Override
- public MatchModel resourceMatch(Resource leftResource, Resource rightResource, Map<String, Object> optionMap) throws InterruptedException {
- optionMap.put(MatchOptions.OPTION_MATCH_SCOPE_PROVIDER, new PapyrusMatchScopeProvider(leftResource, rightResource));
- return super.resourceMatch(leftResource, rightResource, optionMap);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.emf.compare.match.engine.GenericMatchEngine#getScopeInternalContents(org.eclipse.emf.ecore.EObject, org.eclipse.emf.compare.match.engine.IMatchScope)
- */
- @Override
- protected List<EObject> getScopeInternalContents(EObject eObject, IMatchScope scope) {
- ArrayList<EObject> result = new ArrayList<EObject>(super.getScopeInternalContents(eObject, scope));
- result.addAll(getStereotypeApplications(eObject));
- return result;
- }
-
- /**
- * Gets the stereotype applications.
- *
- * @param eObject the e object
- * @return the stereotype applications
- */
- private List<EObject> getStereotypeApplications(EObject eObject) {
- if(eObject instanceof Element) {
- return ((Element)eObject).getStereotypeApplications();
- } else {
- return Collections.emptyList();
- }
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/RootObject.java b/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/RootObject.java
deleted file mode 100644
index 09e6bca0d34..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/RootObject.java
+++ /dev/null
@@ -1,57 +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.utils;
-
-
-
-/**
- *
- * This class allows to recognize easily the root object in the viewer.
- * This class was introduced for comparison from the ModelExplorer
- *
- */
-public class RootObject {
-
- /**
- * the key for the left root object
- */
- public static final String LEFT_OBJECT_KEY = "leftObject";
-
- /**
- * the key for the right root object
- */
- public static final String RIGHT_OBJECT_KEY = "rightObject"; //TODO useful
-
- /** The represented object. */
- private Object representedObject = null;
-
- /**
- * Instantiates a new root object.
- *
- * @param object
- * the object
- */
- public RootObject(final Object object) {
- this.representedObject = object;
- }
-
- /**
- * Gets the represented object.
- *
- * @return the represented object
- */
- public Object getRepresentedObject() {
- return this.representedObject;
- }
-}
diff --git a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/UMLDiffEngine.java b/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/UMLDiffEngine.java
deleted file mode 100644
index 6677d596e31..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/UMLDiffEngine.java
+++ /dev/null
@@ -1,41 +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.utils;
-
-import org.eclipse.emf.compare.diff.engine.GenericDiffEngine;
-import org.eclipse.emf.compare.diff.metamodel.DiffGroup;
-import org.eclipse.emf.compare.match.metamodel.Match2Elements;
-
-/**
- *
- * A specific DiffEngine for the Nested UML Compare Editor
- * see bug 377154
- */
-//TODO verify the upper class for UML models
-public class UMLDiffEngine extends GenericDiffEngine {
-
- /**
- *
- * @see org.eclipse.emf.compare.diff.engine.GenericDiffEngine#checkContainmentUpdate(org.eclipse.emf.compare.diff.metamodel.DiffGroup,
- * org.eclipse.emf.compare.match.metamodel.Match2Elements)
- *
- * @param current
- * @param matchElement
- */
- protected void checkContainmentUpdate(DiffGroup current, Match2Elements matchElement) {
- //when we compare 2 elements owned by the same file, we don't verify their container
- //see bug 377154
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/UMLDiffService.java b/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/UMLDiffService.java
deleted file mode 100644
index a53785f106c..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/UMLDiffService.java
+++ /dev/null
@@ -1,100 +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.utils;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Collection;
-
-import org.eclipse.emf.compare.diff.engine.IDiffEngine;
-import org.eclipse.emf.compare.diff.metamodel.AbstractDiffExtension;
-import org.eclipse.emf.compare.diff.metamodel.DiffModel;
-import org.eclipse.emf.compare.diff.service.DiffService;
-import org.eclipse.emf.compare.match.metamodel.MatchModel;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.infra.tools.util.ReflectHelper;
-import org.eclipse.papyrus.uml.compare.Activator;
-
-/**
- *
- * A specific DiffService for the Nested UML Compare Editor
- * @see DiffService
- * @see bug 377154
- */
-//TODO ask to EMF-Compare to open their API
-public class UMLDiffService {
-
- private static Method fillRequiredDifferencesMethod = null;
-
- /**
- * Utility classes don't need to (and shouldn't) be instantiated.
- */
- private UMLDiffService() {
- // prevents instantiation
- }
-
-
-
- /**
- * Return a diffmodel created using the match model. This implementation is a generic and simple one.
- *
- * @param match
- * the matching model
- * @param threeWay
- * <code>True</code> if we're computing a three way comparison, <code>False</code> otherwise.
- * @return the corresponding diff model
- */
- public static DiffModel doDiff(MatchModel match, boolean threeWay) {
- // final IDiffEngine engine = getBestDiffEngine(match);
- final IDiffEngine engine = new UMLDiffEngine(); //TODO verify that it is the correct diff engine for UML
- final DiffModel diff = engine.doDiff(match, threeWay);
-
- final Collection<AbstractDiffExtension> extensions = DiffService.getCorrespondingDiffExtensions(match);
- for(final AbstractDiffExtension ext : extensions) {
- if(ext != null) {
- ext.visit(diff);
- }
- }
-
- engine.reset();
-
- fillRequiredDifferences(diff);
-
- return diff;
- }
-
- //TODO write a JUnit test to be sue that the method called reflexively is always available
- private static void fillRequiredDifferences(final DiffModel diff) {
- if(fillRequiredDifferencesMethod == null) {
- try {
- fillRequiredDifferencesMethod = ReflectHelper.getMethod(DiffService.class, "fillRequiredDifferences", new Class<?>[]{ EObject.class });
- } catch (SecurityException e) {
- Activator.log.error(e);
- } catch (NoSuchMethodException e) {
- Activator.log.error(e);
- }
- }
- final Object[] parameters = new Object[1];
- parameters[0] = diff;
- try {
- fillRequiredDifferencesMethod.invoke(null, parameters);
- } catch (IllegalArgumentException e) {
- Activator.log.error(e);
- } catch (IllegalAccessException e) {
- Activator.log.error(e);
- } catch (InvocationTargetException e) {
- Activator.log.error(e);
- }
- }
-}
diff --git a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/UMLMatchEngine.java b/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/UMLMatchEngine.java
deleted file mode 100644
index 57e4a979e52..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/UMLMatchEngine.java
+++ /dev/null
@@ -1,106 +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.utils;
-
-import java.util.Map;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.emf.compare.FactoryException;
-import org.eclipse.emf.compare.match.engine.AbstractSimilarityChecker;
-import org.eclipse.emf.compare.match.engine.GenericMatchEngine;
-import org.eclipse.emf.compare.match.engine.internal.DistinctEcoreSimilarityChecker;
-import org.eclipse.emf.compare.match.engine.internal.GenericMatchEngineToCheckerBridge;
-import org.eclipse.emf.compare.match.internal.statistic.NameSimilarity;
-import org.eclipse.emf.compare.match.metamodel.MatchModel;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.infra.emf.compare.common.utils.EMFCompareUtils;
-
-//TODO verify the super class for UML models
-/**
- *
- * A specific match engine for the Nested UML Compare Editor
- * @see bug 377154
- */
-public class UMLMatchEngine extends GenericMatchEngine {
-
- /** the left object to compare */
- private EObject leftObject;
-
- /** the right object to compare */
- private EObject rightObject;
-
- /**
- *
- * @see org.eclipse.emf.compare.match.engine.GenericMatchEngine#contentMatch(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject, java.util.Map)
- *
- * @param leftObject
- * @param rightObject
- * @param optionMap
- * @return
- */
- @Override
- public MatchModel contentMatch(EObject leftObject, EObject rightObject, Map<String, Object> optionMap) {
- this.leftObject = leftObject;
- this.rightObject = rightObject;
- return super.contentMatch(leftObject, rightObject, optionMap);
- }
-
- /**
- *
- * @see org.eclipse.emf.compare.match.engine.GenericMatchEngine#prepareChecker()
- *
- * @return
- */
- protected AbstractSimilarityChecker prepareChecker() {
- AbstractSimilarityChecker checker = null;
- GenericMatchEngineToCheckerBridge bridge = new UMLGenericMatchEngineToCheckerBridge();
- Assert.isNotNull(leftObject);
- Assert.isNotNull(rightObject);
- checker = new UMLSimilarityChecker(filter, bridge, leftObject, rightObject);
- return checker;
- }
-
-
- /**
- *
- * Duplicate code from GenericMatchEngine
- *
- */
- private class UMLGenericMatchEngineToCheckerBridge extends GenericMatchEngineToCheckerBridge {
-
- @Override
- public double contentSimilarity(EObject obj1, EObject obj2) throws FactoryException {
- double similarity = 0d;
- try {
-
- similarity = NameSimilarity.nameSimilarityMetric(NameSimilarity.findName(obj1), NameSimilarity.findName(obj2));
- } catch (final FactoryException e) {
- // fails silently, will return a similarity of 0d
- }
- return similarity;
- }
-
- @Override
- public double nameSimilarity(EObject obj1, EObject obj2) {
- double similarity = 0d;
- try {
- similarity = NameSimilarity.nameSimilarityMetric(NameSimilarity.contentValue(obj1), NameSimilarity.contentValue(obj2));
- } catch (FactoryException e) {
- // fails silently, will return a similarity of 0d
- }
- return similarity;
- }
-
- }
-}
diff --git a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/UMLModelCompareEditorInput.java b/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/UMLModelCompareEditorInput.java
deleted file mode 100644
index d7214228dda..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/UMLModelCompareEditorInput.java
+++ /dev/null
@@ -1,58 +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.utils;
-
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.compare.CompareViewerPane;
-import org.eclipse.emf.compare.diff.metamodel.ComparisonSnapshot;
-import org.eclipse.emf.compare.ui.viewer.content.ModelContentMergeViewer;
-import org.eclipse.papyrus.infra.emf.compare.common.utils.PapyrusModelCompareEditorInput;
-import org.eclipse.papyrus.uml.compare.content.viewer.UMLTransactionalModelContentMergeViewer;
-import org.eclipse.ui.IEditorPart;
-
-/**
- *
- * The Input for the nested UMLCompareEditor
- *
- */
-public class UMLModelCompareEditorInput extends PapyrusModelCompareEditorInput {
-
- /**
- *
- * Constructor.
- *
- * @param snapshot
- * the comparison snapshot
- * @param editor
- * the editor
- */
- public UMLModelCompareEditorInput(final ComparisonSnapshot snapshot, final IEditorPart editor) {
- super(snapshot, editor);
- }
-
- /**
- *
- * @see org.eclipse.papyrus.infra.emf.compare.common.utils.PapyrusModelCompareEditorInput#createMergeViewer(org.eclipse.compare.CompareViewerPane,
- * org.eclipse.compare.CompareConfiguration)
- *
- * @param pane
- * @param config
- * @return
- */
- @Override
- protected ModelContentMergeViewer createMergeViewer(final CompareViewerPane pane, final CompareConfiguration config) {
- return new UMLTransactionalModelContentMergeViewer(pane, config, editor);
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/UMLSimilarityChecker.java b/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/UMLSimilarityChecker.java
deleted file mode 100644
index 0288e864de5..00000000000
--- a/incoming/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/UMLSimilarityChecker.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.utils;
-
-import org.eclipse.emf.compare.FactoryException;
-import org.eclipse.emf.compare.match.engine.internal.DistinctEcoreSimilarityChecker;
-import org.eclipse.emf.compare.match.engine.internal.GenericMatchEngineToCheckerBridge;
-import org.eclipse.emf.compare.match.statistic.MetamodelFilter;
-import org.eclipse.emf.ecore.EObject;
-
-//TODO : verify the upper class for UML
-/**
- *
- * A specific similarity checker for the Nested UML Compare Editor
- * @see bug 377154
- */
-public class UMLSimilarityChecker extends DistinctEcoreSimilarityChecker {
-
- /** the left object to compare */
- private final EObject rootLeft;
-
- /** the right object to compare */
- private final EObject rootRight;
-
- /**
- *
- * Constructor.
- *
- * @param filter
- * @param bridge
- * @param left
- * the left object to compare
- * @param right
- * the right object to compare
- */
- public UMLSimilarityChecker(final MetamodelFilter filter, final GenericMatchEngineToCheckerBridge bridge, final EObject left, final EObject right) {
- super(filter, bridge);
- this.rootLeft = left;
- this.rootRight = right;
- }
-
- /**
- *
- * @see org.eclipse.emf.compare.match.engine.internal.DistinctEcoreSimilarityChecker#isSimilar(org.eclipse.emf.ecore.EObject,
- * org.eclipse.emf.ecore.EObject)
- *
- * @param obj1
- * @param obj2
- * @return
- * @throws FactoryException
- */
- @Override
- public boolean isSimilar(final EObject obj1, final EObject obj2) throws FactoryException {
-
- /**
- * We consider that the compared element are always similar (but there names can be different!)
- */
- if(obj1 == rootLeft || obj1 == rootRight) {
- if(obj2 == rootLeft || obj2 == rootRight) {
- return true;
- }
- }
- return super.isSimilar(obj1, obj2);
- }
-}

Back to the top