diff options
42 files changed, 0 insertions, 3399 deletions
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/.classpath b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/.classpath deleted file mode 100644 index 56a612970ab..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/.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/infra/emf/compare/ui/provider/ElementContentMergeContentProvider.java|org/eclipse/papyrus/infra/emf/compare/ui/provider/StyledDiffLabelSwitch.java|org/eclipse/papyrus/infra/emf/compare/ui/provider/UMLStyledStructureLabelProvider.java|org/eclipse/papyrus/infra/emf/compare/ui/handler/CompareTwoElementsAction.java" kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/.project b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/.project deleted file mode 100644 index feedf1324a1..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/.project +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.infra.emf.compare.ui</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.emf.facet.common.ProjectNature</nature>
- <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.infra.emf.compare.ui/.settings/org.eclipse.jdt.core.prefs b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 5152edbd2ac..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,22 +0,0 @@ -#Thu Dec 01 17:05:06 CET 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.codeComplete.argumentPrefixes=
-org.eclipse.jdt.core.codeComplete.argumentSuffixes=
-org.eclipse.jdt.core.codeComplete.fieldPrefixes=
-org.eclipse.jdt.core.codeComplete.fieldSuffixes=
-org.eclipse.jdt.core.codeComplete.localPrefixes=
-org.eclipse.jdt.core.codeComplete.localSuffixes=
-org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
-org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
-org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
-org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-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.infra.emf.compare.ui/.settings/org.eclipse.jdt.ui.prefs b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 4772e74af97..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,59 +0,0 @@ -#Thu Dec 01 17:06:59 CET 2011
-cleanup.add_default_serial_version_id=true
-cleanup.add_generated_serial_version_id=false
-cleanup.add_missing_annotations=true
-cleanup.add_missing_deprecated_annotations=true
-cleanup.add_missing_methods=true
-cleanup.add_missing_nls_tags=false
-cleanup.add_missing_override_annotations=true
-cleanup.add_missing_override_annotations_interface_methods=false
-cleanup.add_serial_version_id=false
-cleanup.always_use_blocks=true
-cleanup.always_use_parentheses_in_expressions=false
-cleanup.always_use_this_for_non_static_field_access=true
-cleanup.always_use_this_for_non_static_method_access=true
-cleanup.convert_to_enhanced_for_loop=true
-cleanup.correct_indentation=true
-cleanup.format_source_code=true
-cleanup.format_source_code_changes_only=false
-cleanup.make_local_variable_final=true
-cleanup.make_parameters_final=true
-cleanup.make_private_fields_final=true
-cleanup.make_type_abstract_if_missing_method=false
-cleanup.make_variable_declarations_final=true
-cleanup.never_use_blocks=false
-cleanup.never_use_parentheses_in_expressions=true
-cleanup.organize_imports=true
-cleanup.qualify_static_field_accesses_with_declaring_class=true
-cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-cleanup.qualify_static_member_accesses_with_declaring_class=true
-cleanup.qualify_static_method_accesses_with_declaring_class=true
-cleanup.remove_private_constructors=true
-cleanup.remove_trailing_whitespaces=true
-cleanup.remove_trailing_whitespaces_all=true
-cleanup.remove_trailing_whitespaces_ignore_empty=false
-cleanup.remove_unnecessary_casts=true
-cleanup.remove_unnecessary_nls_tags=true
-cleanup.remove_unused_imports=true
-cleanup.remove_unused_local_variables=false
-cleanup.remove_unused_private_fields=true
-cleanup.remove_unused_private_members=false
-cleanup.remove_unused_private_methods=true
-cleanup.remove_unused_private_types=true
-cleanup.sort_members=false
-cleanup.sort_members_all=false
-cleanup.use_blocks=true
-cleanup.use_blocks_only_for_return_and_throw=false
-cleanup.use_parentheses_in_expressions=false
-cleanup.use_this_for_non_static_field_access=true
-cleanup.use_this_for_non_static_field_access_only_if_necessary=false
-cleanup.use_this_for_non_static_method_access=false
-cleanup.use_this_for_non_static_method_access_only_if_necessary=false
-cleanup_profile=_CustomPapyrusCleanUpProfile
-cleanup_settings_version=2
-eclipse.preferences.version=1
-org.eclipse.jdt.ui.exception.name=e
-org.eclipse.jdt.ui.gettersetter.use.is=true
-org.eclipse.jdt.ui.keywordthis=false
-org.eclipse.jdt.ui.overrideannotation=true
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/META-INF/MANIFEST.MF b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/META-INF/MANIFEST.MF deleted file mode 100644 index 767c5df4c56..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,42 +0,0 @@ -Manifest-Version: 1.0
-Require-Bundle: org.eclipse.compare,
- org.eclipse.emf.compare.ui;bundle-version="1.3.1",
- org.eclipse.emf.facet.infra.browser.custom,
- org.eclipse.emf.facet.infra.browser.custom.core,
- org.eclipse.emf.compare;bundle-version="1.3.1",
- org.eclipse.emf.facet.infra.browser.custom.ui;bundle-version="0.1.1",
- org.eclipse.emf.workspace.ui,
- org.eclipse.papyrus.infra.emf;bundle-version="0.10.0",
- org.eclipse.papyrus.infra.tools;bundle-version="0.10.0",
- org.eclipse.emf.facet.infra.query.core,
- org.eclipse.papyrus.infra.core;bundle-version="0.10.0",
- org.eclipse.gmf.runtime.emf.commands.core,
- org.eclipse.papyrus.infra.widgets.toolbox;bundle-version="0.10.0",
- org.eclipse.emf.compare.diff.edit;bundle-version="1.3.1",
- org.eclipse.emf.compare;bundle-version="1.3.1",
- org.eclipse.papyrus.infra.emf.compare.diff;bundle-version="0.10.0",
- org.eclipse.papyrus.infra.widgets;bundle-version="0.10.0",
- org.eclipse.emf.facet.infra.common.core;bundle-version="0.2.0",
- org.eclipse.papyrus.infra.core.log;bundle-version="0.10.0",
- org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.2.0",
- org.eclipse.papyrus.infra.core.sasheditor;bundle-version="0.10.0"
-Export-Package: org.eclipse.papyrus.infra.emf.compare.ui,
- org.eclipse.papyrus.infra.emf.compare.ui.actions,
- org.eclipse.papyrus.infra.emf.compare.ui.content.transactional.viewer,
- org.eclipse.papyrus.infra.emf.compare.ui.content.viewer,
- org.eclipse.papyrus.infra.emf.compare.ui.internal.utils,
- org.eclipse.papyrus.infra.emf.compare.ui.messages,
- org.eclipse.papyrus.infra.emf.compare.ui.provider,
- org.eclipse.papyrus.infra.emf.compare.ui.structural.viewer,
- org.eclipse.papyrus.infra.emf.compare.ui.utils
-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.infra.emf.compare.ui.Activator
-Bundle-SymbolicName: org.eclipse.papyrus.infra.emf.compare.ui;singleto
- n:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/about.html b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/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 ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). 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, "Program" 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 ("Redistributor") 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.infra.emf.compare.ui/build.properties b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/build.properties deleted file mode 100644 index 03b56f02261..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/build.properties +++ /dev/null @@ -1,12 +0,0 @@ -output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- icons/,\
- about.html,\
- build.properties,\
- plugin.pdoc,\
- plugin.properties,\
- resources/
-src.includes = about.html
-source.. = src/
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/icons/PapyrusLogo16x16.gif b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/icons/PapyrusLogo16x16.gif Binary files differdeleted file mode 100644 index 8a31f458379..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/icons/PapyrusLogo16x16.gif +++ /dev/null diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/icons/addUiCustom.gif b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/icons/addUiCustom.gif Binary files differdeleted file mode 100644 index bc86fbc897e..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/icons/addUiCustom.gif +++ /dev/null diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/icons/add_ui_custom.gif b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/icons/add_ui_custom.gif Binary files differdeleted file mode 100644 index bc86fbc897e..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/icons/add_ui_custom.gif +++ /dev/null diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/icons/expandall.gif b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/icons/expandall.gif Binary files differdeleted file mode 100644 index 0205b29176d..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/icons/expandall.gif +++ /dev/null diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/plugin.pdoc b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/plugin.pdoc deleted file mode 100644 index ba047240cde..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/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 progin provides viewers which allows the customization of the viewer using emf-facet.
It provides a viewer for Undo/Redo actions too.
This plugin should not have dependencies on gmf.notation.diagram and uml.">
- <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.infra.emf.compare.ui/plugin.properties b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/plugin.properties deleted file mode 100644 index aae16d003fc..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/plugin.properties +++ /dev/null @@ -1,3 +0,0 @@ -#Properties file for org.eclipse.papyrus.infra.emf.compare.ui
-providerName = Eclipse Modeling Project
-pluginName = Papyrus Compare UI (Incubation)
\ No newline at end of file diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/plugin.xml b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/plugin.xml deleted file mode 100644 index b851b34add6..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/plugin.xml +++ /dev/null @@ -1,51 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?eclipse version="3.4"?>
-
-<plugin>
- <extension point="org.eclipse.compare.contentMergeViewers">
- <viewer class="org.eclipse.papyrus.infra.emf.compare.ui.content.viewer.PapyrusCustomizableContentMergeViewerCreator" extensions="ecore, uml" id="org.eclipse.papyrus.infra.emf.compare.ui.papyrus.viewer" label="Papyrus Customizable Content Merge Viewer">
- </viewer>
- </extension>
- <extension point="org.eclipse.compare.structureMergeViewers">
- <!--I add uml here, but it is not really a dependency-->
- <viewer class="org.eclipse.papyrus.infra.emf.compare.ui.structural.viewer.PapyrusStructureMergeViewerCreator" extensions="ecore, uml" id="org.eclipse.papyrus.infra.emf.compare.ui.structural.viewer" label="Papyrus Customizable Structure Merge Viewer">
- </viewer>
- </extension>
-
-
- <extension point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
- <browserCustomization file="resources/compare_diff.uiCustom" loadByDefault="true"/>
- </extension>
- <extension point="org.eclipse.emf.facet.infra.query.registration">
- <modelqueryset file="resources/compare_diff.querySet"/>
- </extension>
- <!--
- <extension
- point="org.eclipse.ui.menus">
- <menuContribution
- allPopups="true"
- locationURI="popup:org.eclipse.ui.popup.any">
- <command
- commandId="org.eclipse.compare.compareWithOther"
- label="Papyrus Compare With Each Other"
- style="push">
- </command>
- </menuContribution>
- </extension>
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.papyrus.infra.emf.compare.ui.handler.CompareTwoElementsAction"
- commandId="org.eclipse.compare.compareWithOther">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
- </extension>
- -->
-</plugin>
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/resources/compare_diff.querySet b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/resources/compare_diff.querySet deleted file mode 100644 index bd43e9ea6b7..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/resources/compare_diff.querySet +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?>
-<query:ModelQuerySet xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:query="http://www.eclipse.org/EmfFacet/infra/query/0.8.incubation" name="compare_diff">
- <associatedMetamodels href="http://www.eclipse.org/emf/2002/Ecore#/"/>
- <queries xsi:type="query:JavaModelQuery" name="GetDiffElementLabel" description="This query returns the label for the element" implementationClassName="org.eclipse.papyrus.infra.emf.compare.ui.queries.GetDiffElementLabel">
- <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <scope href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
- </queries>
-</query:ModelQuerySet>
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/resources/compare_diff.uiCustom b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/resources/compare_diff.uiCustom deleted file mode 100644 index a4e58fbe85a..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/resources/compare_diff.uiCustom +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="ASCII"?>
-<uicustom:MetamodelView xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:query="http://www.eclipse.org/EmfFacet/infra/query/0.8.incubation" xmlns:uicustom="http://www.eclipse.org/EmfFacet/infra/browser/custom/0.8" metamodelURI="http://www.eclipse.org/emf/compare/diff/1.1">
- <types metaclassName="diff.DiffElement">
- <customizedFeatures customizedFeature="hideMetaclassName">
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="true"/>
- </customizedFeatures>
- <customizedFeatures customizedFeature="label">
- <defaultValue xsi:type="uicustom:DerivedFeatureValue">
- <valueCalculator xsi:type="query:JavaModelQuery" href="emffacet:/query/compare_diff#GetDiffElementLabel"/>
- </defaultValue>
- </customizedFeatures>
- </types>
-</uicustom:MetamodelView>
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/Activator.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/Activator.java deleted file mode 100644 index 2fdb141a171..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/Activator.java +++ /dev/null @@ -1,71 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.emf.compare.ui;
-
-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.infra.emf.compare.ui"; //$NON-NLS-1$
-
- /** the activator */
- private static Activator plugin;
-
- /** the log helper for this plugin */
- public static LogHelper log;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(final BundleContext context) throws Exception {
- super.start(context);
- log = new LogHelper(this);
- Activator.plugin = this;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(final BundleContext context) throws Exception {
- Activator.plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return Activator.plugin;
- }
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/actions/CollapseAllAction.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/actions/CollapseAllAction.java deleted file mode 100644 index 4b68d5bc691..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/actions/CollapseAllAction.java +++ /dev/null @@ -1,89 +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.infra.emf.compare.ui.actions;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.papyrus.infra.emf.compare.ui.Activator;
-import org.eclipse.papyrus.infra.emf.compare.ui.messages.Messages;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-/**
- *
- * This action allows to collpase TreeViewer
- *
- */
-public class CollapseAllAction extends Action {
-
- /** icon path for the collapse all action */
- private static final String TOOLTIPTEXT = Messages.CollapseAllAction_CollapseAll;
-
- /** the list of the TreeViewer expanded by this action */
- final private Collection<TreeViewer> treeList;
-
- /**
- *
- * Constructor.
- *
- * @param tree
- * the tree to manage
- */
- public CollapseAllAction(final TreeViewer tree) {
- super(IAction.TOOL_TIP_TEXT, IAction.AS_PUSH_BUTTON);
- treeList = new ArrayList<TreeViewer>();
- treeList.add(tree);
- init();
-
- }
-
- /**
- *
- * Constructor.
- *
- * @param trees
- * the list of the tree to expand
- */
- public CollapseAllAction(final Collection<TreeViewer> trees) {
- super(IAction.TOOL_TIP_TEXT, IAction.AS_PUSH_BUTTON);
- treeList = new ArrayList<TreeViewer>(trees);
- init();
-
-
- }
-
- /**
- * set the image and the tooltip for this action
- */
- protected void init() {
- setToolTipText(CollapseAllAction.TOOLTIPTEXT);
- setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, ISharedImages.IMG_ELCL_COLLAPSEALL));
- }
-
- /**
- *
- * @see org.eclipse.jface.action.Action#run()
- *
- */
- @Override
- public void run() {
- for(TreeViewer tree : treeList) {
- tree.collapseAll();
- }
- }
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/actions/CustomizationAction.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/actions/CustomizationAction.java deleted file mode 100644 index 19a27df0146..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/actions/CustomizationAction.java +++ /dev/null @@ -1,118 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.emf.compare.ui.actions;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.compare.CompareEditorInput;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.facet.infra.browser.custom.MetamodelView;
-import org.eclipse.emf.facet.infra.browser.custom.ui.dialogs.LoadCustomizationsDialog;
-import org.eclipse.emf.facet.infra.browser.uicore.CustomizationManager;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.infra.core.sasheditor.editor.IMultiPageEditorPart;
-import org.eclipse.papyrus.infra.emf.compare.ui.Activator;
-import org.eclipse.papyrus.infra.emf.compare.ui.internal.utils.CustomizationAndViewerActionDispatcher;
-import org.eclipse.papyrus.infra.emf.compare.ui.messages.Messages;
-import org.eclipse.papyrus.infra.tools.util.EditorHelper;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-
-/**
- *
- * @author VL222926
- *
- * This action allows to choose the customization to apply on the viewer
- */
-public class CustomizationAction extends Action {
-
- /**
- * tooltip for this action
- */
- private static final String TOOLTIPTEXT = Messages.CustomizationAction_ManageAppliedCustomization;
-
- //FIXME imageProvider: avoid to duplicate this image, use the future service image provider?
- private static final String CUSTOMIZATION_IMAGE_PATH = "icons/add_ui_custom.gif"; //$NON-NLS-1$
-
- /**
- * the registered metamodels for the customization manager
- */
- private final Collection<EPackage> registeredMetamodel;
-
- /**
- *
- * Constructor.
- *
- * @param registeredMetamodel
- * can be empty when the class is created
- */
- public CustomizationAction(final Collection<EPackage> registeredMetamodel) {
- super(IAction.TOOL_TIP_TEXT, IAction.AS_PUSH_BUTTON);
- setToolTipText(CustomizationAction.TOOLTIPTEXT);
- ImageDescriptor desc = org.eclipse.papyrus.infra.widgets.Activator.getDefault().getImageDescriptor(Activator.PLUGIN_ID, CustomizationAction.CUSTOMIZATION_IMAGE_PATH);
- setImageDescriptor(desc);
- this.registeredMetamodel = registeredMetamodel;
- }
-
- /**
- *
- * {@inheritDoc}
- *
- */
- //FIXME duplicate code from ModelExplorer
- //FIXME duplicate in the table ?
- @Override
- public void run() {
- IEditorPart currentEditor = EditorHelper.getCurrentEditor();
- if(currentEditor instanceof IMultiPageEditorPart) {
- currentEditor = ((IMultiPageEditorPart)currentEditor).getActiveEditor();
- }
-
- final CustomizationManager customizationManager = CustomizationAndViewerActionDispatcher.getCustomizationManager(currentEditor);
- assert customizationManager != null;
-
- final List<MetamodelView> initiallySelectedCustomizations = customizationManager.getRegisteredCustomizations();
- final LoadCustomizationsDialog loadCustomizationsDialog = new LoadCustomizationsDialog(Display.getCurrent().getActiveShell(), initiallySelectedCustomizations, this.registeredMetamodel);
-
- //TODO : override the dialog to hide the checkbox for the facet
- if(Window.OK == loadCustomizationsDialog.open()) {
- customizationManager.clearCustomizations();
- final List<MetamodelView> selectedCustomizations = loadCustomizationsDialog.getSelectedCustomizations();
- //before loading, clean all facet to prevent to let not interesting facets.
- customizationManager.clearFacets();
- if(loadCustomizationsDialog.isLoadRequiredFacetsSelected()) {
- // load facets corresponding to customizations
- //we ignore the facet in this dialog
- }
- for(final MetamodelView metamodelView : selectedCustomizations) {
- customizationManager.registerCustomization(metamodelView);
- }
- customizationManager.loadCustomizations();
- }
-
-
- if(currentEditor instanceof IPropertyChangeListener) {//implemented by CompareEditor
- //we refresh the name of the tab in Papyrus
- ((IPropertyChangeListener)currentEditor).propertyChange(new PropertyChangeEvent(IAction.class, CompareEditorInput.PROP_TITLE, "", "")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- CustomizationAndViewerActionDispatcher.refreshViewers(currentEditor);
- }
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/actions/ExpandAllAction.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/actions/ExpandAllAction.java deleted file mode 100644 index 0f3f162cd91..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/actions/ExpandAllAction.java +++ /dev/null @@ -1,89 +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.infra.emf.compare.ui.actions;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.papyrus.infra.emf.compare.ui.Activator;
-import org.eclipse.papyrus.infra.emf.compare.ui.messages.Messages;
-
-/**
- *
- * This action allows to expand TreeViewer
- *
- */
-public class ExpandAllAction extends Action {
-
- /** Tooltip for the expand all action */
- private static final String TOOLTIPTEXT = Messages.ExpandAllAction_ExpandAll;
-
- /** icon path for the expand all action */
- private static final String EXPAND_ALL_IMAGE_PATH = "icons/expandall.gif"; //$NON-NLS-1$
-
- /** the list of the TreeViewer expanded by this action */
- final private Collection<TreeViewer> treeList;
-
- /**
- *
- * Constructor.
- *
- * @param tree
- * the tree to manage
- */
- public ExpandAllAction(final TreeViewer tree) {
- super(IAction.TOOL_TIP_TEXT, IAction.AS_PUSH_BUTTON);
- treeList = new ArrayList<TreeViewer>();
- treeList.add(tree);
- init();
- }
-
- /**
- *
- * Constructor.
- *
- * @param trees
- * the list of the tree to expand
- */
- public ExpandAllAction(final Collection<TreeViewer> trees) {
- super(IAction.TOOL_TIP_TEXT, IAction.AS_PUSH_BUTTON);
- treeList = new ArrayList<TreeViewer>(trees);
- init();
- }
-
- /**
- * set the image and the tooltip for this action
- */
- protected void init() {
- setToolTipText(ExpandAllAction.TOOLTIPTEXT);
- ImageDescriptor desc = org.eclipse.papyrus.infra.widgets.Activator.getDefault().getImageDescriptor(Activator.PLUGIN_ID, EXPAND_ALL_IMAGE_PATH);
- setImageDescriptor(desc);
- }
-
- /**
- *
- * @see org.eclipse.jface.action.Action#run()
- *
- */
- @Override
- public void run() {
- for(TreeViewer tree : treeList) {
- tree.expandAll();
- }
- }
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/content/transactional/viewer/PapyrusTransactionalContentMergeViewerCreator.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/content/transactional/viewer/PapyrusTransactionalContentMergeViewerCreator.java deleted file mode 100644 index 25bafb70510..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/content/transactional/viewer/PapyrusTransactionalContentMergeViewerCreator.java +++ /dev/null @@ -1,55 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.emf.compare.ui.content.transactional.viewer;
-
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.compare.IViewerCreator;
-import org.eclipse.compare.internal.CompareEditor;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.papyrus.infra.tools.util.EditorHelper;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-
-/**
- *
- * This class allows to create the MergeViewer when we change the viewer used in CompareEditor
- *
- */
-//unused for the moment
-public class PapyrusTransactionalContentMergeViewerCreator implements IViewerCreator {
-
- /**
- *
- * Constructor.
- *
- */
- public PapyrusTransactionalContentMergeViewerCreator() {
- //nothing to do
- }
-
- /**
- *
- * @see org.eclipse.compare.IViewerCreator#createViewer(org.eclipse.swt.widgets.Composite, org.eclipse.compare.CompareConfiguration)
- *
- * @param parent
- * @param config
- * @return
- */
- public Viewer createViewer(final Composite parent, final CompareConfiguration config) {
- final IEditorPart editor = EditorHelper.getCurrentEditor();//the current CompareEditor
- Assert.isTrue(editor instanceof CompareEditor);
- return new PapyrusTransactionalModelContentMergeViewer(parent, config, editor);
- }
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/content/transactional/viewer/PapyrusTransactionalModelContentMergeViewer.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/content/transactional/viewer/PapyrusTransactionalModelContentMergeViewer.java deleted file mode 100644 index b5718a1464a..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/content/transactional/viewer/PapyrusTransactionalModelContentMergeViewer.java +++ /dev/null @@ -1,211 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.emf.compare.ui.content.transactional.viewer;
-
-
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.emf.compare.diff.metamodel.DiffElement;
-import org.eclipse.emf.compare.diff.metamodel.DiffModel;
-import org.eclipse.emf.compare.ui.internal.ModelComparator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.workspace.ui.actions.RedoActionWrapper;
-import org.eclipse.emf.workspace.ui.actions.UndoActionWrapper;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.papyrus.infra.emf.compare.diff.merge.ITransactionalMerger;
-import org.eclipse.papyrus.infra.emf.compare.diff.service.TransactionalMergeFactory;
-import org.eclipse.papyrus.infra.emf.compare.ui.content.viewer.PapyrusCustomizableModelContentMergeViewer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-
-/**
- *
- * This viewer adds the Undo/Redo after a merge action
- *
- *
- */
-public class PapyrusTransactionalModelContentMergeViewer extends PapyrusCustomizableModelContentMergeViewer {
-
- private IAction _copyDiffLeftToRight;
-
- private IAction _copyDiffRightToLeft;
-
- private IAction _copyAllLeftToRight;
-
- private IAction _copyAllRightToLeft;
-
- private static final String COPY_ALL_RIGHT_TO_LEFT = "org.eclipse.compare.copyAllRightToLeft";
-
- private static final String COPY_ALL_LEFT_TO_RIGHT = "org.eclipse.compare.copyAllLeftToRight";
-
- private static final String COPY_CURRENT_SELECTION_LEFT_TO_RIGHT = "Copy Current Change to Right";
-
- private static final String COPY_CURRENT_SELECTION_RIGHT_TO_LEFT = "Copy Current Change to Left";
-
- /**
- *
- * Constructor.
- *
- * @param parent
- * @param config
- */
- public PapyrusTransactionalModelContentMergeViewer(final Composite parent, final CompareConfiguration config, final IEditorPart editor) {
- super(parent, config, editor);
- }
-
- /**
- *
- * {@inheritDoc} Add a toogle button to the toolbar to do the synchronization with the diagram
- *
- * @param tbm
- * the toolbar manager
- */
- @Override
- protected void createToolItems(final ToolBarManager tbm) {
- super.createToolItems(tbm);
- final Action undoAction = getUndoAction();
- final Action redoAction = getRedoAction();
- tbm.insert(0, new ActionContributionItem(undoAction));
- tbm.insert(1, new ActionContributionItem(redoAction));
-
- tbm.insert(2, new Separator("undo_redo_group")); //$NON-NLS-1$
-
- initializeIActionField(tbm);
- }
-
- protected Action getUndoAction() {
- final UndoActionWrapper undoAction = new UndoActionWrapper();
-
- //we need that the editor will be created to get it and initialize the actions
- Display.getCurrent().asyncExec(new Runnable() {
-
- public void run() {
- IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- undoAction.setActiveWorkbenchPart(editorPart);
-
- }
- });
-
- ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
- undoAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_UNDO));
-
- return undoAction;
- }
-
- protected Action getRedoAction() {
- final RedoActionWrapper redoAction = new RedoActionWrapper();
-
- //we need that the editor will be created to get it and initialize the actions
- Display.getCurrent().asyncExec(new Runnable() {
-
- public void run() {
- IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- redoAction.setActiveWorkbenchPart(editorPart);
- }
- });
-
- ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
- redoAction.setImageDescriptor(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
- return redoAction;
- }
-
-
-
- private void initializeIActionField(final ToolBarManager tbm) {
- for(IContributionItem item : tbm.getItems()) {
- if(item instanceof ActionContributionItem) {
- IAction action = ((ActionContributionItem)item).getAction();
- final String id = action.getActionDefinitionId();
- final String txt = action.getText();
- if(COPY_ALL_LEFT_TO_RIGHT.equals(id)) {
- _copyAllLeftToRight = action;
- continue;
- } else if(COPY_ALL_RIGHT_TO_LEFT.equals(id)) {
- _copyAllRightToLeft = action;
- continue;
- }
- //TODO post a bug to EMF-Compare in order to have an id for these actions
- if(COPY_CURRENT_SELECTION_LEFT_TO_RIGHT.equals(txt)) {
- _copyDiffLeftToRight = action;
- continue;
- } else if(COPY_CURRENT_SELECTION_RIGHT_TO_LEFT.equals(txt)) {
- _copyDiffRightToLeft = action;
- continue;
- }
- }
- if(_copyAllLeftToRight != null && _copyAllRightToLeft != null && _copyDiffLeftToRight != null && _copyDiffRightToLeft != null) {
- break;
- }
- }
- }
-
- @Override
- protected void switchCopyState(boolean enabled) {
- final ModelComparator comparator = ModelComparator.getComparator(configuration);
-
- boolean leftEditable = configuration.isLeftEditable();
- if(comparator != null)
- leftEditable = leftEditable && !comparator.isLeftRemote();
- boolean rightEditable = configuration.isRightEditable();
- if(comparator != null)
- rightEditable = rightEditable && !comparator.isRightRemote();
-
- boolean canCopyLeftToRight = false;
- boolean canCopyRightToLeft = false;
-
- boolean canAllCopyLeftToRight = true;
- boolean canAllCopyRightToLeft = true;
-
- if(currentSelection.size() == 1) {
- final ITransactionalMerger merger = TransactionalMergeFactory.createMerger(currentSelection.get(0));
- canCopyLeftToRight = merger.canUndoInTarget();
- canCopyRightToLeft = merger.canApplyInOrigin();
- }
-
- if(currentSelection.size() > 0) {
- EObject diffModel = currentSelection.get(0);
- while(!(diffModel instanceof DiffModel)) {
- diffModel = diffModel.eContainer();
- }
- Assert.isNotNull(diffModel);
-
- for(DiffElement current : ((DiffModel)diffModel).getDifferences()) {
- final ITransactionalMerger merger = TransactionalMergeFactory.createMerger(current);
- canAllCopyLeftToRight = canAllCopyLeftToRight && merger.canUndoInTarget();
- canAllCopyRightToLeft = canAllCopyRightToLeft && merger.canApplyInOrigin();
- }
- }
-
- if(_copyAllLeftToRight != null) {
- _copyAllLeftToRight.setEnabled(rightEditable && enabled && canAllCopyLeftToRight);
- }
- if(_copyAllRightToLeft != null) {
- _copyAllRightToLeft.setEnabled(leftEditable && enabled && canAllCopyRightToLeft);
- }
- if(_copyDiffLeftToRight != null) {
- _copyDiffLeftToRight.setEnabled(rightEditable && enabled && canCopyLeftToRight);
- }
- if(_copyDiffRightToLeft != null) {
- _copyDiffRightToLeft.setEnabled(leftEditable && enabled && canCopyRightToLeft);
- }
- }
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/content/viewer/PapyrusCustomizableContentMergeViewerCreator.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/content/viewer/PapyrusCustomizableContentMergeViewerCreator.java deleted file mode 100644 index 00e564e6e6f..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/content/viewer/PapyrusCustomizableContentMergeViewerCreator.java +++ /dev/null @@ -1,54 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.emf.compare.ui.content.viewer;
-
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.compare.IViewerCreator;
-import org.eclipse.compare.internal.CompareEditor;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.papyrus.infra.tools.util.EditorHelper;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-
-/**
- *
- * This class allows to create the MergeViewer
- *
- */
-public class PapyrusCustomizableContentMergeViewerCreator implements IViewerCreator {
-
- /**
- *
- * Constructor.
- *
- */
- public PapyrusCustomizableContentMergeViewerCreator() {
- //nothing to do
- }
-
- /**
- *
- * @see org.eclipse.compare.IViewerCreator#createViewer(org.eclipse.swt.widgets.Composite, org.eclipse.compare.CompareConfiguration)
- *
- * @param parent
- * @param config
- * @return
- */
- public Viewer createViewer(Composite parent, CompareConfiguration config) {
- final IEditorPart editor = EditorHelper.getCurrentEditor();//the current CompareEditor
- Assert.isTrue(editor instanceof CompareEditor);
- return new PapyrusCustomizableModelContentMergeViewer(parent, config, editor);
- }
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/content/viewer/PapyrusCustomizableModelContentMergeViewer.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/content/viewer/PapyrusCustomizableModelContentMergeViewer.java deleted file mode 100644 index b4bfa306b45..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/content/viewer/PapyrusCustomizableModelContentMergeViewer.java +++ /dev/null @@ -1,140 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.emf.compare.ui.content.viewer;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.emf.compare.ui.viewer.content.ModelContentMergeViewer;
-import org.eclipse.emf.compare.ui.viewer.content.part.ModelContentMergeTabFolder;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.papyrus.infra.emf.compare.ui.actions.CollapseAllAction;
-import org.eclipse.papyrus.infra.emf.compare.ui.actions.CustomizationAction;
-import org.eclipse.papyrus.infra.emf.compare.ui.actions.ExpandAllAction;
-import org.eclipse.papyrus.infra.emf.compare.ui.internal.utils.CustomizationAndViewerActionDispatcher;
-import org.eclipse.papyrus.infra.emf.compare.ui.internal.utils.EMFCompareUIUtils;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-
-/**
- *
- * This viewer allows to customize the displayed elements using EMF-Facet
- *
- */
-public class PapyrusCustomizableModelContentMergeViewer extends ModelContentMergeViewer {
-
- /** the list of the metamodels referenced in the compared files. this field is used by the Customization Manager */
- private Collection<EPackage> metamodels;
-
- /**
- *
- * Constructor.
- *
- * @param parent
- * @param config
- */
- public PapyrusCustomizableModelContentMergeViewer(final Composite parent, final CompareConfiguration config, final IEditorPart editor) {
- super(parent, config);
- final LabelProvider labelProvider = CustomizationAndViewerActionDispatcher.getLabelProvider(editor);
- ((PapyrusModelContentMergeTabFolder)leftPart).setLabelProvider(labelProvider);
- ((PapyrusModelContentMergeTabFolder)rightPart).setLabelProvider(labelProvider);
- }
-
-
- /**
- * {@inheritDoc}
- *
- * @param input
- * the input
- */
- @Override
- public void setInput(final Object input) {
- super.setInput(input);
- metamodels = EMFCompareUIUtils.getMetamodelForCustomization(input, metamodels);
- updateToolItems();
- }
-
- /**
- *
- * {@inheritDoc}
- *
- * @param composite
- * @param side
- * @return
- */
- @Override
- protected ModelContentMergeTabFolder createModelContentMergeTabFolder(final Composite composite, final int side) {
- return new PapyrusModelContentMergeTabFolder(this, composite, side);
- }
-
-
-
- /**
- *
- * {@inheritDoc} Add a toogle button to the toolbar to do the synchronization with the diagram
- *
- * @param tbm
- * the toolbar manager
- */
- @Override
- protected void createToolItems(final ToolBarManager tbm) {
- //we add an action to change the applied customization
- if(metamodels == null) {
- metamodels = new HashSet<EPackage>();
- }
-
- Collection<TreeViewer> viewers = new ArrayList<TreeViewer>();
- viewers.add((TreeViewer)this.rightPart.getTreePart());
- viewers.add((TreeViewer)this.leftPart.getTreePart());
- //we add the expand all action
- final IAction expandAllAction = new ExpandAllAction(viewers);
- final ActionContributionItem expandAllContributionItem = new ActionContributionItem(expandAllAction);
- tbm.insert(0, expandAllContributionItem);
-
- //we add the collapse all action
- final IAction collapseAllAction = new CollapseAllAction(viewers);
- final ActionContributionItem collapseAllActionContributionItem = new ActionContributionItem(collapseAllAction);
- tbm.insert(1, collapseAllActionContributionItem);
-
- tbm.insert(2, new Separator("treeAction")); //$NON-NLS-1$
-
-
- final IAction customizationAction = new CustomizationAction(Collections.unmodifiableCollection(metamodels));
- final ActionContributionItem customizationContributionItem = new ActionContributionItem(customizationAction);
- tbm.insert(3, customizationContributionItem);
- super.createToolItems(tbm);
- }
-
- /**
- *
- * @see org.eclipse.emf.compare.ui.viewer.content.ModelContentMergeViewer#handleDispose(org.eclipse.swt.events.DisposeEvent)
- *
- * @param event
- */
- @Override
- protected void handleDispose(final DisposeEvent event) {
- metamodels.clear();
- super.handleDispose(event);
- }
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/content/viewer/PapyrusModelContentMergeTabFolder.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/content/viewer/PapyrusModelContentMergeTabFolder.java deleted file mode 100644 index 39a46299d1d..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/content/viewer/PapyrusModelContentMergeTabFolder.java +++ /dev/null @@ -1,179 +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 - * Vincent Lorenzo (CEA LIST) - 349650: [Papyrus Merge] IndexOfBoundException - *****************************************************************************/ -package org.eclipse.papyrus.infra.emf.compare.ui.content.viewer; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.compare.diff.metamodel.ComparisonSnapshot; -import org.eclipse.emf.compare.ui.viewer.content.ModelContentMergeViewer; -import org.eclipse.emf.compare.ui.viewer.content.part.IModelContentMergeViewerTab; -import org.eclipse.emf.compare.ui.viewer.content.part.ModelContentMergeTabFolder; -import org.eclipse.emf.compare.ui.viewer.content.part.diff.ModelContentMergeDiffTab; -import org.eclipse.emf.compare.util.AdapterUtils; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; -import org.eclipse.jface.viewers.IContentProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.papyrus.infra.emf.compare.ui.internal.utils.CustomizationAndViewerActionDispatcher; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; - - -/** - * The Class UMLModelContentMergeTabFolder. - */ -public class PapyrusModelContentMergeTabFolder extends ModelContentMergeTabFolder { - - /** The my uml viewer. */ - protected final PapyrusCustomizableModelContentMergeViewer myUMLViewer; - - /** the label provider */ - private LabelProvider labelProvider; - - /** the diff tab */ - protected ModelContentMergeDiffTab diffTab; - - /** - * Instantiates a new uML model content merge tab folder. - * - * @param viewer - * the viewer - * @param composite - * the composite - * @param side - * the side - */ - public PapyrusModelContentMergeTabFolder(final ModelContentMergeViewer viewer, final Composite composite, final int side) { - super(viewer, composite, side); - myUMLViewer = (PapyrusCustomizableModelContentMergeViewer)viewer; - } - - /** - * Set the labelProvider for the viewer - * - * @param labelProvider - * the labelProvider - */ - public void setLabelProvider(final LabelProvider labelProvider) { - this.labelProvider = labelProvider; - CustomizationAndViewerActionDispatcher.associateViewerAndLabelProvider(diffTab, this.labelProvider); - diffTab.setLabelProvider(labelProvider); - } - - /** - * - * @see org.eclipse.emf.compare.ui.viewer.content.part.ModelContentMergeTabFolder#createModelContentMergeDiffTab(org.eclipse.swt.widgets.Composite) - * - * @param parent - * @return - */ - @Override - protected IModelContentMergeViewerTab createModelContentMergeDiffTab(final Composite parent) { - diffTab = new ModelContentMergeDiffTab(parent, partSide, this); - diffTab.setContentProvider(createDiffTabContentProvider()); - return diffTab; - - } - - /** - * - * @see org.eclipse.emf.compare.ui.viewer.content.part.ModelContentMergeTabFolder#createContents(org.eclipse.swt.widgets.Composite) - * - * @param composite - */ - @Override - protected void createContents(final Composite composite) { - super.createContents(composite); - //we set the layout here, because, it we don't set, we have a little treeviwer... - Control ctrl = tree.getControl(); - ctrl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - } - - /** - * - * @see org.eclipse.emf.compare.ui.viewer.content.part.ModelContentMergeTabFolder#dispose() - * - */ - @Override - public void dispose() { - if(labelProvider != null) { - CustomizationAndViewerActionDispatcher.dissociateTreeViewerAndLabelProvider(diffTab, labelProvider); - diffTab = null; - labelProvider = null; - } - super.dispose(); - } - - /** - * - * @return - */ - protected IContentProvider createDiffTabContentProvider() { - return new ModelContentMergeDiffTabContentProvider(AdapterUtils.getAdapterFactory()); - } - - - /** - * This implementation of an {@link AdapterFactoryContentProvider} will strip ComparisonSnapshots out of - * the view. - * - * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a> - * FIXME : duplicated code from the super class - */ - protected class ModelContentMergeDiffTabContentProvider extends AdapterFactoryContentProvider { - /** - * Default constructor. Delegates to the super implementation. - * - * @param factory - * Factory to get labels and icons from. - */ - public ModelContentMergeDiffTabContentProvider(AdapterFactory factory) { - super(factory); - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider#getElements(java.lang.Object) - */ - @Override - public Object[] getElements(Object object) { - // overwritten to ensure contents of ResourceSets and List<Resource> are correclty returned. - Object[] result = null; - if (object instanceof ResourceSet) { - final List<Resource> resources = ((ResourceSet)object).getResources(); - final List<Resource> elements = new ArrayList<Resource>(resources.size()); - for (final Resource resource : resources) { - if (resource.getContents().isEmpty() - || !(resource.getContents().get(0) instanceof ComparisonSnapshot)) { - elements.add(resource); - } - } - result = elements.toArray(); - } else if (object instanceof List) { - // we may also display a list of resources - result = ((List<?>)object).toArray(); - } else { - result = super.getElements(object); - } - return result; - } - } - -} diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/handler/CompareTwoElementsAction.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/handler/CompareTwoElementsAction.java deleted file mode 100644 index aa56ea79cfb..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/handler/CompareTwoElementsAction.java +++ /dev/null @@ -1,287 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Tatiana Fesenko (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.emf.compare.ui.handler; - -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.compare.CompareConfiguration; -import org.eclipse.compare.CompareUI; -import org.eclipse.compare.CompareViewerPane; -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.compare.EMFCompareException; -import org.eclipse.emf.compare.diff.metamodel.ComparisonResourceSnapshot; -import org.eclipse.emf.compare.diff.metamodel.ComparisonSnapshot; -import org.eclipse.emf.compare.diff.metamodel.DiffFactory; -import org.eclipse.emf.compare.diff.metamodel.DiffModel; -import org.eclipse.emf.compare.diff.service.DiffService; -import org.eclipse.emf.compare.match.MatchOptions; -import org.eclipse.emf.compare.match.engine.GenericMatchScopeProvider; -import org.eclipse.emf.compare.match.metamodel.MatchModel; -import org.eclipse.emf.compare.match.service.MatchService; -import org.eclipse.emf.compare.ui.editor.ModelCompareEditorInput; -import org.eclipse.emf.compare.ui.viewer.content.ModelContentMergeViewer; -import org.eclipse.emf.compare.util.EMFCompareMap; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.papyrus.infra.emf.compare.ui.Activator; -import org.eclipse.papyrus.infra.emf.compare.ui.content.transactional.viewer.PapyrusTransactionalModelContentMergeViewer; -import org.eclipse.ui.PlatformUI; -//import org.eclipse.papyrus.compare.diff.extension.UMLStyledStructureLabelProvider; -//import org.eclipse.papyrus.compare.element.ElementContentDiffEngine; -//import org.eclipse.papyrus.compare.element.ElementContentMatchEngine; -//import org.eclipse.papyrus.compare.ui.Messages; -//import org.eclipse.papyrus.compare.ui.PapyrusLabelProvider; -//import org.eclipse.papyrus.compare.ui.viewer.content.ElementContentMergeContentProvider; -//import org.eclipse.papyrus.compare.ui.viewer.content.UMLModelContentMergeViewer; - -/** - * Action to compare two arbitrary elements. - * Available in the context menu of the model explorer. - */ -//TODO : not used, remove it! -public class CompareTwoElementsAction extends AbstractHandler { - - /* - * (non-Javadoc) - * - * @see org.eclipse.team.internal.ui.actions.TeamAction#execute(org.eclipse.jface.action.IAction) - */ - protected void execute(IAction action) throws InvocationTargetException, InterruptedException { - Object[] selectedElements = getSelection().toArray(); - if(selectedElements.length != 2) { - Activator.log.info("Two elements should be selected."); - } else { - EObject left = getElementFor(selectedElements[0]); - EObject right = getElementFor(selectedElements[1]); - if(left == null) { - Activator.log.info("The left element is null. I can't do the comparison"); - } else if(right == null) { - Activator.log.info("The right element is null. I can't do the comparison"); - } else { - ComparisonResourceSnapshot snapshot = doContentCompare(left, right); - openInCompare(snapshot); - } - } - } - - private Collection<Object> getSelection() { - ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection(); - Collection<Object> currentSelection = new ArrayList<Object>(); - Iterator<?> iter = ((IStructuredSelection)selection).iterator(); - while(iter.hasNext()) { - currentSelection.add(iter.next()); - } - return currentSelection; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.commands.AbstractHandler#isEnabled() - */ - public boolean isEnabled() { - Object[] selectedElements = getSelection().toArray(); - if(selectedElements.length != 2) { - return false; - } - EObject left = getElementFor(selectedElements[0]); - EObject right = getElementFor(selectedElements[1]); - return left != null && right != null; - } - - /** - * Open in compare. - * - * @param snapshot - * the snapshot - */ - private void openInCompare(ComparisonSnapshot snapshot) { - ModelCompareEditorInput model = null; - - CompareUI.openCompareEditor(new ModelCompareEditorInput(snapshot) { - - @Override - protected ModelContentMergeViewer createMergeViewer(CompareViewerPane pane, CompareConfiguration config) { - return new PapyrusTransactionalModelContentMergeViewer(pane, config); - } - //TODO : uncomment. - // @Override - // protected ModelContentMergeViewer createMergeViewer(CompareViewerPane pane, CompareConfiguration config) { - // return new PapyrusCustomizableModelContentMergeViewer(pane, config) { - // @Override - // protected IMergeViewerContentProvider createMergeViewerContentProvider() { - // return new ElementContentMergeContentProvider(configuration); - // } - // }; - // } - // - // @Override - // public Control createOutlineContents(Composite parent, int direction) { - // Control result = super.createOutlineContents(parent, direction); - // structureMergeViewer.setLabelProvider(new UMLStyledStructureLabelProvider(new PapyrusLabelProvider())); - // return result; - // } - - }); - } - - /** - * Do content compare. - * - * @param left - * the left - * @param right - * the right - * @return the comparison resource snapshot - */ - protected ComparisonResourceSnapshot doContentCompare(final EObject left, final EObject right) { - final ComparisonResourceSnapshot snapshot = DiffFactory.eINSTANCE.createComparisonResourceSnapshot(); - - try { - PlatformUI.getWorkbench().getProgressService().busyCursorWhile(new IRunnableWithProgress() { - - public void run(IProgressMonitor monitor) throws InterruptedException { - // final MatchModel match = MatchService.doContentMatch(left, right, options); - // DiffModel diff = DiffService.doDiff(match); - final MatchModel match = contentMatch(left, right, monitor); - final DiffModel diff = contentDiff(left, right, match); - - snapshot.setDiff(diff); - snapshot.setMatch(match); - - } - - }); - } catch (final InterruptedException e) { - Activator.log.error(e); - } catch (final EMFCompareException e) { - Activator.log.error(e); - } catch (final InvocationTargetException e) { - Activator.log.error(e); - } - - return snapshot; - } - - /** - * Content diff. - * - * @param left - * the left - * @param right - * the right - * @param match - * the match - * @return the diff model - */ - protected DiffModel contentDiff(final EObject left, final EObject right, final MatchModel match) { - //TODO - // ElementContentDiffEngine engine = new ElementContentDiffEngine(left, right); - // final DiffModel diff = engine.doDiff(match); - // final Collection<AbstractDiffExtension> extensions = DiffService.getCorrespondingDiffExtensions(match); - // for(final AbstractDiffExtension ext : extensions) { - // if(ext != null) { - // ext.visit(diff); - // } - // } - // - // engine.reset(); - // return diff; - return null; - } - - /** - * Content match. - * - * @param left - * the left - * @param right - * the right - * @param monitor - * the monitor - * @return the match model - * @throws InterruptedException - * the interrupted exception - */ - protected MatchModel contentMatch(final EObject left, final EObject right, IProgressMonitor monitor) throws InterruptedException { - // final Map<String, Object> options = new EMFCompareMap<String, Object>(); - // options.put(MatchOptions.OPTION_PROGRESS_MONITOR, monitor); - // options.put(MatchOptions.OPTION_MATCH_SCOPE_PROVIDER, new GenericMatchScopeProvider(left.eResource(), right.eResource())); - // options.put(MatchOptions.OPTION_IGNORE_ID, Boolean.TRUE); - // options.put(MatchOptions.OPTION_IGNORE_XMI_ID, Boolean.TRUE); - // - // final IMatchEngine matchEngine = new ElementContentMatchEngine(left, right); - // final MatchModel match = matchEngine.contentMatch(left, right, options); - // return match; - //TODO - return null; - } - - /** - * Gets the element for. - * - * @param object - * the object - * @return the element for - */ - protected EObject getElementFor(Object object) { - if(object instanceof IAdaptable) { - return (EObject)((IAdaptable)object).getAdapter(EObject.class); - } - - if(object instanceof EObject) { - return (EObject)object; - } - return null; - } - - public Object execute(ExecutionEvent event) throws ExecutionException { - Object[] selectedElements = getSelection().toArray(); - if(selectedElements.length != 2) { - //TODO - // Activator.logInfo(Messages.bind(Messages.CompareTwoElementsAction_only_only_element_is_selected, selectedElements.length)); - return null; - } - - EObject left = getElementFor(selectedElements[0]); - EObject right = getElementFor(selectedElements[1]); - if(left == null) { - //TODO - // Activator.logInfo(Messages.CompareTwoElementsAction_left_element_is_null); - return null; - } - - if(right == null) { - //TODO - // Activator.logInfo(Messages.CompareTwoElementsAction_right_element_is_null); - return null; - } - - ComparisonResourceSnapshot snapshot = doContentCompare(left, right); - openInCompare(snapshot); - return null; - } - -} diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/internal/utils/CustomizationAndViewerActionDispatcher.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/internal/utils/CustomizationAndViewerActionDispatcher.java deleted file mode 100644 index e573cdb99fc..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/internal/utils/CustomizationAndViewerActionDispatcher.java +++ /dev/null @@ -1,124 +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.infra.emf.compare.ui.internal.utils;
-
-import org.eclipse.emf.facet.infra.browser.uicore.CustomizationManager;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.papyrus.infra.emf.compare.ui.provider.EMFCompareLabelProvider;
-import org.eclipse.papyrus.infra.emf.compare.ui.utils.ICustomizableEditor;
-import org.eclipse.ui.IEditorPart;
-
-/**
- *
- * This class provides methods to manage the Labelprovider and the viewers for the CompareEditor.
- *
- *
- */
-public class CustomizationAndViewerActionDispatcher {
-
- private CustomizationAndViewerActionDispatcher() {
- //to prevent instantiation
- }
-
- /**
- *
- * @param editor
- * an editor
- * @return
- * Create if it is necessary and returns the Labelprovider for this editor
- */
- public static LabelProvider getLabelProvider(final IEditorPart editor) {
- if(editor instanceof ICustomizableEditor) {
- return ((ICustomizableEditor)editor).getLabelProvider();
- } else {
- return LabelProviderUtil.INSTANCE.getLabelProviderFor(editor);
- }
- }
-
- /**
- *
- * @param editor
- * an editor
- * @return
- * the labelprovider associated to this editor. The returned value can be <code>null</code>
- */
- public static LabelProvider getExistingLabelProvider(final IEditorPart editor) {
- if(editor instanceof ICustomizableEditor) {
- return ((ICustomizableEditor)editor).getLabelProvider();
- } else {
- return LabelProviderUtil.INSTANCE.getExistingLabelProviderFor(editor);
- }
- }
-
- /**
- *
- * @param editor
- * an editor
- * @return
- * the CustomizationManager associated to this editor (via its LabelProvider)
- */
- public static CustomizationManager getCustomizationManager(final IEditorPart editor) {
- if(editor instanceof ICustomizableEditor) {
- EMFCompareLabelProvider provider = ((ICustomizableEditor)editor).getLabelProvider();
- return provider.getCustomizationManager();
- } else {
- EMFCompareLabelProvider provider = LabelProviderUtil.INSTANCE.getExistingLabelProviderFor(editor);
- return provider.getCustomizationManager();
- }
- }
-
- /**
- * Refresh the viewers of the editor
- *
- * @param editor
- * an editor
- */
- public static void refreshViewers(final IEditorPart editor) {
- if(editor instanceof ICustomizableEditor) {
- ((ICustomizableEditor)editor).refreshViewers();
- } else {
- EMFCompareLabelProviderRefreshingViewer provider = LabelProviderUtil.INSTANCE.getExistingLabelProviderFor(editor);
- provider.refreshViewer();
- }
- }
-
- /**
- * Break the couple viewer/labelprovider if necessary
- *
- * @param viewer
- * a viewer
- * @param provider
- * a label provider
- */
- public static void dissociateTreeViewerAndLabelProvider(final TreeViewer viewer, final LabelProvider provider) {
- if(provider instanceof ILabelProviderRefreshingViewer) {
- ((ILabelProviderRefreshingViewer)provider).unregisterViewer(viewer);
- }
- }
-
- /**
- * Create the couple viewer/labelprovider if necessary
- *
- * @param viewer
- * a viewer
- * @param provider
- * a label provider
- */
- public static void associateViewerAndLabelProvider(final TreeViewer viewer, final LabelProvider provider) {
- if(provider instanceof ILabelProviderRefreshingViewer) {
- ((ILabelProviderRefreshingViewer)provider).registerViewer(viewer);
- }
- }
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/internal/utils/EMFCompareLabelProviderRefreshingViewer.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/internal/utils/EMFCompareLabelProviderRefreshingViewer.java deleted file mode 100644 index f786f251c42..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/internal/utils/EMFCompareLabelProviderRefreshingViewer.java +++ /dev/null @@ -1,82 +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.infra.emf.compare.ui.internal.utils;
-
-import java.util.Collection;
-import java.util.HashSet;
-
-import org.eclipse.emf.facet.infra.browser.uicore.CustomizationManager;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.papyrus.infra.emf.compare.ui.provider.EMFCompareLabelProvider;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-
-/**
- *
- * This Label provider is used when the editor doesn't manage itself the viewers.
- * This label provider allows to refresh the viewers which used it
- *
- */
-//this class must have a package visibility
-final class EMFCompareLabelProviderRefreshingViewer extends EMFCompareLabelProvider implements ILabelProviderRefreshingViewer {
-
- /** the list of the registered viewer */
- private final Collection<TreeViewer> viewers;
-
- public EMFCompareLabelProviderRefreshingViewer(final CustomizationManager customizationManager) {
- super(customizationManager);
- this.viewers = new HashSet<TreeViewer>();
- }
-
- /**
- *
- * @see org.eclipse.papyrus.infra.emf.compare.ui.internal.utils.ILabelProviderRefreshingViewer#registerViewer(org.eclipse.jface.viewers.TreeViewer)
- *
- * @param viewer
- */
- public void registerViewer(final TreeViewer viewer) {
- final DisposeListener listener = new DisposeListener() {
-
- public void widgetDisposed(final DisposeEvent e) {
- viewer.getTree().removeDisposeListener(this);
- unregisterViewer(viewer);
- }
- };
- viewer.getTree().addDisposeListener(listener);
- viewers.add(viewer);
- }
-
- /**
- *
- * @see org.eclipse.papyrus.infra.emf.compare.ui.internal.utils.ILabelProviderRefreshingViewer#refreshViewer()
- *
- */
- public void refreshViewer() {
- for(TreeViewer current : viewers) {
- if(!current.getTree().isDisposed()) {
- current.refresh();
- }
- }
- }
-
- /**
- *
- * @see org.eclipse.papyrus.infra.emf.compare.ui.internal.utils.ILabelProviderRefreshingViewer#unregisterViewer(org.eclipse.jface.viewers.TreeViewer)
- *
- * @param viewer
- */
- public void unregisterViewer(final TreeViewer viewer) {
- viewers.remove(viewer);
- }
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/internal/utils/EMFCompareUIUtils.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/internal/utils/EMFCompareUIUtils.java deleted file mode 100644 index b99592b20e0..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/internal/utils/EMFCompareUIUtils.java +++ /dev/null @@ -1,93 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.emf.compare.ui.internal.utils;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-
-import org.eclipse.emf.compare.diff.metamodel.DiffElement;
-import org.eclipse.emf.compare.ui.ModelCompareInput;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-
-
-/**
- *
- * This class provides useful methods for the papyrus Viewer for EMF-Compare
- *
- */
-public class EMFCompareUIUtils {
-
- private EMFCompareUIUtils() {
- //nothing to do
- }
-
- /**
- *
- * @param input
- * an input
- * @param metamodels
- * the list of the referenced metamodels
- * @return
- * if the parameter metamodels is <code>null</code>, this method initializes it
- * it returns the parameter metamodels filled with the metamodels referenced by the compared model
- */
- public static final Collection<EPackage> getMetamodelForCustomization(final Object input, Collection<EPackage> metamodels) {
- if(metamodels == null) {
- metamodels = new HashSet<EPackage>();
- }
- if(input != null && input instanceof ModelCompareInput) {
- Resource res = ((ModelCompareInput)input).getLeftResource();
- metamodels.addAll(EMFHelper.getMetamodels(res));
- res = ((ModelCompareInput)input).getRightResource();
- metamodels.addAll(EMFHelper.getMetamodels(res));
-
- //we returns the applicable customizations on DiffElement too
- final List<DiffElement> diffs = ((ModelCompareInput)input).getDiffAsList();
- for(DiffElement current : diffs) {
- metamodels.add(current.eClass().getEPackage());
- }
- }
- return metamodels;
- }
-
- /**
- *
- * @param input
- * an input
- * @param metamodels
- * the list of the referenced metamodels
- * @return
- * if the parameter metamodels is <code>null</code>, this method initializes it
- * it returns the parameter metamodels filled with the metamodels referenced by the diff element
- */
- //TODO not used, we display the all applicable customization for the 2 viewers see bug 384358: [UML Compare] problems with customizations applied on the viewers
- @Deprecated //deprecated since July 2012
- public static final Collection<EPackage> getMetamodelForDiffCustomization(final Object input, Collection<EPackage> metamodels) {
- if(metamodels == null) {
- metamodels = new HashSet<EPackage>();
- }
- if(input != null && input instanceof ModelCompareInput) {
- List<DiffElement> diffs = ((ModelCompareInput)input).getDiffAsList();
- for(DiffElement current : diffs) {
- metamodels.add(current.eClass().getEPackage());
- }
- }
- return metamodels;
- }
-
-
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/internal/utils/ILabelProviderRefreshingViewer.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/internal/utils/ILabelProviderRefreshingViewer.java deleted file mode 100644 index a826705891b..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/internal/utils/ILabelProviderRefreshingViewer.java +++ /dev/null @@ -1,47 +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.infra.emf.compare.ui.internal.utils;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-
-/**
- *
- * The classes implements this interface when they are in charge of resfreshing Viewer
- *
- */
-//this interface must have a package visibility
-interface ILabelProviderRefreshingViewer extends ILabelProvider {
-
- /**
- * Register a viewer to refresh it
- *
- * @param viewer
- * a viewer
- */
- public void registerViewer(TreeViewer viewer);
-
- /**
- * viewer are refresh in this methods
- */
- public void refreshViewer();
-
- /**
- * Unregister a viewer
- *
- * @param viewer
- * a viewer
- */
- public void unregisterViewer(final TreeViewer viewer);
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/internal/utils/LabelProviderUtil.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/internal/utils/LabelProviderUtil.java deleted file mode 100644 index 4ddaf018fb8..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/internal/utils/LabelProviderUtil.java +++ /dev/null @@ -1,241 +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.infra.emf.compare.ui.internal.utils;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.compare.internal.CompareEditor;
-import org.eclipse.emf.facet.infra.browser.custom.MetamodelView;
-import org.eclipse.emf.facet.infra.browser.custom.core.CustomizationsCatalog;
-import org.eclipse.emf.facet.infra.browser.uicore.CustomizationManager;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.infra.core.sasheditor.editor.IMultiPageEditorPart;
-import org.eclipse.papyrus.infra.emf.compare.ui.Activator;
-import org.eclipse.papyrus.infra.emf.compare.ui.messages.Messages;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-
-/**
- *
- * This class provides usefull methods to get a LabelProvider for the Editor.
- * It allows to instanciate only 1 LabelProvider and one CustomizationManager for 1 Editor even if there are 2 customizable viewers in the editor
- *
- */
-//FIXME use the futur service for the label provider
-//this class must have a package visibility
-class LabelProviderUtil {
-
- /**
- * This map associates an IEditorPart with an ILabelProvider
- */
- private final Map<IEditorPart, EMFCompareLabelProviderRefreshingViewer> labelProviderMap;
-
- /**
- * This map associates an IEditorPart with a CustomizationManager
- */
- private final Map<IEditorPart, CustomizationManager> customizationMap;
-
- /** LabelProviderUtil is a singleton */
- public final static LabelProviderUtil INSTANCE = new LabelProviderUtil();
-
- /**
- * Constructor
- */
- private LabelProviderUtil() {
- labelProviderMap = new HashMap<IEditorPart, EMFCompareLabelProviderRefreshingViewer>();
- customizationMap = new HashMap<IEditorPart, CustomizationManager>() {
-
- @Override
- public String toString() {
- String str = super.toString();
- return str.replaceAll(", ", "\n");
-
- }
- };
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().addPartListener(new CloseCompareEditorListener());
- }
-
- /**
- *
- * @param editor
- * an editor
- * @return
- * the ILabelProvider associated to this editor
- */
- public EMFCompareLabelProviderRefreshingViewer getLabelProviderFor(final IEditorPart editor/* , final Set<EPackage> packages */) {
- if(editor instanceof IMultiPageEditorPart) {
- /*
- * I set this exception because I think that we never want a customizable label provider for CoreMultiDiagramEditor.
- * We want a label provider for embedded editor (or eclipse editor)
- * -> when you get this exce^ption, it an error of the developper
- */
- throw new IllegalArgumentException(NLS.bind(Messages.LabelProviderUtil_CantProvideLabelProviderMessage, IMultiPageEditorPart.class));
- }
- EMFCompareLabelProviderRefreshingViewer provider = labelProviderMap.get(editor);
- if(provider == null) {
- CustomizationManager customizationManager = getCustomizationManager(editor);
- provider = new EMFCompareLabelProviderRefreshingViewer(customizationManager);
- labelProviderMap.put(editor, provider);
- }
- return provider;
- }
-
- /**
- *
- * @param editor
- * an editor
- * @return
- * the LabelProvider associated to this editor
- * @throws NullPointerException
- * when no LabelProvider is associated to the editor
- */
- public EMFCompareLabelProviderRefreshingViewer getExistingLabelProviderFor(final IEditorPart editor) throws NullPointerException {
- if(editor instanceof IMultiPageEditorPart) {
- /*
- * I set this exception because I think that we never want a customizable label provider for CoreMultiDiagramEditor.
- * We want a label provider for embedded editor (or eclipse editor)
- * -> when you get this exce^ption, it an error of the developper
- */
- throw new IllegalArgumentException(NLS.bind(Messages.LabelProviderUtil_CantProvideLabelProviderMessage, IMultiPageEditorPart.class));
- }
- final EMFCompareLabelProviderRefreshingViewer provider = labelProviderMap.get(editor);
- if(provider == null) {
- throw new NullPointerException();
- }
- return provider;
- }
-
- /**
- * Remove the LabelProvider and the CustomizationManager registered for this editor
- *
- * @param editor
- * an editor
- */
- public void destroyConfigurationFor(final IEditorPart editor) {
- labelProviderMap.remove(editor);
- customizationMap.remove(editor);
- }
-
- /**
- * FIXME : duplicated code with modelExplorer, table, ...?
- * init the customization manager
- *
- * @param customizationManager
- */
- private void init(final CustomizationManager customizationManager) {
- // the appearance can be customized here:
-
- customizationManager.setShowDerivedLinks(true);
-
- try {
-
- // load customizations defined as default through the customization
- // extension
- final List<MetamodelView> registryDefaultCustomizations = CustomizationsCatalog.getInstance().getRegistryDefaultCustomizations();
- for(final MetamodelView metamodelView : registryDefaultCustomizations) {
- customizationManager.registerCustomization(metamodelView);
- }
- customizationManager.loadCustomizations();
- //TODO load the facets!
- // loadFacetsForCustomizations(registryDefaultCustomizations,customizationManager);
-
- } catch (final Throwable e) {
- Activator.log.error(e);
- }
- }
-
- /**
- *
- * @param anEditor
- * an editor
- * @return
- * a customization manager for this editor
- */
- public CustomizationManager getCustomizationManager(final IEditorPart anEditor) {
- CustomizationManager manager = customizationMap.get(anEditor);
- if(manager == null) {
- manager = new CustomizationManager();
- init(manager);
- customizationMap.put(anEditor, manager);
- }
- return manager;
- }
-
- /**
- *
- * This listener allows to listen the close of the CompareEditor to remove it from the map
- *
- *
- */
- public class CloseCompareEditorListener implements IPartListener {
-
- /**
- *
- * @see org.eclipse.ui.IPartListener#partActivated(org.eclipse.ui.IWorkbenchPart)
- *
- * @param part
- */
- public void partActivated(final IWorkbenchPart part) {
- //nothing to do
- }
-
- /**
- *
- * @see org.eclipse.ui.IPartListener#partBroughtToTop(org.eclipse.ui.IWorkbenchPart)
- *
- * @param part
- */
- public void partBroughtToTop(final IWorkbenchPart part) {
- //nothing to do
- }
-
- /**
- *
- * @see org.eclipse.ui.IPartListener#partClosed(org.eclipse.ui.IWorkbenchPart)
- *
- * @param part
- */
- public void partClosed(final IWorkbenchPart part) {
- if(part instanceof CompareEditor) {
- customizationMap.remove(part);
- labelProviderMap.remove(part);
- }
- }
-
- /**
- *
- * @see org.eclipse.ui.IPartListener#partDeactivated(org.eclipse.ui.IWorkbenchPart)
- *
- * @param part
- */
- public void partDeactivated(final IWorkbenchPart part) {
- //nothing to do
- }
-
- /**
- *
- * @see org.eclipse.ui.IPartListener#partOpened(org.eclipse.ui.IWorkbenchPart)
- *
- * @param part
- */
- public void partOpened(final IWorkbenchPart part) {
- //nothing to do
- }
-
- }
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/messages/Messages.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/messages/Messages.java deleted file mode 100644 index 9bcc9006216..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/messages/Messages.java +++ /dev/null @@ -1,42 +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.infra.emf.compare.ui.messages;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
-
- private static final String BUNDLE_NAME = "org.eclipse.papyrus.infra.emf.compare.ui.messages.messages"; //$NON-NLS-1$
-
- public static String CollapseAllAction_CollapseAll;
-
- public static String CustomizationAction_ManageAppliedCustomization;
-
- public static String ExpandAllAction_ExpandAll;
-
- public static String LabelProviderUtil_CantProvideLabelProviderMessage;
-
- public static String LabelProviderUtil_CustomizationNotFound;
-
- public static String PapyrusTransactionalModelContentMergeViewer_MergeCommandLabel;
-
- public static String PapyrusTransactionalModelContentMergeViewer_TheCurrentEditorDontAllowToUseUndoRedo;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/messages/messages.properties b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/messages/messages.properties deleted file mode 100644 index 5f90c59b89d..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/messages/messages.properties +++ /dev/null @@ -1,7 +0,0 @@ -CollapseAllAction_CollapseAll=Collapse All
-CustomizationAction_ManageAppliedCustomization=Manage the applied customizations
-ExpandAllAction_ExpandAll=Expand All
-LabelProviderUtil_CantProvideLabelProviderMessage=I can't provide a label provider for {0}.
-LabelProviderUtil_CustomizationNotFound=Custom {0} not found
-PapyrusTransactionalModelContentMergeViewer_MergeCommandLabel=Merge Command
-PapyrusTransactionalModelContentMergeViewer_TheCurrentEditorDontAllowToUseUndoRedo=The current editor doesn't allow to use Undo/Redo.
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/provider/EMFCompareLabelProvider.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/provider/EMFCompareLabelProvider.java deleted file mode 100644 index c56d242a669..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/provider/EMFCompareLabelProvider.java +++ /dev/null @@ -1,160 +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 - * Vincent Lorenzo (CEA-LIST) - *****************************************************************************/ -package org.eclipse.papyrus.infra.emf.compare.ui.provider; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import org.eclipse.core.resources.IFile; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.facet.infra.browser.uicore.CustomizableModelLabelProvider; -import org.eclipse.emf.facet.infra.browser.uicore.CustomizationManager; -import org.eclipse.emf.facet.infra.browser.uicore.internal.AppearanceConfiguration; -import org.eclipse.emf.facet.infra.browser.uicore.internal.model.ITreeElement; -import org.eclipse.emf.facet.infra.browser.uicore.internal.model.ModelElementItem; -import org.eclipse.papyrus.infra.emf.compare.ui.Activator; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.ISharedImages; -import org.eclipse.ui.PlatformUI; - -/** - * This LabelProvider provides the same labels and icons as one can find in - * the Model Explorer. - * FIXME : is should have a part of duplicated code? - * - * - * TODO : this label provider should be able to support StyledString (as done by Tatiana). In order to do that, this label provider should be - * a CellLabelProvider (or (better ?) an {@link OwnerDrawLabelProvider}) Il will be easiest when we will use the last version of EMF-Facet - */ -public class EMFCompareLabelProvider extends CustomizableModelLabelProvider { - - /** The configuration. */ - private final AppearanceConfiguration configuration; - - - /** the customization manager for this label provider */ - private final CustomizationManager manager; - - /** - * Constructor. - * - * @param customizationManager - * the customization manager - */ - public EMFCompareLabelProvider(final CustomizationManager customizationManager) { - super(customizationManager); - this.manager = customizationManager; - this.configuration = getAppearanceConfiguration(customizationManager); - } - - - /** - * Gets the appearance configuration. - * - * @param customizationManager2 - * the customization manager2 - * @return the appearance configuration - */ - private AppearanceConfiguration getAppearanceConfiguration(final CustomizationManager customizationManager2) { - Method getApperanceConfigurationMethod; - try { - getApperanceConfigurationMethod = CustomizationManager.class.getDeclaredMethod("getAppearanceConfiguration"); //$NON-NLS-1$ - if(getApperanceConfigurationMethod != null) { - getApperanceConfigurationMethod.setAccessible(true); - return (AppearanceConfiguration)getApperanceConfigurationMethod.invoke(customizationManager2); - } - } catch (final SecurityException e) { - Activator.log.error(e); - } catch (final NoSuchMethodException e) { - Activator.log.error(e); - } catch (final IllegalArgumentException e) { - Activator.log.error(e); - } catch (final IllegalAccessException e) { - Activator.log.error(e); - } catch (final InvocationTargetException e) { - Activator.log.error(e); - } - return new AppearanceConfiguration(null); // default one. - } - - /** - * Gets the text. - * - * @param element - * the element - * @return the text {@inheritDoc} - */ - @Override - public String getText(final Object element) { - String text = ""; //$NON-NLS-1$ - if(element != null) { - if(element instanceof IFile) { - text = ((IFile)element).getName(); - } else if(element instanceof Resource) { - text = ((Resource)element).getURI().lastSegment(); - } - if(element instanceof EObject) { - final ITreeElement treeElement = getTreeElement((EObject)element); - text = super.getText(treeElement); - } else { - text = super.getText(element); - } - }else{ - text="null"; - } - return text; - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.emf.facet.infra.browser.uicore.CustomizableModelLabelProvider - * #getImage(java.lang.Object) - */ - @Override - public Image getImage(final Object element) { - Image image = null; - if(element instanceof IFile) { - image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FILE); - } else if(element instanceof EObject) { - final ITreeElement treeElement = getTreeElement((EObject)element); - image = super.getImage(treeElement); - } else { - image = super.getImage(element); - } - return image; - - } - - /** - * Gets the tree element. - * - * @param eObject - * the e object - * @return the tree element - */ - private ITreeElement getTreeElement(final EObject eObject) { - if(eObject == null) { - return null; - } - return new ModelElementItem(eObject, getTreeElement(eObject.eContainer()), this.configuration); - } - - public CustomizationManager getCustomizationManager() { - return this.manager; - } - -} diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/provider/ElementContentMergeContentProvider.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/provider/ElementContentMergeContentProvider.java deleted file mode 100644 index eb264705fb8..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/provider/ElementContentMergeContentProvider.java +++ /dev/null @@ -1,90 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Tatiana Fesenko (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.emf.compare.ui.provider; - -import org.eclipse.compare.CompareConfiguration; -import org.eclipse.emf.compare.ui.ModelCompareInput; -import org.eclipse.emf.compare.ui.viewer.content.ModelContentMergeContentProvider; -import org.eclipse.papyrus.infra.emf.compare.ecore_diff_extension.CompareTwoElementsDiffModel; - - -/** - * The ContentProvider used in the Merge Content Viewer. - */ -public class ElementContentMergeContentProvider extends ModelContentMergeContentProvider { - - /** - * Instantiates a new element content merge content provider. - * - * @param cc the cc - */ - public ElementContentMergeContentProvider(CompareConfiguration cc) { - super(cc); - } - - /* (non-Javadoc) - * @see org.eclipse.emf.compare.ui.viewer.content.ModelContentMergeContentProvider#getLeftContent(java.lang.Object) - */ - @Override - public Object getLeftContent(Object element) { - //TODO verif this test! - if(element instanceof ModelCompareInput) { - // if we compared a complete resource set, we should display the different resources - final Object diff = ((ModelCompareInput)element).getDiff(); - //Bug 336361 - [UML Compare] Compare two elements: show right element as root - if(diff instanceof CompareTwoElementsDiffModel) { - return new RootObject(((CompareTwoElementsDiffModel)diff).getLeftRoots().get(0)); - } - } - return super.getLeftContent(element); - } - - /* (non-Javadoc) - * @see org.eclipse.emf.compare.ui.viewer.content.ModelContentMergeContentProvider#getRightContent(java.lang.Object) - */ - @Override - public Object getRightContent(Object element) { - if(element instanceof ModelCompareInput) { - // if we compared a complete resource set, we should display the different resources - final Object diff = ((ModelCompareInput)element).getDiff(); - //Bug 336361 - [UML Compare] Compare two elements: show right element as root - if(diff instanceof CompareTwoElementsDiffModel) { - return new RootObject(((CompareTwoElementsDiffModel)diff).getRightRoots().get(0)); - } - } - return super.getRightContent(element); - } - - /** - * The Class RootObject. - */ - //Bug 336361 - [UML Compare] Compare two elements: show right element as root - //FIXME : why in static?! - public static class RootObject { - - /** The object. */ - public final Object object; - - /** - * Instantiates a new root object. - * - * @param object the object - */ - public RootObject(Object object) { - this.object = object; - } - } - - -} diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/provider/StyledDiffLabelSwitch.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/provider/StyledDiffLabelSwitch.java deleted file mode 100644 index bae992a089e..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/provider/StyledDiffLabelSwitch.java +++ /dev/null @@ -1,190 +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.compare.diff.extension; - -import org.eclipse.emf.compare.diff.metamodel.AttributeChange; -import org.eclipse.emf.compare.diff.metamodel.AttributeChangeLeftTarget; -import org.eclipse.emf.compare.diff.metamodel.AttributeChangeRightTarget; -import org.eclipse.emf.compare.diff.metamodel.DiffGroup; -import org.eclipse.emf.compare.diff.metamodel.DiffPackage; -import org.eclipse.emf.compare.diff.metamodel.ReferenceChange; -import org.eclipse.emf.compare.diff.metamodel.UpdateAttribute; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.StyledString; -import org.eclipse.papyrus.compare.Messages; -import org.eclipse.papyrus.compare.StyledMessageFormat; -import org.eclipse.papyrus.compare.diff.metamodel.uml_diff_extension.CompareTwoElementsDiffModel; -import org.eclipse.papyrus.compare.diff.metamodel.uml_diff_extension.util.UMLDiffSwitch; - - -/** - * Switch to return Styled label for the given DiffElement. - * Usually changed elements and number of chnages are shown in bold. - */ -//TODO use this to get the tatiana customization in the upper viewer -public class StyledDiffLabelSwitch extends UMLDiffSwitch<StyledString> { - - /** The my domain element label provider. */ - private final ILabelProvider myDomainElementLabelProvider; - - /** - * Instantiates a new styled diff label switch. - * - * @param labelProvider the label provider - */ - public StyledDiffLabelSwitch(ILabelProvider labelProvider) { - myDomainElementLabelProvider = labelProvider; - } - - /* (non-Javadoc) - * @see org.eclipse.papyrus.compare.diff.metamodel.uml_diff_extension.util.UMLDiffSwitch#defaultCase(org.eclipse.emf.ecore.EObject) - */ - @Override - public StyledString defaultCase(EObject object) { - int classifierID = object.eClass().getClassifierID(); - switch(classifierID) { - case DiffPackage.DIFF_GROUP: - { - DiffGroup diffGroup = (DiffGroup)object; - return caseDiffGroup(diffGroup); - } - case DiffPackage.UPDATE_ATTRIBUTE: - { - UpdateAttribute updateAttribute = (UpdateAttribute)object; - return caseUpdateAttribute(updateAttribute); - } - } - return null; - } - - /** - * Gets the label provider. - * - * @return the label provider - */ - private ILabelProvider getLabelProvider() { - return myDomainElementLabelProvider; - } - - /* (non-Javadoc) - * @see org.eclipse.papyrus.compare.diff.metamodel.uml_diff_extension.util.UMLDiffSwitch#caseCompareTwoElementsDiffModel(org.eclipse.papyrus.compare.diff.metamodel.uml_diff_extension.CompareTwoElementsDiffModel) - */ - @Override - public StyledString caseCompareTwoElementsDiffModel(CompareTwoElementsDiffModel object) { - int subchanges = ((DiffGroup)object.getOwnedElements().get(0)).getSubchanges(); - EObject leftElement = object.getLeftRoots().get(0); - String leftName = getLabelProvider().getText(leftElement); - EObject rightElement = object.getRightRoots().get(0); - String rightName = getLabelProvider().getText(rightElement); - - // String message = "%s change(s) between elements [%s] and [%s]"; - // return String.StyledMessageFormat.format(message, subchanges, leftName, rightName); - - return StyledMessageFormat.format(Messages.StyledDiffLabelSwitch_two_elements_model_text, String.valueOf(subchanges), leftName, rightName); - - } - - /** - * Case diff group. - * - * @param object the object - * @return the styled string - */ - public StyledString caseDiffGroup(DiffGroup object) { - final EObject parent = object.getRightParent(); - final String parentLabel; - if(parent != null) { - parentLabel = getLabelProvider().getText(parent); - } else { - parentLabel = Messages.StyledDiffLabelSwitch_root_text; - } - return StyledMessageFormat.format(Messages.StyledDiffLabelSwitch_diff_group_text, String.valueOf(object.getSubchanges()), parentLabel); - } - - /* (non-Javadoc) - * @see org.eclipse.papyrus.compare.diff.metamodel.uml_diff_extension.util.UMLDiffSwitch#caseAttributeChange(org.eclipse.emf.compare.diff.metamodel.AttributeChange) - */ - @Override - public StyledString caseAttributeChange(AttributeChange object) { - return StyledMessageFormat.format(Messages.StyledDiffLabelSwitch_attribute_change_text, String.valueOf(object.isConflicting())); - } - - /* (non-Javadoc) - * @see org.eclipse.papyrus.compare.diff.metamodel.uml_diff_extension.util.UMLDiffSwitch#caseAttributeChangeLeftTarget(org.eclipse.emf.compare.diff.metamodel.AttributeChangeLeftTarget) - */ - @Override - public StyledString caseAttributeChangeLeftTarget(AttributeChangeLeftTarget object) { - final String attributeLabel = getLabelProvider().getText(object.getAttribute()); - final String elementLabel = getLabelProvider().getText(object.getRightElement()); - - if(object.isRemote()) { - return StyledMessageFormat.format(Messages.StyledDiffLabelSwitch_attribute_change_left_target_remote_text, attributeValueToString(object.getLeftTarget()), attributeLabel, elementLabel); - } - return StyledMessageFormat.format(Messages.StyledDiffLabelSwitch_attribute_change_left_target_text, attributeValueToString(object.getLeftTarget()), attributeLabel, elementLabel); - } - - /* (non-Javadoc) - * @see org.eclipse.papyrus.compare.diff.metamodel.uml_diff_extension.util.UMLDiffSwitch#caseAttributeChangeRightTarget(org.eclipse.emf.compare.diff.metamodel.AttributeChangeRightTarget) - */ - @Override - public StyledString caseAttributeChangeRightTarget(AttributeChangeRightTarget object) { - final String attributeLabel = getLabelProvider().getText(object.getAttribute()); - final String elementLabel = getLabelProvider().getText(object.getLeftElement()); - - if(object.isRemote()) { - return StyledMessageFormat.format(Messages.StyledDiffLabelSwitch_attribute_change_right_target_remote_text, attributeValueToString(object.getRightTarget()), attributeLabel, elementLabel); - } - return StyledMessageFormat.format(Messages.StyledDiffLabelSwitch_attribute_change_right_target_text, attributeValueToString(object.getRightTarget()), attributeLabel, elementLabel); - } - - /* (non-Javadoc) - * @see org.eclipse.papyrus.compare.diff.metamodel.uml_diff_extension.util.UMLDiffSwitch#caseUpdateAttribute(org.eclipse.emf.compare.diff.metamodel.UpdateAttribute) - */ - @Override - public StyledString caseUpdateAttribute(UpdateAttribute object) { - final String attributeLabel = getLabelProvider().getText(object.getAttribute()); - final String elementLabel = getLabelProvider().getText(object.getLeftElement()); - final Object leftValue = object.getLeftElement().eGet(object.getAttribute()); - final Object rightValue = object.getRightElement().eGet(object.getAttribute()); - - if(object.isRemote()) { - return StyledMessageFormat.format(Messages.StyledDiffLabelSwitch_update_attribute_remote_text, attributeLabel, elementLabel, attributeValueToString(leftValue), attributeValueToString(rightValue)); - } - - if(object.isConflicting()) { - return StyledMessageFormat.format(Messages.StyledDiffLabelSwitch_update_attribute_conflicting_text, attributeLabel, attributeValueToString(rightValue), attributeValueToString(leftValue)); - } - return StyledMessageFormat.format(Messages.StyledDiffLabelSwitch_update_attribute_text, attributeLabel, elementLabel, attributeValueToString(rightValue), attributeValueToString(leftValue)); - } - - /* (non-Javadoc) - * @see org.eclipse.papyrus.compare.diff.metamodel.uml_diff_extension.util.UMLDiffSwitch#caseReferenceChange(org.eclipse.emf.compare.diff.metamodel.ReferenceChange) - */ - @Override - public StyledString caseReferenceChange(ReferenceChange object) { - return StyledMessageFormat.format(Messages.StyledDiffLabelSwitch_reference_chnage_text, String.valueOf(object.isConflicting())); - } - - /** - * Attribute value to string. - * - * @param attributeValue the attribute value - * @return the string - */ - private String attributeValueToString(Object attributeValue) { - return attributeValue == null ? Messages.StyledDiffLabelSwitch_null_value_text : attributeValue.toString(); - } - -} diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/provider/UMLStyledStructureLabelProvider.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/provider/UMLStyledStructureLabelProvider.java deleted file mode 100644 index 7babdf7e34b..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/provider/UMLStyledStructureLabelProvider.java +++ /dev/null @@ -1,100 +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.compare.diff.extension; - -import org.eclipse.emf.compare.diff.metamodel.AbstractDiffExtension; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.StyledCellLabelProvider; -import org.eclipse.jface.viewers.StyledString; -import org.eclipse.jface.viewers.ViewerCell; -import org.eclipse.papyrus.compare.diff.metamodel.uml_diff_extension.util.UMLDiffSwitch; -import org.eclipse.swt.graphics.Image; - - -/** - * LabelProvider that returns Styled label. - * Usually changed elements and number of changes are shown in bold. - */ -//TODO use this to get the tatiana customization in the upper viewer -public class UMLStyledStructureLabelProvider extends StyledCellLabelProvider implements ILabelProvider { - - /** The my delegate. */ - private final ILabelProvider myDelegate; - - /** The my diff label switch. */ - private final UMLDiffSwitch<StyledString> myDiffLabelSwitch; - - /** - * Instantiates a new uML styled structure label provider. - * - * @param delegate the delegate - */ - public UMLStyledStructureLabelProvider(ILabelProvider delegate) { - myDelegate = delegate; - myDiffLabelSwitch = new StyledDiffLabelSwitch(delegate); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object) - */ - public Image getImage(Object element) { - if(element instanceof AbstractDiffExtension) { - return (Image)((AbstractDiffExtension)element).getImage(); - } - return myDelegate.getImage(element); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object) - */ - public String getText(Object element) { - return getStyledText(element).getString(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.StyledCellLabelProvider#update(org.eclipse.jface.viewers.ViewerCell) - */ - public void update(ViewerCell cell) { - StyledString string = getStyledText(cell.getElement()); - cell.setText(string.getString()); - cell.setStyleRanges(string.getStyleRanges()); - cell.setImage(getImage(cell.getElement())); - super.update(cell); - } - - /** - * Gets the styled text. - * - * @param element the element - * @return the styled text - */ - public StyledString getStyledText(Object element) { - if(element instanceof EObject) { - StyledString diffElementLabel = myDiffLabelSwitch.doSwitch((EObject)element); - if(diffElementLabel != null) { - return diffElementLabel; - } - } - String elementText = myDelegate.getText(element); - if (elementText != null) { - StyledString styledString = new StyledString(); - styledString.append(myDelegate.getText(element)); - return styledString; - } - return null; - } - - -} diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/queries/GetDiffElementLabel.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/queries/GetDiffElementLabel.java deleted file mode 100644 index 929194287a2..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/queries/GetDiffElementLabel.java +++ /dev/null @@ -1,293 +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.infra.emf.compare.ui.queries; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.compare.diff.metamodel.AttributeChange; -import org.eclipse.emf.compare.diff.metamodel.AttributeChangeLeftTarget; -import org.eclipse.emf.compare.diff.metamodel.AttributeChangeRightTarget; -import org.eclipse.emf.compare.diff.metamodel.AttributeOrderChange; -import org.eclipse.emf.compare.diff.metamodel.DiffGroup; -import org.eclipse.emf.compare.diff.metamodel.ModelElementChangeLeftTarget; -import org.eclipse.emf.compare.diff.metamodel.ModelElementChangeRightTarget; -import org.eclipse.emf.compare.diff.metamodel.MoveModelElement; -import org.eclipse.emf.compare.diff.metamodel.ReferenceChangeLeftTarget; -import org.eclipse.emf.compare.diff.metamodel.ReferenceChangeRightTarget; -import org.eclipse.emf.compare.diff.metamodel.ReferenceOrderChange; -import org.eclipse.emf.compare.diff.metamodel.UpdateAttribute; -import org.eclipse.emf.compare.diff.metamodel.UpdateContainmentFeature; -import org.eclipse.emf.compare.diff.metamodel.UpdateModelElement; -import org.eclipse.emf.compare.diff.metamodel.UpdateReference; -import org.eclipse.emf.compare.diff.provider.DiffElementItemProvider; -import org.eclipse.emf.compare.util.AdapterUtils; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.facet.infra.query.core.exception.ModelQueryExecutionException; -import org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery; -import org.eclipse.emf.facet.infra.query.core.java.ParameterValueList; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.osgi.util.NLS; -import org.eclipse.papyrus.infra.core.sasheditor.editor.IMultiPageEditorPart; -import org.eclipse.papyrus.infra.emf.Activator; -import org.eclipse.papyrus.infra.emf.compare.ui.internal.utils.CustomizationAndViewerActionDispatcher; -import org.eclipse.papyrus.infra.tools.util.EditorHelper; -import org.eclipse.papyrus.infra.widgets.toolbox.notification.builders.NotificationBuilder; -import org.eclipse.ui.IEditorPart; - -/** - * - * This query returns the label to display for DiffElement - * TODO : dispatch this class in several classes (1 by DiffElement subtype, when we are having agregate - * - */ -public class GetDiffElementLabel implements IJavaModelQuery<EObject, String> { - - /** - * The code of this method is adapter of the implementation of getText in the Default Label Provider for each of the managed DiffElement - * - * @see org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery#evaluate(org.eclipse.emf.ecore.EObject, - * org.eclipse.emf.facet.infra.query.core.java.ParameterValueList) - * - * @param context - * @param parameterValues - * @return - * @throws ModelQueryExecutionException - */ - public String evaluate(final EObject context, final ParameterValueList parameterValues) throws ModelQueryExecutionException { - final AdapterFactory adapter = AdapterUtils.getAdapterFactory(); - final DiffElementItemProvider itemProvider = new DiffElementItemProvider(adapter); - IEditorPart editor = EditorHelper.getCurrentEditor(); - - if(editor instanceof IMultiPageEditorPart) { - editor = ((IMultiPageEditorPart)editor).getActiveEditor(); - } - - if(editor == null) { - return null; - } - LabelProvider labelProvider; - try { - labelProvider = CustomizationAndViewerActionDispatcher.getExistingLabelProvider(editor); - } catch (NullPointerException e) { - return null; - } - String diffLabel = null; - - if(context instanceof UpdateAttribute) { //comes from UpdateAttributeItemProvider - //TODO : not tested - final UpdateAttribute updateOp = (UpdateAttribute)context; - final String attributeLabel = labelProvider.getText(updateOp.getAttribute()); - final String elementLabel = labelProvider.getText(updateOp.getLeftElement()); - final Object leftValue = updateOp.getLeftElement().eGet(updateOp.getAttribute()); - final Object rightValue = updateOp.getRightElement().eGet(updateOp.getAttribute()); - if(updateOp.isRemote()) { - diffLabel = itemProvider.getString("_UI_RemoteUpdateAttribute_type", new Object[]{ attributeLabel, elementLabel, leftValue, rightValue, }); //$NON-NLS-1$ - } else { - if(updateOp.isConflicting()) { - diffLabel = itemProvider.getString("_UI_UpdateAttribute_conflicting", new Object[]{ attributeLabel, rightValue, leftValue, }); //$NON-NLS-1$ - } else { - diffLabel = itemProvider.getString("_UI_UpdateAttribute_type", new Object[]{ attributeLabel, elementLabel, rightValue, leftValue, }); //$NON-NLS-1$ - } - } - } else if(context instanceof AttributeOrderChange) { //comes from AttributeOrderChangeItemProvider - //TODO : not tested - //TODO : useful? - AttributeOrderChange attributeOrderChange = (AttributeOrderChange)context; - diffLabel = itemProvider.getString("_UI_AttributeOrderChange_type", new Object[]{ attributeOrderChange.getAttribute().getName() }); //$NON-NLS-1$ - - } else if(context instanceof AttributeChangeLeftTarget) {//comes from AttributeChangeLeftTargetItemProvider - //not tested - final AttributeChangeLeftTarget operation = (AttributeChangeLeftTarget)context; - final String attributeLabel = labelProvider.getText(operation.getAttribute()); - final String elementLabel = labelProvider.getText(operation.getRightElement()); - - if(operation.isRemote()) { - diffLabel = itemProvider.getString("_UI_RemoteRemoveAttribute_type", new Object[]{ operation.getLeftTarget(), attributeLabel, elementLabel, }); //$NON-NLS-1$ - } else { - diffLabel = itemProvider.getString("_UI_AddAttribute_type", new Object[]{ operation.getLeftTarget(), attributeLabel, elementLabel, }); //$NON-NLS-1$ - } - - } else if(context instanceof AttributeChangeRightTarget) { //comes from AttributeChangeRightTargetItemProvider - //TODO : not tested - final AttributeChangeRightTarget operation = (AttributeChangeRightTarget)context; - final String attributeLabel = labelProvider.getText(operation.getAttribute()); - final String elementLabel = labelProvider.getText(operation.getLeftElement()); - - if(operation.isRemote()) { - diffLabel = itemProvider.getString("_UI_RemoteAddAttribute_type", new Object[]{ operation.getRightTarget(), attributeLabel, elementLabel, }); //$NON-NLS-1$ - } else { - diffLabel = itemProvider.getString("_UI_RemoveAttribute_type", new Object[]{ operation.getRightTarget(), attributeLabel, elementLabel, }); //$NON-NLS-1$ - } - } else if(context instanceof AttributeChange) {//comes from AttributeChangeItemProvider - //TODO : not tested - //TODO : useful? - AttributeChange attributeChange = (AttributeChange)context; - diffLabel = itemProvider.getString("_UI_AttributeChange_type") + " " + attributeChange.isConflicting(); //$NON-NLS-1$ //$NON-NLS-2$ - } else if(context instanceof DiffGroup) { //comes from DiffGroupItemProvider - final DiffGroup group = (DiffGroup)context; - final EObject parent = group.getRightParent(); - if(parent != null) { - final String parentLabel = labelProvider.getText(parent); - diffLabel = itemProvider.getString("_UI_DiffGroup_type", new Object[]{ group.getSubchanges(), parentLabel }); //$NON-NLS-1$ - } else { - diffLabel = itemProvider.getString("_UI_DiffGroup_type", new Object[]{ group.getSubchanges(), "model" }); //$NON-NLS-1$ //$NON-NLS-2$ - } - } else if(context instanceof UpdateContainmentFeature) {//comes from UpdateContainmentFeatureItemProvider - //TODO : not tested - //TODO : useful? - final UpdateContainmentFeature operation = (UpdateContainmentFeature)context; - final String leftContainmentFeature = operation.getLeftElement().eContainmentFeature().getName(); - final String rightContainmentFeature = operation.getRightElement().eContainmentFeature().getName(); - - if(operation.isRemote()) { - diffLabel = itemProvider.getString("_UI_RemoteUpdateContainmentFeature_type", new Object[]{ rightContainmentFeature, leftContainmentFeature, }); //$NON-NLS-1$ - } else { - diffLabel = itemProvider.getString("_UI_UpdateContainmentFeature_type", new Object[]{ rightContainmentFeature, leftContainmentFeature, }); //$NON-NLS-1$ - } - } else if(context instanceof MoveModelElement) {//comes from MoveModelElementItemProvider - //TODO : not tested - final MoveModelElement operation = (MoveModelElement)context; - - final String elementLabel = labelProvider.getText(operation.getLeftElement()); - final String oldParentLabel = labelProvider.getText(operation.getLeftTarget()); - final String newParentLabel = labelProvider.getText(operation.getRightTarget()); - - if(operation.isRemote()) { - diffLabel = itemProvider.getString("_UI_RemoteMoveModelElement_type", new Object[]{ elementLabel, oldParentLabel, newParentLabel, }); //$NON-NLS-1$ - } else { - if(operation.isConflicting()) { - diffLabel = itemProvider.getString("_UI_MoveModelElement_conflicting", new Object[]{ elementLabel, oldParentLabel, newParentLabel, }); //$NON-NLS-1$ - } else { - diffLabel = itemProvider.getString("_UI_MoveModelElement_type", new Object[]{ elementLabel, oldParentLabel, newParentLabel, }); //$NON-NLS-1$ - } - } - } else if(context instanceof UpdateModelElement) {//comes from UpdateModelElementItemProvider - //TODO : not tested - //TODO : useful ? - UpdateModelElement updateModelElement = (UpdateModelElement)context; - diffLabel = itemProvider.getString("_UI_UpdateModelElement_type") + " " + updateModelElement.isConflicting(); //$NON-NLS-1$ //$NON-NLS-2$ - } else if(context instanceof ModelElementChangeLeftTarget) { //comes from ModelElementChangeLeftTargetItemProvider - //TODO : not tested - final ModelElementChangeLeftTarget operation = (ModelElementChangeLeftTarget)context; - final String targetName = labelProvider.getText(operation.getLeftElement()); - if(operation.isRemote()) { - if(operation.isConflicting()) { - diffLabel = itemProvider.getString("_UI_RemoteRemoveModelElement_conflicting", new Object[]{ targetName }); //$NON-NLS-1$ - } else { - diffLabel = itemProvider.getString("_UI_RemoteRemoveModelElement_type", new Object[]{ targetName }); //$NON-NLS-1$ - } - } else { - diffLabel = itemProvider.getString("_UI_AddModelElement_type", new Object[]{ targetName, }); //$NON-NLS-1$ - } - - } else if(context instanceof ModelElementChangeRightTarget) { //comes from ModelElementChangeRightTargetItemProvider - final ModelElementChangeRightTarget operation = (ModelElementChangeRightTarget)context; - final String targetName = labelProvider.getText(operation.getRightElement()); - if(operation.isRemote()) { - diffLabel = itemProvider.getString("_UI_RemoteAddModelElement_type", new Object[]{ targetName }); //$NON-NLS-1$ - } else { - if(operation.isConflicting()) { - diffLabel = itemProvider.getString("_UI_RemoveModelElement_conflicting", new Object[]{ targetName }); //$NON-NLS-1$ - } else { - diffLabel = itemProvider.getString("_UI_RemoveModelElement_type", new Object[]{ targetName, }); //$NON-NLS-1$ - } - } - - - } else if(context instanceof UpdateReference) { //comes from UpdateReferenceItemProvider - //TODO : not tested - final UpdateReference operation = (UpdateReference)context; - final String elementLabel = labelProvider.getText(operation.getLeftElement()); - final String referenceLabel = AdapterUtils.getItemProviderText(operation.getReference());//TODO : use labelProvider ? - final String leftValueLabel = labelProvider.getText(getLeftValue(operation)); - final String rightValueLabel = labelProvider.getText(getRightValue(operation)); - - if(operation.isRemote()) { - diffLabel = itemProvider.getString("_UI_RemoteUpdateReference_type", new Object[]{ referenceLabel, elementLabel, leftValueLabel, rightValueLabel, }); //$NON-NLS-1$ - } else { - if(operation.isConflicting()) { - diffLabel = itemProvider.getString("_UI_UpdateReference_conflicting", new Object[]{ referenceLabel, elementLabel, rightValueLabel, leftValueLabel, }); //$NON-NLS-1$ - } else { - diffLabel = itemProvider.getString("_UI_UpdateReference_type", new Object[]{ referenceLabel, elementLabel, rightValueLabel, leftValueLabel, }); //$NON-NLS-1$ - } - } - - } else if(context instanceof ReferenceOrderChange) { //comes from ReferenceOrderChangeItemProvider - //TODO not tested - //TODO : useful? - final ReferenceOrderChange referenceOrderChange = (ReferenceOrderChange)context; - diffLabel = itemProvider.getString("_UI_ReferenceOrderChange_type", new Object[]{ referenceOrderChange.getReference().getName() }); //$NON-NLS-1$ - } else if(context instanceof ReferenceChangeLeftTarget) { //comes from ReferenceChangeLeftTargetItemProvider - //TODO : not tested - final ReferenceChangeLeftTarget operation = (ReferenceChangeLeftTarget)context; - - final String valueLabel = labelProvider.getText(operation.getLeftTarget()); - final String referenceLabel = labelProvider.getText(operation.getReference()); - final String elementLabel = labelProvider.getText(operation.getRightElement()); - - if(operation.isRemote()) { - diffLabel = itemProvider.getString("_UI_RemoteRemoveReferenceValue_type", new Object[]{ valueLabel, referenceLabel, elementLabel, }); //$NON-NLS-1$ - } else { - diffLabel = itemProvider.getString("_UI_AddReferenceValue_type", new Object[]{ valueLabel, referenceLabel, elementLabel, }); //$NON-NLS-1$ - } - } else if(context instanceof ReferenceChangeRightTarget) { //comes from ReferenceChangeRightTargetItemProvider - //TODO : not tested - final ReferenceChangeRightTarget operation = (ReferenceChangeRightTarget)context; - - final String valueLabel = labelProvider.getText(operation.getRightTarget()); - final String referenceLabel = labelProvider.getText(operation.getReference()); - final String elementLabel = labelProvider.getText(operation.getLeftElement()); - - if(operation.isRemote()) { - diffLabel = itemProvider.getString("_UI_RemoteAddReferenceValue_type", new Object[]{ valueLabel, referenceLabel, elementLabel, }); //$NON-NLS-1$ - } else { - diffLabel = itemProvider.getString("_UI_RemoveReferenceValue_type", new Object[]{ valueLabel, referenceLabel, elementLabel, }); //$NON-NLS-1$ - } - } - if(diffLabel == null) { - final String message = NLS.bind("{0} doesn't manage {1}", new Object[]{ this.getClass().getSimpleName(), context.getClass().getSimpleName() });//$NON-NLS-1$ - Activator.log.warn(message); - NotificationBuilder.createAsyncPopup(message).run(); - // in this case the default Label will be displayed - } - return diffLabel; - } - - - /** - * Returns the value of the given operation's target reference for the left element. - * - * @param operation - * The update reference operation for which we need target information. - * @return The value of the given operation's target reference for the left element. - */ - private EObject getLeftValue(final UpdateReference operation) { - final EReference reference = operation.getReference(); - return (EObject)operation.getLeftElement().eGet(reference); - } - - /** - * Returns the value of the given operation's target reference for the right element. - * - * @param operation - * The update reference operation for which we need target information. - * @return The value of the given operation's target reference for the right element. - */ - private EObject getRightValue(final UpdateReference operation) { - final EReference reference = operation.getReference(); - return (EObject)operation.getRightElement().eGet(reference); - } - -} diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/structural/viewer/PapyrusCustomizableParameterizedStructureMergeViewer.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/structural/viewer/PapyrusCustomizableParameterizedStructureMergeViewer.java deleted file mode 100644 index 283fc4bc7ff..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/structural/viewer/PapyrusCustomizableParameterizedStructureMergeViewer.java +++ /dev/null @@ -1,192 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.emf.compare.ui.structural.viewer;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.compare.CompareViewerPane;
-import org.eclipse.emf.compare.ui.ModelCompareInput;
-import org.eclipse.emf.compare.ui.viewer.structure.ParameterizedStructureContentProvider;
-import org.eclipse.emf.compare.ui.viewer.structure.ParameterizedStructureMergeViewer;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.papyrus.infra.emf.compare.ui.actions.CollapseAllAction;
-import org.eclipse.papyrus.infra.emf.compare.ui.actions.CustomizationAction;
-import org.eclipse.papyrus.infra.emf.compare.ui.actions.ExpandAllAction;
-import org.eclipse.papyrus.infra.emf.compare.ui.internal.utils.CustomizationAndViewerActionDispatcher;
-import org.eclipse.papyrus.infra.emf.compare.ui.internal.utils.EMFCompareUIUtils;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-
-/**
- *
- * This class allows to declare our own LabelProvider for the structural viewer
- *
- */
-public class PapyrusCustomizableParameterizedStructureMergeViewer extends ParameterizedStructureMergeViewer {
-
- /**
- * the list of the metamodels referenced by the input
- */
- private Collection<EPackage> metamodels;
-
- /**
- * The label provider
- */
- private LabelProvider labelProvider;
-
- /** the current editor */
- private final IEditorPart editor;
-
- /**
- *
- * Constructor.
- * see {@link ParameterizedStructureMergeViewer#ParameterizedStructureMergeViewer(Composite, CompareConfiguration)}
- *
- * @param parent
- * @param compareConfiguration
- */
- public PapyrusCustomizableParameterizedStructureMergeViewer(final Composite parent, final CompareConfiguration compareConfiguration, final IEditorPart editor) {
- super(parent, compareConfiguration);
- this.editor = editor;
- setLabelProvider(createLabelProvider());
- }
-
- /**
- *
- * @see org.eclipse.emf.compare.ui.viewer.structure.ModelStructureMergeViewer#inputChanged(java.lang.Object, java.lang.Object)
- *
- * @param input
- * @param oldInput
- */
- @Override
- protected void inputChanged(final Object input, final Object oldInput) {
- if(input instanceof ModelCompareInput) {
- metamodels = EMFCompareUIUtils.getMetamodelForCustomization(input, metamodels);
- }
- super.inputChanged(input, oldInput);
- }
-
- /**
- *
- * @see org.eclipse.emf.compare.ui.viewer.structure.ParameterizedStructureMergeViewer#createToolItems()
- *
- */
- @Override
- protected void createToolItems() {
- final ToolBarManager tbm = CompareViewerPane.getToolBarManager(getControl().getParent());
- tbm.removeAll();
- super.createToolItems();
- if(metamodels == null) {
- metamodels = new HashSet<EPackage>();
- }
-
- //we add the expand all action
- final IAction expandAllAction = new ExpandAllAction(this);
- final ActionContributionItem expandAllContributionItem = new ActionContributionItem(expandAllAction);
- tbm.insert(0, expandAllContributionItem);
-
- //we add the collapse all action
- final IAction collapseAllAction = new CollapseAllAction(this);
- final ActionContributionItem collapseAllActionContributionItem = new ActionContributionItem(collapseAllAction);
- tbm.insert(1, collapseAllActionContributionItem);
-
- tbm.insert(2, new Separator("treeAction")); //$NON-NLS-1$
-
- //we add an action to change the applied cuztomization
- final IAction customizationAction = new CustomizationAction(Collections.unmodifiableCollection(metamodels));
- final ActionContributionItem customizationContributionItem = new ActionContributionItem(customizationAction);
- tbm.insert(3, customizationContributionItem);
-
-
- tbm.update(true);
- }
-
-
- /**
- *
- * @see org.eclipse.emf.compare.ui.viewer.structure.ModelStructureMergeViewer#handleDispose(org.eclipse.swt.events.DisposeEvent)
- *
- * @param event
- */
- @Override
- protected void handleDispose(final DisposeEvent event) {
- metamodels.clear();
- CustomizationAndViewerActionDispatcher.dissociateTreeViewerAndLabelProvider(this, this.labelProvider);
- super.handleDispose(event);
- }
-
- /**
- *
- * @param compareConfiguration
- * @return
- */
- protected LabelProvider createLabelProvider() {
- this.labelProvider = CustomizationAndViewerActionDispatcher.getLabelProvider(this.editor);
- return this.labelProvider;
- }
-
- /**
- * FIXME : in the default implementation, the root DiffGroup show that there are children, even if they are marked has hidden, it is a bad idea to
- * do that here, I think
- * Build the content provider in relation to the compare configuration and the preference values on
- * filters to apply.
- *
- * @param compareConfiguration
- * The compare configuration.
- * @return The content provider.
- * @since 1.3
- */
- protected ParameterizedStructureContentProvider buildContentProvider(CompareConfiguration compareConfiguration) {
- final ParameterizedStructureContentProvider contentProvider = new ParameterizedStructureContentProvider(compareConfiguration, getDefaultOrdering(), getDefaultFilters()) {
-
- @Override
- public Object[] getElements(Object inputElement) {
- if(inputElement instanceof ModelCompareInput) {
- return super.getElements(((ModelCompareInput)inputElement).getDiff());
- }
- return super.getElements(inputElement);
- }
-
- @Override
- public boolean hasChildren(Object element) {
- if(element != null) {
- Object[] children = getChildren(element);
- if(children != null) {
- return children.length != 0;
- }
- }
- return false;
- }
-
- @Override
- public Object[] getChildren(Object parentElement) {
- Object[] child = super.getChildren(parentElement);
- if(child != null) {
- return child;
- }
- return new Object[0];
- }
- };
- return contentProvider;
- }
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/structural/viewer/PapyrusStructureMergeViewerCreator.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/structural/viewer/PapyrusStructureMergeViewerCreator.java deleted file mode 100644 index 1b880a36019..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/structural/viewer/PapyrusStructureMergeViewerCreator.java +++ /dev/null @@ -1,45 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.emf.compare.ui.structural.viewer;
-
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.compare.IViewerCreator;
-import org.eclipse.compare.internal.CompareEditor;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.papyrus.infra.tools.util.EditorHelper;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorPart;
-
-/**
- *
- *
- * this class creates the MergeViewer
- */
-public class PapyrusStructureMergeViewerCreator implements IViewerCreator {
-
- /**
- *
- * {@inheritDoc}
- *
- * @param parent
- * @param config
- * @return
- */
- public Viewer createViewer(final Composite parent, final CompareConfiguration config) {
- final IEditorPart editor = EditorHelper.getCurrentEditor();//the current CompareEditor
- Assert.isTrue(editor instanceof CompareEditor);
- return new PapyrusCustomizableParameterizedStructureMergeViewer(parent, config, editor);
- }
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/utils/ICustomizableEditor.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/utils/ICustomizableEditor.java deleted file mode 100644 index e2ed739abd7..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/utils/ICustomizableEditor.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.eclipse.papyrus.infra.emf.compare.ui.utils;
-
-import org.eclipse.papyrus.infra.emf.compare.ui.provider.EMFCompareLabelProvider;
-import org.eclipse.ui.IEditorPart;
-
-/**
- *
- * This interface provides useful methods to manage easily the customization of the viewers in an editor
- *
- */
-public interface ICustomizableEditor extends IEditorPart {
-
- /**
- *
- * @return
- * a LabelProvider
- */
- public EMFCompareLabelProvider getLabelProvider();
-
- /**
- * Refresh the viewers of the editor
- */
- public void refreshViewers();
-}
diff --git a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/utils/LabelProviderUtil.java b/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/utils/LabelProviderUtil.java deleted file mode 100644 index bb9ee1d67fb..00000000000 --- a/deprecated/uml-compare-1.X/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/utils/LabelProviderUtil.java +++ /dev/null @@ -1,98 +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.infra.emf.compare.ui.utils;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.emf.facet.infra.browser.custom.MetamodelView;
-import org.eclipse.emf.facet.infra.browser.custom.core.CustomizationsCatalog;
-import org.eclipse.emf.facet.infra.browser.uicore.CustomizationManager;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.infra.emf.compare.ui.Activator;
-import org.eclipse.papyrus.infra.emf.compare.ui.messages.Messages;
-import org.eclipse.papyrus.infra.emf.compare.ui.provider.EMFCompareLabelProvider;
-
-/**
- *
- * This class provides methods to get the customizable LabelProvider for the CompareEditor and viewers
- *
- */
-//TODO : move this in the class EMFCompareLabelProvider (or not)
-//warning : there is a subclass to EMFCompareLabelProvider, with specific action with the CustomizationEngine
-public class LabelProviderUtil {
-
- /**
- * This list contains the name of the wanted customization to applied by default
- * TODO add the plugins providing these customizations as dependencies ?
- */
- private static Collection<String> wantedCustomName;
-
- private LabelProviderUtil() {
- //to prevent intentiation
- }
-
- public static final EMFCompareLabelProvider createLabelProvider() {
- CustomizationManager customizationManager = new CustomizationManager();
- init(customizationManager);
- return new EMFCompareLabelProvider(customizationManager);
- }
-
- /**
- * FIXME : duplicated code with modelExplorer, table, ...?
- * init the customization manager
- *
- * @param customizationManager
- */
- private static void init(final CustomizationManager customizationManager) {
- if(wantedCustomName == null) {
- wantedCustomName = new ArrayList<String>();
- // the appearance can be customized here:
- wantedCustomName.add("uml_compare_diff"); //$NON-NLS-1$
- wantedCustomName.add("uml_emf_compare_diff"); //$NON-NLS-1$
- wantedCustomName.add("compare_diff"); //$NON-NLS-1$
- wantedCustomName.add("UMLPapyrusDefaultBrowserCustomization"); //$NON-NLS-1$
- // wantedCustomName.add("SysMLDefaultExplorerCustomization");
- }
-
- customizationManager.setShowDerivedLinks(true);
-
- try {
-
-
- final Collection<MetamodelView> wantedCustom = new ArrayList<MetamodelView>();
- for(final String current : wantedCustomName) {
- final MetamodelView custom = CustomizationsCatalog.getInstance().getCustomization(current);
- if(custom != null) {
- wantedCustom.add(custom);
- } else {
- Activator.log.warn(NLS.bind(Messages.LabelProviderUtil_CustomizationNotFound, current));
- }
- }
-
- // load customizations defined as default through the customization
- // extension
-
- for(final MetamodelView metamodelView : wantedCustom) {
- customizationManager.registerCustomization(metamodelView);
- }
- customizationManager.loadCustomizations();
- //TODO load the facets!
- // loadFacetsForCustomizations(registryDefaultCustomizations,customizationManager);
-
- } catch (final Throwable e) {
- Activator.log.error(e);
- }
- }
-}
|