Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/.classpath7
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/.project28
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/META-INF/MANIFEST.MF41
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/about.html28
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/build.properties10
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/icons/UMLModelFile.gifbin363 -> 0 bytes
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/icons/papyrus_compare_16x16.pngbin622 -> 0 bytes
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/icons/papyrus_compare_32x32.pngbin1022 -> 0 bytes
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/icons/papyrus_compare_editor.gifbin956 -> 0 bytes
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/plugin.pdoc4
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/plugin.properties3
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/plugin.xml97
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/Activator.java69
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/editor/CompareUMLFileEditor.java370
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/editor/PapyrusActionBar.java40
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/editor/PapyrusModelCompareInput.java87
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/editor/utils/ServicesRegistryUtils.java37
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/handler/CompareUMLFileHandler.java143
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/handler/CompareUMLFileInput.java121
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/handler/ICompareUMLFileInput.java26
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/messages/Messages.java34
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/messages/messages.properties3
-rw-r--r--deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/tester/CompareUMLFileTester.java65
24 files changed, 0 insertions, 1220 deletions
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/.classpath b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/.classpath
deleted file mode 100644
index 2d1a4302f04..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/.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/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/.project b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/.project
deleted file mode 100644
index 1a1ca440bd8..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.uml.compare.file</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/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/.settings/org.eclipse.jdt.core.prefs b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 44217f8c068..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/.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/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/META-INF/MANIFEST.MF b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/META-INF/MANIFEST.MF
deleted file mode 100644
index 63c4bf73f20..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,41 +0,0 @@
-Manifest-Version: 1.0
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.papyrus.uml.compare;bundle-version="0.10.0",
- org.eclipse.emf.compare;bundle-version="1.3.1",
- org.eclipse.compare;bundle-version="3.5.300",
- org.eclipse.emf.compare.diff;bundle-version="1.3.1",
- org.eclipse.emf.compare.ui;bundle-version="1.3.1",
- org.eclipse.papyrus.infra.emf.compare.ui;bundle-version="0.10.0",
- org.eclipse.emf.ecore,
- org.eclipse.core.resources;bundle-version="3.8.0",
- org.eclipse.papyrus.infra.emf;bundle-version="0.10.0",
- org.eclipse.papyrus.infra.core;bundle-version="0.10.0",
- org.eclipse.papyrus.infra.emf.compare.instance;bundle-version="0.10.0",
- org.eclipse.papyrus.infra.emf.compare.common;bundle-version="0.10.0",
- org.eclipse.emf.transaction,
- org.eclipse.emf.workspace;bundle-version="1.4.0",
- org.eclipse.emf.workspace.ui,
- org.eclipse.emf.compare.match;bundle-version="1.3.1",
- org.eclipse.core.expressions,
- org.eclipse.papyrus.uml.compare.diff;bundle-version="0.10.0",
- org.eclipse.uml2.uml;bundle-version="4.0.0",
- org.eclipse.uml2.uml.resources;bundle-version="4.0.0",
- org.eclipse.emf.compare.diff,
- org.eclipse.papyrus.infra.emf.compare.diff;bundle-version="0.10.0",
- org.eclipse.emf.compare.uml2,
- org.eclipse.papyrus.infra.core.log;bundle-version="0.10.0"
-Export-Package: org.eclipse.papyrus.uml.compare.file.editor,
- org.eclipse.papyrus.uml.compare.file.editor.utils,
- org.eclipse.papyrus.uml.compare.file.handler
-Bundle-Vendor: %providerName
-Bundle-ActivationPolicy: lazy
-Bundle-Version: 0.10.0.qualifier
-Bundle-Name: %pluginName
-Bundle-Localization: plugin
-Bundle-ManifestVersion: 2
-Bundle-Activator: org.eclipse.papyrus.uml.compare.file.Activator
-Bundle-SymbolicName: org.eclipse.papyrus.uml.compare.file;singleton:=t
- rue
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/about.html b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/about.html
deleted file mode 100644
index 82d49bf5f81..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/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/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/build.properties b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/build.properties
deleted file mode 100644
index db81aec8091..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/build.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- about.html,\
- plugin.pdoc,\
- icons/,\
- plugin.properties
-src.includes = about.html
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/icons/UMLModelFile.gif b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/icons/UMLModelFile.gif
deleted file mode 100644
index 4eb1fb5a8dd..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/icons/UMLModelFile.gif
+++ /dev/null
Binary files differ
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/icons/papyrus_compare_16x16.png b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/icons/papyrus_compare_16x16.png
deleted file mode 100644
index 4e38b20444a..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/icons/papyrus_compare_16x16.png
+++ /dev/null
Binary files differ
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/icons/papyrus_compare_32x32.png b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/icons/papyrus_compare_32x32.png
deleted file mode 100644
index af0c3a85b54..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/icons/papyrus_compare_32x32.png
+++ /dev/null
Binary files differ
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/icons/papyrus_compare_editor.gif b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/icons/papyrus_compare_editor.gif
deleted file mode 100644
index e817df6ff0c..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/icons/papyrus_compare_editor.gif
+++ /dev/null
Binary files differ
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/plugin.pdoc b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/plugin.pdoc
deleted file mode 100644
index a24b43ccd76..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/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 allows to compare uml file using EMF Facet customization. The merge action is done in a command stack">
- <referent firstName="vincent" lastName="lorenzo" eMail="vincent.lorenzo@cea.fr" currentCompany="CEA-LIST"/>
-</doc:Documentation>
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/plugin.properties b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/plugin.properties
deleted file mode 100644
index c108039a0bc..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/plugin.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-#Properties file for org.eclipse.papyrus.uml.compare.file
-providerName = Eclipse Modeling Project
-pluginName = Papyrus Compare UML File (Incubation) \ No newline at end of file
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/plugin.xml b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/plugin.xml
deleted file mode 100644
index 45c5fb6f9ef..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/plugin.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.ui.commands">
- <command
- categoryId="org.eclipse.papyrus.editor.category"
- description="Open the Papyrus Model Compare Editor"
- id="org.eclipse.papyrus.uml.compare.file.command"
- name="Papyrus Model Compare Editor">
- </command>
- </extension>
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.papyrus.uml.compare.file.handler.CompareUMLFileHandler"
- commandId="org.eclipse.papyrus.uml.compare.file.command">
- <activeWhen>
- <and>
- <with
- variable="selection">
- <count
- value="2">
- </count>
- </with>
- <test
- forcePluginActivation="true"
- property="org.eclipse.papyrus.uml.compare.file.tester.isSelectionForUMLCompareFile"
- value="true">
- </test>
- </and>
- </activeWhen>
- </handler>
- </extension>
- <extension
- point="org.eclipse.ui.menus">
- <menuContribution
- allPopups="false"
- locationURI="popup:org.eclipse.ui.popup.any">
- <command
- commandId="org.eclipse.papyrus.uml.compare.file.command"
- icon="icons/papyrus_compare_16x16.png"
- style="push"
- tooltip="Compare Models synchronizing models and views">
- <visibleWhen
- checkEnabled="true">
- </visibleWhen>
- </command>
- </menuContribution>
- </extension>
- <extension
- point="org.eclipse.ui.editors">
- <editor
- class="org.eclipse.papyrus.uml.compare.file.editor.CompareUMLFileEditor"
- contributorClass="org.eclipse.papyrus.uml.compare.file.editor.PapyrusActionBar"
- default="false"
- icon="icons/papyrus_compare_16x16.png"
- id="org.eclipse.papyrus.uml.compare.file.editor"
- name="Papyrus Model Compare Editor">
- </editor>
- </extension>
- <extension
- point="org.eclipse.ui.popupMenus">
- <objectContribution
- adaptable="true"
- id="org.eclipse.papyrus.uml.compare.uml.file"
- objectClass="org.eclipse.core.resources.IResource">
- <action
- class="org.eclipse.papyrus.uml.compare.file.handler.CompareUMLFileHandler"
- definitionId="org.eclipse.papyrus.uml.compare.file.command"
- enablesFor="2"
- icon="icons/papyrus_compare_16x16.png"
- id="org.eclipse.papyrus.uml.compare.file"
- label="Model Each Other"
- menubarPath="compareWithMenu/compareWithGroup"
- tooltip="Open the Papyrus Model Compare Editor">
- <enablement>
- <and>
- <objectClass
- name="org.eclipse.core.resources.IFile">
- </objectClass>
- </and></enablement>
- </action>
- </objectContribution>
- </extension>
- <extension
- point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- class="org.eclipse.papyrus.uml.compare.file.tester.CompareUMLFileTester"
- id="org.eclipse.papyrus.uml.compare.file.tester"
- namespace="org.eclipse.papyrus.uml.compare.file.tester"
- properties="isSelectionForUMLCompareFile"
- type="org.eclipse.jface.viewers.IStructuredSelection">
- </propertyTester>
- </extension>
-
-</plugin>
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/Activator.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/Activator.java
deleted file mode 100644
index 75b57a74f8c..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/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.file;
-
-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.file"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- 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/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/editor/CompareUMLFileEditor.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/editor/CompareUMLFileEditor.java
deleted file mode 100644
index 6bec7308fd5..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/editor/CompareUMLFileEditor.java
+++ /dev/null
@@ -1,370 +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.file.editor;
-
-import static org.eclipse.papyrus.infra.core.Activator.log;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.core.commands.operations.IOperationHistory;
-import org.eclipse.core.commands.operations.IOperationHistoryListener;
-import org.eclipse.core.commands.operations.IUndoContext;
-import org.eclipse.core.commands.operations.IUndoableOperation;
-import org.eclipse.core.commands.operations.ObjectUndoContext;
-import org.eclipse.core.commands.operations.OperationHistoryEvent;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.compare.diff.metamodel.ComparisonResourceSetSnapshot;
-import org.eclipse.emf.compare.diff.metamodel.ComparisonResourceSnapshot;
-import org.eclipse.emf.compare.diff.metamodel.ComparisonSnapshot;
-import org.eclipse.emf.compare.diff.metamodel.DiffModel;
-import org.eclipse.emf.compare.match.engine.IMatchEngine;
-import org.eclipse.emf.compare.match.metamodel.MatchModel;
-import org.eclipse.emf.compare.ui.ModelCompareInput;
-import org.eclipse.emf.compare.ui.editor.ModelCompareEditorInput;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.IWorkspaceCommandStack;
-import org.eclipse.emf.workspace.ResourceUndoContext;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.infra.core.resource.ModelMultiException;
-import org.eclipse.papyrus.infra.core.resource.ModelSet;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.services.ServiceMultiException;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.infra.emf.compare.common.editor.AbstractPapyrusCompareEditor;
-import org.eclipse.papyrus.infra.emf.compare.common.utils.PapyrusModelCompareEditorInput;
-import org.eclipse.papyrus.infra.emf.compare.diff.utils.PapyrusCompareOptions;
-import org.eclipse.papyrus.uml.compare.diff.services.UMLDiffService;
-import org.eclipse.papyrus.uml.compare.diff.services.standalone.StandaloneMergeUtils;
-import org.eclipse.papyrus.uml.compare.diff.services.standalone.UMLStandaloneMatchEngine;
-import org.eclipse.papyrus.uml.compare.file.Activator;
-import org.eclipse.papyrus.uml.compare.file.editor.utils.ServicesRegistryUtils;
-import org.eclipse.papyrus.uml.compare.file.handler.CompareUMLFileInput;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.uml2.common.util.UML2Util;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLPackage;
-
-//import org.eclipse.uml2.uml.utils.UMLUtil;
-
-public class CompareUMLFileEditor extends /* EMFCompareEditor */AbstractPapyrusCompareEditor {//extends CompareEditor{
-
- /** the id of this editor (declared in the plugin.xml */
- public static final String COMPARE_UML_FILE_EDITOR_ID = "org.eclipse.papyrus.uml.compare.file.editor"; //$NON-NLS-1$
-
- private final TransactionalEditingDomain editingDomain;
-
- private ModelSet set;
-
- private final ObjectUndoContext undoContext;
-
- private final IOperationHistoryListener historyListener;
-
- /** the compared root object */
- private EObject roots[];
-
-
- //always null, maybe, excepted when we are in the init method
- private CompareUMLFileInput tmpInput;
-
- private ServicesRegistry servicesRegistry;
-
- /**
- *
- * Constructor.
- *
- */
- public CompareUMLFileEditor() {
- super();
- roots = new EObject[2];
- this.servicesRegistry = getServicesRegistry();
- try {
- set = servicesRegistry.getService(ModelSet.class);
- } catch (ServiceException e) {
- Activator.log.error(e);
- }
-
- this.editingDomain = set.getTransactionalEditingDomain();
- undoContext = new ObjectUndoContext(this, "PayrusUMLFileCompareUndoContext"); //$NON-NLS-1$
- historyListener = new IOperationHistoryListener() {
-
- public void historyNotification(final OperationHistoryEvent event) {
- if(event.getEventType() == OperationHistoryEvent.DONE) {
- Set<Resource> affectedResources = ResourceUndoContext.getAffectedResources(event.getOperation());
- if(isConcerned(Collections.unmodifiableSet(affectedResources))) {
- final IUndoableOperation operation = event.getOperation();
-
- // remove the default undo context so that we can have
- // independent undo/redo of independent resource changes
- operation.removeContext(((IWorkspaceCommandStack)getEditingDomain().getCommandStack()).getDefaultUndoContext());
-
- // add our undo context to populate our undo menu
- operation.addContext(undoContext);
-
- getSite().getShell().getDisplay().asyncExec(new Runnable() {
-
- public void run() {
- // dirty = true;
- firePropertyChange(IEditorPart.PROP_DIRTY);
- // TODO?
- // Try to select the affected objects.
- //
- // if (operation instanceof EMFCommandOperation) {
- // Command command = ((EMFCommandOperation) operation).getCommand();
- //
- // if (command != null) {
- // setSelectionToViewer(command
- // .getAffectedObjects());
- // }
- // }
- //
- // if (propertySheetPage != null) {
- // propertySheetPage.refresh();
- // }
- }
- });
- }
- }
- }
- };
- getOperationHistory().addOperationHistoryListener(historyListener);
- addUndoRedoListeners();
- }
-
-
-
- @Override
- public void doSave(final IProgressMonitor progressMonitor) {
- super.doSave(progressMonitor);
- }
-
- private boolean isConcerned(final Set affectedResources) {
- Iterator<?> iter = affectedResources.iterator();
- while(iter.hasNext()) {
- if(this.set.getResources().contains(iter.next())) {
- return true;
- }
- }
- return false;
- }
-
- private IOperationHistory getOperationHistory() {
- if(editingDomain != null) {
- CommandStack commandStack = editingDomain.getCommandStack();
- if(commandStack instanceof IWorkspaceCommandStack) {
- return ((IWorkspaceCommandStack)commandStack).getOperationHistory();
- }
- }
- return null;
- }
-
- @Override
- public void init(final IEditorSite site, final IEditorInput input) throws PartInitException {
-
- if(input instanceof CompareUMLFileInput) {
- this.tmpInput = (CompareUMLFileInput)input;
- final List<IFile> files = ((CompareUMLFileInput)input).getComparedFiles();
- for(int i = 0; i < files.size(); i++) {
- final IFile current = files.get(i);
- try {
- set.loadModels(current);
- final String filePath = current.getFullPath().toString();
- URI uri = URI.createPlatformResourceURI(filePath, false);
- Package root = UML2Util.load(set, uri, UMLPackage.Literals.PACKAGE);
- Assert.isNotNull(root, "The root of the model is null");
- roots[i] = root;
- } catch (ModelMultiException e1) {
- Activator.log.error(NLS.bind("Problem for loading the file {0}", current), e1);
- }
- }
-
- ModelCompareEditorInput newInput = getCompareInput(roots[0], roots[1]);
- this.tmpInput = null;
- super.init(site, newInput);
- } else {
- super.init(site, input);
- }
- }
-
- @Override
- protected ModelCompareEditorInput createModelCompareEditorInput(final ComparisonSnapshot snapshot) {
- return new PapyrusModelCompareEditorInput(snapshot, this) {
-
- @Override
- public Image getTitleImage() {
- return AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "/icons/papyrus_compare_editor.gif").createImage();
- }
-
- protected ModelCompareInput createModelCompareInput(final ComparisonSnapshot snap) {
- if(snap instanceof ComparisonResourceSetSnapshot) {
- return new PapyrusModelCompareInput(((ComparisonResourceSetSnapshot)snap).getMatchResourceSet(), ((ComparisonResourceSetSnapshot)snap).getDiffResourceSet(), editingDomain);
- }
- return new PapyrusModelCompareInput(((ComparisonResourceSnapshot)snap).getMatch(), ((ComparisonResourceSnapshot)snap).getDiff(), editingDomain);
- }
- };
- }
-
- @Override
- protected void configureInput(final PapyrusModelCompareEditorInput input) {
- if(this.tmpInput != null) {//null, when are in the Undo/Redo
- String leftLabel = this.tmpInput.getComparedFiles().get(0).getFullPath().makeRelative().toString();;
- String rightLabel = this.tmpInput.getComparedFiles().get(1).getFullPath().makeRelative().toString();;
- Image im = AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "/icons/UMLModelFile.gif").createImage();
- input.initLabels(leftLabel, im, rightLabel, im);
- }
-
-
- final CompareConfiguration cc = input.getCompareConfiguration();
-
- //configure with the options
- final Map<String, Object> options = getCompareOptions(null, null, null);//we are looking for the merge options
- final Boolean leftToRight = (Boolean)options.get(PapyrusCompareOptions.KEY_ALLOW_MERGE_LEFT_TO_RIGHT);
- final Boolean rightToLeft = (Boolean)options.get(PapyrusCompareOptions.KEY_ALLOW_MERGE_RIGHT_TO_LEFT);
- if(rightToLeft != null) {
- cc.setLeftEditable(rightToLeft);
- }
- if(leftToRight != null) {
- cc.setRightEditable(leftToRight);
- }
- }
-
- @Override
- public Object getAdapter(final Class adapter) {
- if(adapter.equals(IUndoContext.class)) {
- // used by undo/redo actions to get their undo context
- return undoContext;
- } else if(adapter.equals(TransactionalEditingDomain.class)) {
- try {
- this.servicesRegistry.getService(adapter);
- } catch (ServiceException e) {
- Activator.log.error(e);
- }
- }
- return super.getAdapter(adapter);
- }
-
-
- /**
- *
- * @see org.eclipse.emf.edit.domain.IEditingDomainProvider#getEditingDomain()
- *
- * @return
- */
- public TransactionalEditingDomain getEditingDomain() {
- return this.editingDomain;
- }
-
- @Override
- public void dispose() {
- getOperationHistory().removeOperationHistoryListener(historyListener);
- removeUndoRedoListener();
- if(this.servicesRegistry != null) {
- try {
- this.servicesRegistry.disposeRegistry();
- } catch (ServiceMultiException e) {
- log.error(e);
- }
- }
-
- super.dispose();
- }
-
-
- /**
- *
- * @see org.eclipse.papyrus.infra.emf.compare.common.editor.AbstractPapyrusCompareEditor#getIOperationHistory()
- *
- * @return
- */
- @Override
- protected IOperationHistory getIOperationHistory() {
- return getOperationHistory();
- }
-
-
- /**
- *
- * @see org.eclipse.papyrus.infra.emf.compare.common.editor.AbstractPapyrusCompareEditor#resetInput()
- *
- */
- @Override
- protected void resetInput() {
- IEditorInput input = getEditorInput();
- assert (input instanceof PapyrusModelCompareEditorInput);
- final TreeViewer viewer = ((PapyrusModelCompareEditorInput)input).getStructureMergeViewer();
- final PapyrusModelCompareEditorInput newInput = (PapyrusModelCompareEditorInput)getCompareInput(roots[0], roots[1]);
- final ModelCompareInput input2 = newInput.getpreparedModelCompareInput();
- viewer.setInput(input2);
- }
-
- /**
- * Returns the service registry associated to the editor.
- *
- * @return the servicesRegistry The registry.
- */
- public ServicesRegistry getServicesRegistry() {
- if(servicesRegistry == null) {
- servicesRegistry = ServicesRegistryUtils.createAndInitServiceRegistryForUMLCompareFile();
- }
- return servicesRegistry;
- }
-
- @Override
- protected DiffModel doDiff(final MatchModel match, final Map<String, Object> options) {
- return UMLDiffService.doDiff(match, false, options);
- }
-
- /**
- *
- * @param left
- * @param right
- * @param options
- * @see org.eclipse.papyrus.infra.emf.compare.common.editor.AbstractPapyrusCompareEditor#doMatch(IProgressMonitor, org.eclipse.emf.ecore.EObject,
- * org.eclipse.emf.ecore.EObject, java.util.Map)
- *
- * @return
- * @throws InterruptedException
- */
- @Override
- protected MatchModel doMatch(IProgressMonitor monitor, EObject left, EObject right, Map<String, Object> options) throws InterruptedException {
- //TODO create your own MatchService
- // return MatchService.doResourceMatch(left.eResource(), right.eResource(), options);
- IMatchEngine engine = (IMatchEngine)new UMLStandaloneMatchEngine();
- // return engine.contentMatch(left, right, StandaloneMergeUtils.getMergeOptions(monitor, left, right));
- return engine.resourceMatch(left.eResource(), right.eResource(), options);
- }
-
- @Override
- protected Map<String, Object> getCompareOptions(final IProgressMonitor monitor, final EObject left, final EObject right) {
- return StandaloneMergeUtils.getMergeOptions(monitor, left, right);
- }
-
-
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/editor/PapyrusActionBar.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/editor/PapyrusActionBar.java
deleted file mode 100644
index 2a4dd3be837..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/editor/PapyrusActionBar.java
+++ /dev/null
@@ -1,40 +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.file.editor;
-
-import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
-import org.eclipse.emf.workspace.ui.actions.RedoActionWrapper;
-import org.eclipse.emf.workspace.ui.actions.UndoActionWrapper;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionFactory;
-
-public class PapyrusActionBar extends EditingDomainActionBarContributor {
-
- public void init(IActionBars actionBars) {
- super.init(actionBars);
-
- ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
-
- // override the superclass implementation of these actions
- undoAction = new UndoActionWrapper();
- undoAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_UNDO));
- actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undoAction);
-
- redoAction = new RedoActionWrapper();
- redoAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
- actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), redoAction);
- }
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/editor/PapyrusModelCompareInput.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/editor/PapyrusModelCompareInput.java
deleted file mode 100644
index 280d64f3ff3..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/editor/PapyrusModelCompareInput.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package org.eclipse.papyrus.uml.compare.file.editor;
-
-import java.util.List;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.compare.diff.metamodel.ComparisonResourceSetSnapshot;
-import org.eclipse.emf.compare.diff.metamodel.ComparisonResourceSnapshot;
-import org.eclipse.emf.compare.diff.metamodel.DiffElement;
-import org.eclipse.emf.compare.diff.metamodel.DiffModel;
-import org.eclipse.emf.compare.diff.metamodel.DiffResourceSet;
-import org.eclipse.emf.compare.match.metamodel.MatchModel;
-import org.eclipse.emf.compare.match.metamodel.MatchResourceSet;
-import org.eclipse.emf.compare.ui.ICompareInputDetailsProvider;
-import org.eclipse.emf.compare.ui.ModelCompareInput;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.papyrus.infra.emf.compare.diff.service.TransactionalMergeService;
-
-/**
- *
- * This input allows to use the Papyrus TransactionalMergeService
- *
- */
-public class PapyrusModelCompareInput extends ModelCompareInput {
-
- private final TransactionalEditingDomain domain;
-
- public PapyrusModelCompareInput(MatchResourceSet matchResourceSet, DiffResourceSet diffResourceSet, TransactionalEditingDomain domain) {
- super(matchResourceSet, diffResourceSet);
- this.domain = domain;
- }
-
- public PapyrusModelCompareInput(ComparisonResourceSetSnapshot snapshot, TransactionalEditingDomain domain) {
- super(snapshot);
- this.domain = domain;
- }
-
- public PapyrusModelCompareInput(ComparisonResourceSnapshot snapshot, TransactionalEditingDomain domain) {
- super(snapshot);
- this.domain = domain;
- }
-
- public PapyrusModelCompareInput(MatchModel matchModel, DiffModel diffModel, ICompareInputDetailsProvider provider, TransactionalEditingDomain domain) {
- super(matchModel, diffModel, provider);
- this.domain = domain;
- }
-
- public PapyrusModelCompareInput(MatchResourceSet matchResourceset, DiffResourceSet diffResourceSet, ICompareInputDetailsProvider provider, TransactionalEditingDomain domain) {
- super(matchResourceset, diffResourceSet, provider);
- this.domain = domain;
- }
-
- public PapyrusModelCompareInput(MatchModel match, DiffModel diff, TransactionalEditingDomain domain) {
- super(match, diff);
- this.domain = domain;
- }
-
- /**
- * Applies the changes implied by a given {@link DiffElement} in the
- * direction specified by <code>leftToRight</code>.
- *
- * @param element
- * {@link DiffElement} containing the copy information.
- * @param leftToRight
- * <code>True</code> if the changes must be applied from the left
- * to the right model, <code>False</code> otherwise.
- */
- protected void doCopy(DiffElement element, boolean leftToRight) {
- Command cmd = TransactionalMergeService.getMergeCommand(domain, element, leftToRight);
- domain.getCommandStack().execute(cmd);
- }
-
- /**
- * Applies the changes implied by a list of {@link DiffElement} in the
- * direction specified by <code>leftToRight</code>.
- *
- * @param elements
- * {@link DiffElement}s containing the copy information.
- * @param leftToRight
- * <code>True</code> if the changes must be applied from the left
- * to the right model, <code>False</code> otherwise.
- */
- protected void doCopy(List<DiffElement> elements, boolean leftToRight) {
- Command cmd = TransactionalMergeService.getMergeCommand(domain, elements, leftToRight);
- domain.getCommandStack().execute(cmd);
- }
-
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/editor/utils/ServicesRegistryUtils.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/editor/utils/ServicesRegistryUtils.java
deleted file mode 100644
index 66240785aaf..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/editor/utils/ServicesRegistryUtils.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.eclipse.papyrus.uml.compare.file.editor.utils;
-
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.papyrus.infra.core.resource.ModelSet;
-import org.eclipse.papyrus.infra.core.services.ExtensionServicesRegistry;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.uml.compare.file.Activator;
-
-
-public class ServicesRegistryUtils {
-
-
- private ServicesRegistryUtils() {
- //to prevent instanciation
- }
-
- public static ServicesRegistry createAndInitServiceRegistryForUMLCompareFile() {
- ServicesRegistry servicesRegistry = null;
- // Create Services Registry
- try {
- servicesRegistry = new ExtensionServicesRegistry(org.eclipse.papyrus.infra.core.Activator.PLUGIN_ID);
- // Start the ModelSet first, and load if from the specified File
- List<Class<?>> servicesToStart = new ArrayList<Class<?>>(1);
- servicesToStart.add(ModelSet.class);
- servicesRegistry.startServicesByClassKeys(servicesToStart);
- } catch (ServiceException e) {
- // Show log and error
- Activator.log.error(e.getMessage(), e);
- }
- return servicesRegistry;
- }
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/handler/CompareUMLFileHandler.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/handler/CompareUMLFileHandler.java
deleted file mode 100644
index 27292f50610..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/handler/CompareUMLFileHandler.java
+++ /dev/null
@@ -1,143 +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.file.handler;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.uml.compare.file.Activator;
-import org.eclipse.papyrus.uml.compare.file.editor.CompareUMLFileEditor;
-import org.eclipse.papyrus.uml.compare.file.messages.Messages;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-
-/**
- *
- * The handler which allows to open the PapyrusUMLFileCompareEditor
- *
- */
-public class CompareUMLFileHandler extends AbstractHandler implements IObjectActionDelegate {
-
- /** The uml file extension */
- public static final String UML_EXTENSION = "uml"; //$NON-NLS-1$
-
- /**
- *
- * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- *
- * @param event
- * @return
- * @throws ExecutionException
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- List<IFile> selectedFiles = getSelection();
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorInput input = new CompareUMLFileInput(selectedFiles);//.get(0), selectedFiles.get(1));
- try {
- //we open the compare editor
- page.openEditor(input, CompareUMLFileEditor.COMPARE_UML_FILE_EDITOR_ID, true);
- } catch (PartInitException e) {
- Activator.log.error(Messages.CompareUMLFileHandler_ICantOpenThePapyrusCompareEdito, e);
- }
- return null;
- }
-
-
- /**
- *
- * @return
- * a list owning the selected files
- */
- protected List<IFile> getSelection() {
- ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
- List<IFile> currentSelection = new ArrayList<IFile>();
- Iterator<?> iter = ((IStructuredSelection)selection).iterator();
- while(iter.hasNext()) {
- Object current = iter.next();
- if(current instanceof IAdaptable) {
- IFile file = (IFile)((IAdaptable)current).getAdapter(IFile.class);
- if(file != null) {
- currentSelection.add(file);
- }
- }
- }
- return currentSelection;
- }
-
- /**
- *
- * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
- *
- * @return
- */
- @Override
- public boolean isEnabled() {
- List<?> selectedElement = getSelection();
- if(selectedElement.size() != 2) {
- return false;
- }
- Iterator<?> iter = selectedElement.iterator();
- while(iter.hasNext()) {
- Object current = iter.next();
- if(current instanceof IFile) {
- String extension = ((IFile)current).getFileExtension();
- if(!extension.equals(UML_EXTENSION)) {
- return false;
- }
- }
- }
- return super.isEnabled();
- }
-
- /**
- *
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- *
- * @param action
- */
- public void run(IAction action) {
- if(isEnabled()) {
- try {
- execute(new ExecutionEvent());
- } catch (ExecutionException e) {
- Activator.log.error(e);
- }
- }
-
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- //nothing to do
-
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- //nothing to do
- }
-
-
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/handler/CompareUMLFileInput.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/handler/CompareUMLFileInput.java
deleted file mode 100644
index 3ac32dd5bd5..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/handler/CompareUMLFileInput.java
+++ /dev/null
@@ -1,121 +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.file.handler;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.papyrus.uml.compare.file.messages.Messages;
-import org.eclipse.ui.IPersistableElement;
-
-/**
- *
- * This input is used for the Papyrus CompareUMLFileEditor
- *
- */
-public class CompareUMLFileInput implements ICompareUMLFileInput {
-
- /**
- * The files to compare
- */
- private final List<IFile> files;
-
- /**
- *
- * Constructor.
- *
- * @param files
- * the files to compare
- */
- public CompareUMLFileInput(final List<IFile> files) {
- this.files = files;
- }
-
- /**
- *
- * @see org.eclipse.ui.IEditorInput#exists()
- *
- * @return
- */
- public boolean exists() {
- return false;
- }
-
- /**
- *
- * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
- *
- * @return
- */
- public ImageDescriptor getImageDescriptor() {
- return null;
- }
-
- /**
- *
- * @see org.eclipse.ui.IEditorInput#getName()
- *
- * @return
- */
- public String getName() {
- return Messages.CompareUMLFileInput_PapyrusCompareUMLFileEditorInput;
- }
-
- /**
- *
- * @see org.eclipse.ui.IEditorInput#getPersistable()
- *
- * @return
- */
- public IPersistableElement getPersistable() {
- //throw new UnsupportedOperationException();
- return null;
- }
-
- /**
- *
- * @see org.eclipse.ui.IEditorInput#getToolTipText()
- *
- * @return
- */
- public String getToolTipText() {
- return getName();
- }
-
- /**
- *
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- *
- * @param adapter
- * @return
- */
- public Object getAdapter(Class adapter) {
- return null;
-// throw new UnsupportedOperationException();
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.compare.file.handler.ICompareUMLFileInput#getComparedFiles()
- *
- * @return
- */
- public List<IFile> getComparedFiles() {
- return this.files;
- }
-
-
-
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/handler/ICompareUMLFileInput.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/handler/ICompareUMLFileInput.java
deleted file mode 100644
index 7e780912de8..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/handler/ICompareUMLFileInput.java
+++ /dev/null
@@ -1,26 +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.file.handler;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.ui.IEditorInput;
-
-
-public interface ICompareUMLFileInput extends IEditorInput {
-
- public List<IFile> getComparedFiles();
-
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/messages/Messages.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/messages/Messages.java
deleted file mode 100644
index 0f64a0547be..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/messages/Messages.java
+++ /dev/null
@@ -1,34 +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.file.messages;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
-
- private static final String BUNDLE_NAME = "org.eclipse.papyrus.uml.compare.file.editor.messages.messages"; //$NON-NLS-1$
-
- public static String CompareUMLFileEditor_ICantLoadTheModel;
-
- public static String CompareUMLFileHandler_ICantOpenThePapyrusCompareEdito;
-
- public static String CompareUMLFileInput_PapyrusCompareUMLFileEditorInput;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/messages/messages.properties b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/messages/messages.properties
deleted file mode 100644
index 6108b2edbe7..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/messages/messages.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-CompareUMLFileEditor_ICantLoadTheModel=I can't load the model {0}
-CompareUMLFileHandler_ICantOpenThePapyrusCompareEdito=I can't open the Papyrus Compare Editor
-CompareUMLFileInput_PapyrusCompareUMLFileEditorInput=Papyrus Compare UML File Editor Input
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/tester/CompareUMLFileTester.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/tester/CompareUMLFileTester.java
deleted file mode 100644
index a2b0dfe1417..00000000000
--- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.uml.compare.file/src/org/eclipse/papyrus/uml/compare/file/tester/CompareUMLFileTester.java
+++ /dev/null
@@ -1,65 +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.file.tester;
-
-import java.util.Iterator;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- *
- * A property tester for UMLCompareFile
- *
- */
-public class CompareUMLFileTester extends PropertyTester {
-
- /** property to test if the selected element are uml files */
- public static final String IS_SELECTION_FOR_UML_COMPARE_FILE = "isSelectionForUMLCompareFile"; //$NON-NLS-1$
-
- /**
- *
- * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
- *
- * @param receiver
- * @param property
- * @param args
- * @param expectedValue
- * @return
- */
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- boolean returnValue = true;
- if(IS_SELECTION_FOR_UML_COMPARE_FILE.equals(property) && receiver instanceof IStructuredSelection) {
- IStructuredSelection selection = (IStructuredSelection)receiver;
- if(selection.size() == 2) {
- Iterator<?> iter = selection.iterator();
- while(iter.hasNext() && returnValue) {
- Object current = iter.next();
- if(!(current instanceof IFile)) {
- returnValue = false;
- } else {
- final IFile file = (IFile)current;
- returnValue = file.getFileExtension().equals("uml");
- }
- }
- } else {
- returnValue = false;
- }
- } else {
- returnValue = false;
- }
- return returnValue;
- }
-}

Back to the top