Skip to main content
summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOlivier Constant2016-12-09 13:12:45 +0000
committerOlivier Constant2017-09-05 13:43:59 +0000
commit156da1e71262de58daebb955683f3894bda7e031 (patch)
tree9f6036da454aa11244b3cce7d08d3ba9d8768380 /tests
parent74a827c535c7a18b8eabb1ff3b412b0eefab0964 (diff)
downloadorg.eclipse.emf.diffmerge.core-156da1e71262de58daebb955683f3894bda7e031.tar.gz
org.eclipse.emf.diffmerge.core-156da1e71262de58daebb955683f3894bda7e031.tar.xz
org.eclipse.emf.diffmerge.core-156da1e71262de58daebb955683f3894bda7e031.zip
Bug 521872 - Extend relation data structures with memoization and recursive definitions
Change-Id: I2a340d34e56479506ce8e69b103f74bd094516e5 Signed-off-by: Olivier Constant <olivier.constant@thalesgroup.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.design/.classpath7
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.design/.project28
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.design/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.design/META-INF/MANIFEST.MF13
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.design/build.properties12
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.design/description/EGraphs.odesign46
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.design/plugin.properties9
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.design/plugin.xml16
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.design/src/org/eclipse/emf/diffmerge/structures/design/AbstractSiriusAction.java72
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.design/src/org/eclipse/emf/diffmerge/structures/design/ResetAction.java47
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.design/src/org/eclipse/emf/diffmerge/structures/design/StructuresDesignPlugin.java71
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.design/src/org/eclipse/emf/diffmerge/structures/design/TestAction.java123
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.edit/.classpath7
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.edit/.project28
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.edit/.settings/org.eclipse.jdt.core.prefs123
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.edit/META-INF/MANIFEST.MF15
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.edit/build.properties15
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.edit/icons/full/ctool16/CreateEGraph_contents_ENode.gifbin0 -> 223 bytes
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.edit/icons/full/ctool16/CreateENode_outgoing_EHyperEdge.gifbin0 -> 223 bytes
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.edit/icons/full/obj16/EGraph.gifbin0 -> 129 bytes
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.edit/icons/full/obj16/EHyperEdge.gifbin0 -> 129 bytes
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.edit/icons/full/obj16/ENode.gifbin0 -> 129 bytes
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.edit/plugin.properties35
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.edit/plugin.xml22
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.edit/src/org/eclipse/emf/diffmerge/structures/model/egraphs/provider/EGraphItemProvider.java176
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.edit/src/org/eclipse/emf/diffmerge/structures/model/egraphs/provider/EGraphsEditPlugin.java102
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.edit/src/org/eclipse/emf/diffmerge/structures/model/egraphs/provider/EGraphsItemProviderAdapterFactory.java259
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.edit/src/org/eclipse/emf/diffmerge/structures/model/egraphs/provider/EHyperEdgeItemProvider.java193
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.edit/src/org/eclipse/emf/diffmerge/structures/model/egraphs/provider/ENodeItemProvider.java234
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.editor/.classpath7
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.editor/.project28
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.editor/.settings/org.eclipse.jdt.core.prefs109
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.editor/META-INF/MANIFEST.MF18
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.editor/build.properties15
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.editor/icons/full/obj16/EGraphsModelFile.gifbin0 -> 346 bytes
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.editor/icons/full/wizban/NewEGraphs.gifbin0 -> 2462 bytes
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.editor/plugin.properties58
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.editor/plugin.xml37
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.editor/src/org/eclipse/emf/diffmerge/structures/model/egraphs/presentation/EGraphsActionBarContributor.java436
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.editor/src/org/eclipse/emf/diffmerge/structures/model/egraphs/presentation/EGraphsEditor.java1834
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.editor/src/org/eclipse/emf/diffmerge/structures/model/egraphs/presentation/EGraphsEditorPlugin.java104
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model.editor/src/org/eclipse/emf/diffmerge/structures/model/egraphs/presentation/EGraphsModelWizard.java641
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/.classpath7
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/.project28
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/.settings/org.eclipse.jdt.core.prefs104
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/META-INF/MANIFEST.MF18
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/build.properties10
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/model/EGraphs.ecore24
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/model/EGraphs.genmodel26
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/plugin.properties9
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/plugin.xml25
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/EGraph.java54
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/EGraphsFactory.java72
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/EGraphsPackage.java437
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/EHyperEdge.java112
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/ENode.java102
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/impl/EGraphImpl.java163
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/impl/EGraphsFactoryImpl.java129
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/impl/EGraphsPackageImpl.java298
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/impl/EHyperEdgeImpl.java320
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/impl/ENodeImpl.java286
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/util/EGraphsAdapterFactory.java168
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/util/EGraphsResourceFactoryImpl.java53
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/util/EGraphsResourceImpl.java40
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/util/EGraphsSwitch.java180
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/integration/EImpact.java60
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/integration/EImpactExploredSubset.java69
-rw-r--r--tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/integration/GraphQBinaryRelation.java472
68 files changed, 8213 insertions, 0 deletions
diff --git a/tests/org.eclipse.emf.diffmerge.structures.design/.classpath b/tests/org.eclipse.emf.diffmerge.structures.design/.classpath
new file mode 100644
index 00000000..098194ca
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.design/.classpath
@@ -0,0 +1,7 @@
+<?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/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/org.eclipse.emf.diffmerge.structures.design/.project b/tests/org.eclipse.emf.diffmerge.structures.design/.project
new file mode 100644
index 00000000..194f2993
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.design/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.diffmerge.structures.design</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/tests/org.eclipse.emf.diffmerge.structures.design/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.emf.diffmerge.structures.design/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..f42de363
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.design/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/tests/org.eclipse.emf.diffmerge.structures.design/META-INF/MANIFEST.MF b/tests/org.eclipse.emf.diffmerge.structures.design/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..1c7a21bd
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.design/META-INF/MANIFEST.MF
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.emf.diffmerge.structures.design;singleton:=true
+Bundle-Version: 0.9.0.qualifier
+Bundle-Vendor: %providerName
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.diffmerge.structures.model,
+ org.eclipse.sirius
+Bundle-ActivationPolicy: lazy
+Bundle-Activator: org.eclipse.emf.diffmerge.structures.design.StructuresDesignPlugin
+Export-Package: org.eclipse.emf.diffmerge.structures.design
diff --git a/tests/org.eclipse.emf.diffmerge.structures.design/build.properties b/tests/org.eclipse.emf.diffmerge.structures.design/build.properties
new file mode 100644
index 00000000..9ab8ef6b
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.design/build.properties
@@ -0,0 +1,12 @@
+###############################################################################
+# Copyright (c) 2017 Thales Global Services S.A.S.
+# 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
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/tests/org.eclipse.emf.diffmerge.structures.design/description/EGraphs.odesign b/tests/org.eclipse.emf.diffmerge.structures.design/description/EGraphs.odesign
new file mode 100644
index 00000000..d0d8d7a5
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.design/description/EGraphs.odesign
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<description:Group xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:tool="http://www.eclipse.org/sirius/description/tool/1.1.0" name="EGraphs" version="12.0.0.2017041100">
+ <ownedViewpoints name="egraphs" label="EGraphs">
+ <ownedRepresentations xsi:type="description_1:DiagramDescription" name="Graph" label="Graph" initialisation="true" showOnStartup="true" domainClass="egraphs.EGraph">
+ <metamodel href="http://www.eclipse.org/emf/diffmerge/structures/egraphs/1.0.0#/"/>
+ <defaultLayer name="Default">
+ <edgeMappings name="GraphEdge" synchronizationLock="true" sourceMapping="//@ownedViewpoints[name='egraphs']/@ownedRepresentations[name='Graph']/@defaultLayer/@containerMappings[name='GraphNode']" targetMapping="//@ownedViewpoints[name='egraphs']/@ownedRepresentations[name='Graph']/@defaultLayer/@containerMappings[name='GraphNode']" targetFinderExpression="feature:targets" sourceFinderExpression="feature:source" domainClass="egraphs.EHyperEdge" useDomainElement="true">
+ <style sizeComputationExpression="2">
+ <strokeColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='gray']"/>
+ <centerLabelStyleDescription labelExpression="feature:label">
+ <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
+ </centerLabelStyleDescription>
+ </style>
+ </edgeMappings>
+ <containerMappings name="GraphNode" synchronizationLock="true" domainClass="egraphs.ENode" childrenPresentation="List">
+ <style xsi:type="style:FlatContainerStyleDescription" borderSizeComputationExpression="1" labelExpression="feature:element">
+ <borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
+ <labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
+ <backgroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='white']"/>
+ <foregroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='light_gray']"/>
+ </style>
+ </containerMappings>
+ <toolSections name="Tools">
+ <ownedTools xsi:type="tool:ToolDescription" name="Test">
+ <element name="element"/>
+ <elementView name="elementView"/>
+ <initialOperation>
+ <firstModelOperations xsi:type="tool:ChangeContext" browseExpression="&lt;% element %>">
+ <subModelOperations xsi:type="tool:ExternalJavaAction" name="TestAction" id="org.eclipse.emf.diffmerge.structures.sirius.TestAction"/>
+ </firstModelOperations>
+ </initialOperation>
+ </ownedTools>
+ <ownedTools xsi:type="tool:ToolDescription" name="Reset">
+ <element name="element"/>
+ <elementView name="elementView"/>
+ <initialOperation>
+ <firstModelOperations xsi:type="tool:ChangeContext" browseExpression="&lt;% $element %>">
+ <subModelOperations xsi:type="tool:ExternalJavaAction" name="ResetAction" id="org.eclipse.emf.diffmerge.structures.sirius.ResetAction"/>
+ </firstModelOperations>
+ </initialOperation>
+ </ownedTools>
+ </toolSections>
+ </defaultLayer>
+ </ownedRepresentations>
+ </ownedViewpoints>
+</description:Group>
diff --git a/tests/org.eclipse.emf.diffmerge.structures.design/plugin.properties b/tests/org.eclipse.emf.diffmerge.structures.design/plugin.properties
new file mode 100644
index 00000000..bcca3cdc
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.design/plugin.properties
@@ -0,0 +1,9 @@
+###############################################################################
+# Copyright (c) 2017 Thales Global Services S.A.S.
+# 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
+###############################################################################
+pluginName = EMF Diff/Merge Structures Visualization Plug-In (Incubation)
+providerName = Eclipse Modeling Project
diff --git a/tests/org.eclipse.emf.diffmerge.structures.design/plugin.xml b/tests/org.eclipse.emf.diffmerge.structures.design/plugin.xml
new file mode 100644
index 00000000..96858307
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.design/plugin.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.sirius.externalJavaAction">
+ <javaActions
+ actionClass="org.eclipse.emf.diffmerge.structures.design.TestAction"
+ id="org.eclipse.emf.diffmerge.structures.sirius.TestAction">
+ </javaActions>
+ <javaActions
+ actionClass="org.eclipse.emf.diffmerge.structures.design.ResetAction"
+ id="org.eclipse.emf.diffmerge.structures.sirius.ResetAction">
+ </javaActions>
+ </extension>
+
+</plugin>
diff --git a/tests/org.eclipse.emf.diffmerge.structures.design/src/org/eclipse/emf/diffmerge/structures/design/AbstractSiriusAction.java b/tests/org.eclipse.emf.diffmerge.structures.design/src/org/eclipse/emf/diffmerge/structures/design/AbstractSiriusAction.java
new file mode 100644
index 00000000..7cae918e
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.design/src/org/eclipse/emf/diffmerge/structures/design/AbstractSiriusAction.java
@@ -0,0 +1,72 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.design;
+
+import java.util.Collection;
+
+import org.eclipse.emf.diffmerge.structures.impacts.CachingImpact;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EGraph;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.sirius.tools.api.ui.IExternalJavaAction;
+
+
+/**
+ * A base action for Sirius with an impact object.
+ *
+ * @author Olivier COnstant
+ */
+public abstract class AbstractSiriusAction implements IExternalJavaAction {
+
+ /** The initially null shared impact */
+ protected static CachingImpact IMPACT = null;
+
+
+ /**
+ * Constructor
+ */
+ public AbstractSiriusAction() {
+ // Nothing needed
+ }
+
+ /**
+ * @see org.eclipse.sirius.tools.api.ui.IExternalJavaAction#canExecute(java.util.Collection)
+ */
+ @Override
+ public boolean canExecute(Collection<? extends EObject> selections) {
+ return true;
+ }
+
+ /**
+ * Return the graph associated to the given selection, if any
+ * @param selection_p a potentially null collection
+ * @return a potentially null graph
+ */
+ protected EGraph getGraph(Collection<? extends EObject> selection_p) {
+ EGraph result = null;
+ if (selection_p != null && !selection_p.isEmpty()) {
+ Object first = selection_p.iterator().next();
+ if (first instanceof EGraph) {
+ result = (EGraph)first;
+ } else if (first instanceof EObject) {
+ EObject root = EcoreUtil.getRootContainer((EObject)first);
+ if (root instanceof EGraph)
+ result = (EGraph)root;
+ }
+ }
+ return result;
+ }
+
+}
diff --git a/tests/org.eclipse.emf.diffmerge.structures.design/src/org/eclipse/emf/diffmerge/structures/design/ResetAction.java b/tests/org.eclipse.emf.diffmerge.structures.design/src/org/eclipse/emf/diffmerge/structures/design/ResetAction.java
new file mode 100644
index 00000000..d8e83786
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.design/src/org/eclipse/emf/diffmerge/structures/design/ResetAction.java
@@ -0,0 +1,47 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.design;
+
+import java.util.Collection;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EObject;
+
+
+/**
+ * An action for resetting.
+ *
+ * @author Olivier COnstant
+ */
+public class ResetAction extends AbstractSiriusAction {
+
+ /**
+ * Constructor
+ */
+ public ResetAction() {
+ // Nothing needed
+ }
+
+ /**
+ * @see org.eclipse.sirius.tools.api.ui.IExternalJavaAction#execute(java.util.Collection, java.util.Map)
+ */
+ @Override
+ public void execute(Collection<? extends EObject> selection_p,
+ Map<String, Object> parameters_p) {
+ if (IMPACT != null)
+ IMPACT.resetExploration();
+ }
+
+}
diff --git a/tests/org.eclipse.emf.diffmerge.structures.design/src/org/eclipse/emf/diffmerge/structures/design/StructuresDesignPlugin.java b/tests/org.eclipse.emf.diffmerge.structures.design/src/org/eclipse/emf/diffmerge/structures/design/StructuresDesignPlugin.java
new file mode 100644
index 00000000..40c4d745
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.design/src/org/eclipse/emf/diffmerge/structures/design/StructuresDesignPlugin.java
@@ -0,0 +1,71 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.design;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+
+/**
+ * The activator class for this plug-in.
+ */
+public class StructuresDesignPlugin extends Plugin {
+
+ /** The shared instance */
+ private static StructuresDesignPlugin plugin;
+
+
+ /**
+ * Constructor.
+ */
+ public StructuresDesignPlugin() {
+ // Nothing
+ }
+
+ /**
+ * Return the shared instance of the activator.
+ * @return a non-null instance
+ */
+ public static StructuresDesignPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Return the ID of this plug-in according to MANIFEST.MF.
+ * @return a non-null string
+ */
+ public String getPluginId() {
+ return getBundle().getSymbolicName();
+ }
+
+ /**
+ * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /**
+ * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+}
diff --git a/tests/org.eclipse.emf.diffmerge.structures.design/src/org/eclipse/emf/diffmerge/structures/design/TestAction.java b/tests/org.eclipse.emf.diffmerge.structures.design/src/org/eclipse/emf/diffmerge/structures/design/TestAction.java
new file mode 100644
index 00000000..4470fac2
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.design/src/org/eclipse/emf/diffmerge/structures/design/TestAction.java
@@ -0,0 +1,123 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.design;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Map;
+
+import org.eclipse.emf.diffmerge.structures.IEqualityTester;
+import org.eclipse.emf.diffmerge.structures.binary.qualified.IRangedQBinaryRelation;
+import org.eclipse.emf.diffmerge.structures.endo.qualified.IRangedQEndorelation;
+import org.eclipse.emf.diffmerge.structures.impacts.IImpactRule;
+import org.eclipse.emf.diffmerge.structures.impacts.ImpactRule;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EGraph;
+import org.eclipse.emf.diffmerge.structures.model.integration.EImpact;
+import org.eclipse.emf.diffmerge.structures.model.integration.EImpactExploredSubset;
+import org.eclipse.emf.diffmerge.structures.model.integration.GraphQBinaryRelation;
+import org.eclipse.emf.ecore.EObject;
+
+
+/**
+ * An action for testing.
+ *
+ * @author Olivier COnstant
+ */
+public class TestAction extends AbstractSiriusAction {
+
+ /**
+ * Constructor
+ */
+ public TestAction() {
+ // Nothing needed
+ }
+
+ /**
+ * @see org.eclipse.sirius.tools.api.ui.IExternalJavaAction#execute(java.util.Collection, java.util.Map)
+ */
+ @Override
+ public void execute(Collection<? extends EObject> selection_p,
+ Map<String, Object> parameters_p) {
+ EGraph graph = getGraph(selection_p);
+ checkImpact(graph);
+ IMPACT.exploreNext(2l);
+ }
+
+ /**
+ * Check that the shared impact is correctly initialized
+ * @param graph_p a potentially null graph
+ */
+ protected void checkImpact(final EGraph graph_p) {
+ // Declarations
+ final Collection<?> origins = getOrigins();
+ final Collection<IImpactRule> rules = getRules();
+ // Initialization
+ if (graph_p != null) {
+ if (IMPACT == null) {
+ IMPACT = new EImpact(origins, rules, IEqualityTester.BY_EQUALS) {
+ @Override
+ protected IRangedQEndorelation.Editable<Object, IImpactRule> newExploredSubset() {
+ return new EImpactExploredSubset(defaultQualifier(), getEqualityTester()) {
+ @Override
+ protected IRangedQBinaryRelation.Editable<Object, Object, IImpactRule> newContents(
+ IEqualityTester tester_p) {
+ return new GraphQBinaryRelation<Object, Object, IImpactRule>(graph_p, tester_p);
+ }
+ };
+ }
+ };
+ }
+ }
+ }
+
+ /**
+ * Return the set of origin elements
+ * @return a non-nul, potentially empty set
+ */
+ protected Collection<String> getOrigins() {
+ return Arrays.asList(
+ "1", "3"); //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ /**
+ * Return the set of rules for this impact
+ * @return a non-null, potentially empty set
+ */
+ protected Collection<IImpactRule> getRules() {
+ return Arrays.<IImpactRule>asList(
+ new ImpactRule("+3", IEqualityTester.BY_EQUALS) { //$NON-NLS-1$
+ /**
+ * @see org.eclipse.emf.diffmerge.structures.binary.IBinaryRelation#get(java.lang.Object)
+ */
+ public Collection<Object> get(Object element_p) {
+ int sourceElement = Integer.parseInt(element_p.toString());
+ int targetElement = sourceElement + 3;
+ return Arrays.<Object>asList(Integer.valueOf(targetElement).toString());
+ }
+ },
+ new ImpactRule("+4", IEqualityTester.BY_EQUALS) { //$NON-NLS-1$
+ /**
+ * @see org.eclipse.emf.diffmerge.structures.binary.IBinaryRelation#get(java.lang.Object)
+ */
+ public Collection<Object> get(Object element_p) {
+ int sourceElement = Integer.parseInt(element_p.toString());
+ int targetElement = sourceElement + 4;
+ return Arrays.<Object>asList(Integer.valueOf(targetElement).toString());
+ }
+ }
+ );
+ }
+
+}
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.edit/.classpath b/tests/org.eclipse.emf.diffmerge.structures.model.edit/.classpath
new file mode 100644
index 00000000..472ee29b
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.edit/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.edit/.project b/tests/org.eclipse.emf.diffmerge.structures.model.edit/.project
new file mode 100644
index 00000000..d0bf8a8b
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.edit/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.diffmerge.structures.model.edit</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.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.edit/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.emf.diffmerge.structures.model.edit/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..bd1f04df
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.edit/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,123 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+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.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=private
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=disabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=ignore
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.edit/META-INF/MANIFEST.MF b/tests/org.eclipse.emf.diffmerge.structures.model.edit/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..0405a757
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.edit/META-INF/MANIFEST.MF
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.emf.diffmerge.structures.model.edit;singleton:=true
+Bundle-Version: 0.9.0.qualifier
+Bundle-ClassPath: .
+Bundle-Activator: org.eclipse.emf.diffmerge.structures.model.egraphs.provider.EGraphsEditPlugin$Implementation
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.emf.diffmerge.structures.model.egraphs.provider
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.diffmerge.structures.model;visibility:=reexport,
+ org.eclipse.emf.edit;visibility:=reexport
+Bundle-ActivationPolicy: lazy
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.edit/build.properties b/tests/org.eclipse.emf.diffmerge.structures.model.edit/build.properties
new file mode 100644
index 00000000..3fa16232
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.edit/build.properties
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2017 Thales Global Services S.A.S.
+# 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
+###############################################################################
+bin.includes = .,\
+ icons/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties
+jars.compile.order = .
+source.. = src/
+output.. = bin/
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.edit/icons/full/ctool16/CreateEGraph_contents_ENode.gif b/tests/org.eclipse.emf.diffmerge.structures.model.edit/icons/full/ctool16/CreateEGraph_contents_ENode.gif
new file mode 100644
index 00000000..4e2915ee
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.edit/icons/full/ctool16/CreateEGraph_contents_ENode.gif
Binary files differ
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.edit/icons/full/ctool16/CreateENode_outgoing_EHyperEdge.gif b/tests/org.eclipse.emf.diffmerge.structures.model.edit/icons/full/ctool16/CreateENode_outgoing_EHyperEdge.gif
new file mode 100644
index 00000000..56138f04
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.edit/icons/full/ctool16/CreateENode_outgoing_EHyperEdge.gif
Binary files differ
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.edit/icons/full/obj16/EGraph.gif b/tests/org.eclipse.emf.diffmerge.structures.model.edit/icons/full/obj16/EGraph.gif
new file mode 100644
index 00000000..db7414e9
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.edit/icons/full/obj16/EGraph.gif
Binary files differ
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.edit/icons/full/obj16/EHyperEdge.gif b/tests/org.eclipse.emf.diffmerge.structures.model.edit/icons/full/obj16/EHyperEdge.gif
new file mode 100644
index 00000000..33a997a1
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.edit/icons/full/obj16/EHyperEdge.gif
Binary files differ
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.edit/icons/full/obj16/ENode.gif b/tests/org.eclipse.emf.diffmerge.structures.model.edit/icons/full/obj16/ENode.gif
new file mode 100644
index 00000000..c8d381f0
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.edit/icons/full/obj16/ENode.gif
Binary files differ
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.edit/plugin.properties b/tests/org.eclipse.emf.diffmerge.structures.model.edit/plugin.properties
new file mode 100644
index 00000000..ac0291ee
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.edit/plugin.properties
@@ -0,0 +1,35 @@
+###############################################################################
+# Copyright (c) 2017 Thales Global Services S.A.S.
+# 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
+###############################################################################
+pluginName = EMF Diff/Merge Structures Model Edit Plug-In (Incubation)
+providerName = Eclipse Modeling Project
+
+_UI_CreateChild_text = {0}
+_UI_CreateChild_text2 = {1} {0}
+_UI_CreateChild_text3 = {1}
+_UI_CreateChild_tooltip = Create New {0} Under {1} Feature
+_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}.
+_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent.
+
+_UI_PropertyDescriptor_description = The {0} of the {1}
+
+_UI_EGraph_type = EGraph
+_UI_ENode_type = ENode
+_UI_EHyperEdge_type = EHyper Edge
+_UI_Unknown_type = Object
+
+_UI_Unknown_datatype= Value
+
+_UI_EGraph_contents_feature = Contents
+_UI_ENode_element_feature = Element
+_UI_ENode_outgoing_feature = Outgoing
+_UI_ENode_incoming_feature = Incoming
+_UI_EHyperEdge_label_feature = Label
+_UI_EHyperEdge_source_feature = Source
+_UI_EHyperEdge_targets_feature = Targets
+_UI_Unknown_feature = Unspecified
+
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.edit/plugin.xml b/tests/org.eclipse.emf.diffmerge.structures.model.edit/plugin.xml
new file mode 100644
index 00000000..5aed9c24
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.edit/plugin.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
+ <!-- @generated EGraphs -->
+ <factory
+ uri="http://www.eclipse.org/emf/diffmerge/structures/egraphs/1.0.0"
+ class="org.eclipse.emf.diffmerge.structures.model.egraphs.provider.EGraphsItemProviderAdapterFactory"
+ supportedTypes=
+ "org.eclipse.emf.edit.provider.IEditingDomainItemProvider
+ org.eclipse.emf.edit.provider.IStructuredItemContentProvider
+ org.eclipse.emf.edit.provider.ITreeItemContentProvider
+ org.eclipse.emf.edit.provider.IItemLabelProvider
+ org.eclipse.emf.edit.provider.IItemPropertySource"/>
+ </extension>
+
+</plugin>
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.edit/src/org/eclipse/emf/diffmerge/structures/model/egraphs/provider/EGraphItemProvider.java b/tests/org.eclipse.emf.diffmerge.structures.model.edit/src/org/eclipse/emf/diffmerge/structures/model/egraphs/provider/EGraphItemProvider.java
new file mode 100644
index 00000000..28baeb9a
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.edit/src/org/eclipse/emf/diffmerge/structures/model/egraphs/provider/EGraphItemProvider.java
@@ -0,0 +1,176 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EGraph;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsFactory;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.emf.diffmerge.structures.model.egraphs.EGraph} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class EGraphItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EGraphItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(EGraphsPackage.Literals.EGRAPH__CONTENTS);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns EGraph.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/EGraph")); //$NON-NLS-1$
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ return getString("_UI_EGraph_type"); //$NON-NLS-1$
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(EGraph.class)) {
+ case EGraphsPackage.EGRAPH__CONTENTS:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add
+ (createChildParameter
+ (EGraphsPackage.Literals.EGRAPH__CONTENTS,
+ EGraphsFactory.eINSTANCE.createENode()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return EGraphsEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.edit/src/org/eclipse/emf/diffmerge/structures/model/egraphs/provider/EGraphsEditPlugin.java b/tests/org.eclipse.emf.diffmerge.structures.model.edit/src/org/eclipse/emf/diffmerge/structures/model/egraphs/provider/EGraphsEditPlugin.java
new file mode 100644
index 00000000..edb3c81f
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.edit/src/org/eclipse/emf/diffmerge/structures/model/egraphs/provider/EGraphsEditPlugin.java
@@ -0,0 +1,102 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs.provider;
+
+import org.eclipse.emf.common.EMFPlugin;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+/**
+ * This is the central singleton for the EGraphs edit plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public final class EGraphsEditPlugin extends EMFPlugin {
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EGraphsEditPlugin INSTANCE = new EGraphsEditPlugin();
+
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static Implementation plugin;
+
+ /**
+ * Create the instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EGraphsEditPlugin() {
+ super
+ (new ResourceLocator [] {
+ });
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ @Override
+ public ResourceLocator getPluginResourceLocator() {
+ return plugin;
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ public static Implementation getPlugin() {
+ return plugin;
+ }
+
+ /**
+ * The actual implementation of the Eclipse <b>Plugin</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static class Implementation extends EclipsePlugin {
+ /**
+ * Creates an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("synthetic-access")
+ public Implementation() {
+ super();
+
+ // Remember the static instance.
+ //
+ plugin = this;
+ }
+ }
+
+}
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.edit/src/org/eclipse/emf/diffmerge/structures/model/egraphs/provider/EGraphsItemProviderAdapterFactory.java b/tests/org.eclipse.emf.diffmerge.structures.model.edit/src/org/eclipse/emf/diffmerge/structures/model/egraphs/provider/EGraphsItemProviderAdapterFactory.java
new file mode 100644
index 00000000..fb281650
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.edit/src/org/eclipse/emf/diffmerge/structures/model/egraphs/provider/EGraphsItemProviderAdapterFactory.java
@@ -0,0 +1,259 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs.provider;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.diffmerge.structures.model.egraphs.util.EGraphsAdapterFactory;
+
+import org.eclipse.emf.edit.provider.ChangeNotifier;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IChangeNotifier;
+import org.eclipse.emf.edit.provider.IDisposable;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+
+/**
+ * This is the factory that is used to provide the interfaces needed to support Viewers.
+ * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}.
+ * The adapters also support Eclipse property sheets.
+ * Note that most of the adapters are shared among multiple instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class EGraphsItemProviderAdapterFactory extends EGraphsAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable {
+ /**
+ * This keeps track of the root adapter factory that delegates to this adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ComposedAdapterFactory parentAdapterFactory;
+
+ /**
+ * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IChangeNotifier changeNotifier = new ChangeNotifier();
+
+ /**
+ * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Object> supportedTypes = new ArrayList<Object>();
+
+ /**
+ * This constructs an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EGraphsItemProviderAdapterFactory() {
+ supportedTypes.add(IEditingDomainItemProvider.class);
+ supportedTypes.add(IStructuredItemContentProvider.class);
+ supportedTypes.add(ITreeItemContentProvider.class);
+ supportedTypes.add(IItemLabelProvider.class);
+ supportedTypes.add(IItemPropertySource.class);
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.emf.diffmerge.structures.model.egraphs.EGraph} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EGraphItemProvider eGraphItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.emf.diffmerge.structures.model.egraphs.EGraph}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createEGraphAdapter() {
+ if (eGraphItemProvider == null) {
+ eGraphItemProvider = new EGraphItemProvider(this);
+ }
+
+ return eGraphItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.emf.diffmerge.structures.model.egraphs.ENode} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ENodeItemProvider eNodeItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.emf.diffmerge.structures.model.egraphs.ENode}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createENodeAdapter() {
+ if (eNodeItemProvider == null) {
+ eNodeItemProvider = new ENodeItemProvider(this);
+ }
+
+ return eNodeItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EHyperEdgeItemProvider eHyperEdgeItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createEHyperEdgeAdapter() {
+ if (eHyperEdgeItemProvider == null) {
+ eHyperEdgeItemProvider = new EHyperEdgeItemProvider(this);
+ }
+
+ return eHyperEdgeItemProvider;
+ }
+
+ /**
+ * This returns the root adapter factory that contains this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ComposeableAdapterFactory getRootAdapterFactory() {
+ return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory();
+ }
+
+ /**
+ * This sets the composed adapter factory that contains this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) {
+ this.parentAdapterFactory = parentAdapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object type) {
+ return supportedTypes.contains(type) || super.isFactoryForType(type);
+ }
+
+ /**
+ * This implementation substitutes the factory itself as the key for the adapter.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter adapt(Notifier notifier, Object type) {
+ return super.adapt(notifier, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object adapt(Object object, Object type) {
+ if (isFactoryForType(type)) {
+ Object adapter = super.adapt(object, type);
+ if (!(type instanceof Class<?>) || (((Class<?>)type).isInstance(adapter))) {
+ return adapter;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * This adds a listener.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void addListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.addListener(notifyChangedListener);
+ }
+
+ /**
+ * This removes a listener.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void removeListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.removeListener(notifyChangedListener);
+ }
+
+ /**
+ * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void fireNotifyChanged(Notification notification) {
+ changeNotifier.fireNotifyChanged(notification);
+
+ if (parentAdapterFactory != null) {
+ parentAdapterFactory.fireNotifyChanged(notification);
+ }
+ }
+
+ /**
+ * This disposes all of the item providers created by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void dispose() {
+ if (eGraphItemProvider != null) eGraphItemProvider.dispose();
+ if (eNodeItemProvider != null) eNodeItemProvider.dispose();
+ if (eHyperEdgeItemProvider != null) eHyperEdgeItemProvider.dispose();
+ }
+
+}
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.edit/src/org/eclipse/emf/diffmerge/structures/model/egraphs/provider/EHyperEdgeItemProvider.java b/tests/org.eclipse.emf.diffmerge.structures.model.edit/src/org/eclipse/emf/diffmerge/structures/model/egraphs/provider/EHyperEdgeItemProvider.java
new file mode 100644
index 00000000..7a354f9e
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.edit/src/org/eclipse/emf/diffmerge/structures/model/egraphs/provider/EHyperEdgeItemProvider.java
@@ -0,0 +1,193 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class EHyperEdgeItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EHyperEdgeItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addLabelPropertyDescriptor(object);
+ addTargetsPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Label feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addLabelPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_EHyperEdge_label_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_EHyperEdge_label_feature", "_UI_EHyperEdge_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ EGraphsPackage.Literals.EHYPER_EDGE__LABEL,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Targets feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addTargetsPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_EHyperEdge_targets_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_EHyperEdge_targets_feature", "_UI_EHyperEdge_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ EGraphsPackage.Literals.EHYPER_EDGE__TARGETS,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This returns EHyperEdge.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/EHyperEdge")); //$NON-NLS-1$
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((EHyperEdge)object).getLabel();
+ return label == null || label.length() == 0 ?
+ getString("_UI_EHyperEdge_type") : //$NON-NLS-1$
+ getString("_UI_EHyperEdge_type") + " " + label; //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(EHyperEdge.class)) {
+ case EGraphsPackage.EHYPER_EDGE__LABEL:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return EGraphsEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.edit/src/org/eclipse/emf/diffmerge/structures/model/egraphs/provider/ENodeItemProvider.java b/tests/org.eclipse.emf.diffmerge.structures.model.edit/src/org/eclipse/emf/diffmerge/structures/model/egraphs/provider/ENodeItemProvider.java
new file mode 100644
index 00000000..e3ee1cec
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.edit/src/org/eclipse/emf/diffmerge/structures/model/egraphs/provider/ENodeItemProvider.java
@@ -0,0 +1,234 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsFactory;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.ENode;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.emf.diffmerge.structures.model.egraphs.ENode} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class ENodeItemProvider
+ extends ItemProviderAdapter
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ENodeItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addElementPropertyDescriptor(object);
+ addIncomingPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Element feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addElementPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_ENode_element_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_ENode_element_feature", "_UI_ENode_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ EGraphsPackage.Literals.ENODE__ELEMENT,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Incoming feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addIncomingPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_ENode_incoming_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_ENode_incoming_feature", "_UI_ENode_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ EGraphsPackage.Literals.ENODE__INCOMING,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
+ if (childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ childrenFeatures.add(EGraphsPackage.Literals.ENODE__OUTGOING);
+ }
+ return childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(Object object, Object child) {
+ // Check the type of the specified child object and return the proper feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns ENode.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/ENode")); //$NON-NLS-1$
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((ENode)object).getElement();
+ return label == null || label.length() == 0 ?
+ getString("_UI_ENode_type") : //$NON-NLS-1$
+ getString("_UI_ENode_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(ENode.class)) {
+ case EGraphsPackage.ENODE__ELEMENT:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ case EGraphsPackage.ENODE__OUTGOING:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add
+ (createChildParameter
+ (EGraphsPackage.Literals.ENODE__OUTGOING,
+ EGraphsFactory.eINSTANCE.createEHyperEdge()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return EGraphsEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.editor/.classpath b/tests/org.eclipse.emf.diffmerge.structures.model.editor/.classpath
new file mode 100644
index 00000000..472ee29b
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.editor/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.editor/.project b/tests/org.eclipse.emf.diffmerge.structures.model.editor/.project
new file mode 100644
index 00000000..82ef4a92
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.editor/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.diffmerge.structures.model.editor</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.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.editor/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.emf.diffmerge.structures.model.editor/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..4e810947
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.editor/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,109 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+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.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=disabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.editor/META-INF/MANIFEST.MF b/tests/org.eclipse.emf.diffmerge.structures.model.editor/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..7204421b
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.editor/META-INF/MANIFEST.MF
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.emf.diffmerge.structures.model.editor;singleton:=true
+Bundle-Version: 0.9.0.qualifier
+Bundle-ClassPath: .
+Bundle-Activator: org.eclipse.emf.diffmerge.structures.model.egraphs.presentation.EGraphsEditorPlugin$Implementation
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.emf.diffmerge.structures.model.egraphs.presentation
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources;visibility:=reexport,
+ org.eclipse.emf.diffmerge.structures.model.edit;visibility:=reexport,
+ org.eclipse.emf.ecore.xmi;visibility:=reexport,
+ org.eclipse.emf.edit.ui;visibility:=reexport,
+ org.eclipse.ui.ide;visibility:=reexport
+Bundle-ActivationPolicy: lazy
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.editor/build.properties b/tests/org.eclipse.emf.diffmerge.structures.model.editor/build.properties
new file mode 100644
index 00000000..06ae63dc
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.editor/build.properties
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2017 Thales Global Services S.A.S.
+# 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
+###############################################################################
+bin.includes = .,\
+ icons/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties
+jars.compile.order = .
+source.. = src/
+output.. = bin
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.editor/icons/full/obj16/EGraphsModelFile.gif b/tests/org.eclipse.emf.diffmerge.structures.model.editor/icons/full/obj16/EGraphsModelFile.gif
new file mode 100644
index 00000000..4ef24bd3
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.editor/icons/full/obj16/EGraphsModelFile.gif
Binary files differ
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.editor/icons/full/wizban/NewEGraphs.gif b/tests/org.eclipse.emf.diffmerge.structures.model.editor/icons/full/wizban/NewEGraphs.gif
new file mode 100644
index 00000000..440f3695
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.editor/icons/full/wizban/NewEGraphs.gif
Binary files differ
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.editor/plugin.properties b/tests/org.eclipse.emf.diffmerge.structures.model.editor/plugin.properties
new file mode 100644
index 00000000..9449a84c
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.editor/plugin.properties
@@ -0,0 +1,58 @@
+###############################################################################
+# Copyright (c) 2017 Thales Global Services S.A.S.
+# 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
+###############################################################################
+pluginName = EMF Diff/Merge Structures Model Editor Plug-In (Incubation)
+providerName = Eclipse Modeling Project
+
+_UI_EGraphsEditor_menu = &EGraphs Editor
+
+_UI_CreateChild_menu_item = &New Child
+_UI_CreateSibling_menu_item = N&ew Sibling
+
+_UI_ShowPropertiesView_menu_item = Show &Properties View
+_UI_RefreshViewer_menu_item = &Refresh
+
+_UI_SelectionPage_label = Selection
+_UI_ParentPage_label = Parent
+_UI_ListPage_label = List
+_UI_TreePage_label = Tree
+_UI_TablePage_label = Table
+_UI_TreeWithColumnsPage_label = Tree with Columns
+_UI_ObjectColumn_label = Object
+_UI_SelfColumn_label = Self
+
+_UI_NoObjectSelected = Selected Nothing
+_UI_SingleObjectSelected = Selected Object: {0}
+_UI_MultiObjectSelected = Selected {0} Objects
+
+_UI_OpenEditorError_label = Open Editor
+
+_UI_Wizard_category = Example EMF Model Creation Wizards
+
+_UI_CreateModelError_message = Problems encountered in file "{0}"
+
+_UI_EGraphsModelWizard_label = EGraphs Model
+_UI_EGraphsModelWizard_description = Create a new EGraphs model
+
+_UI_EGraphsEditor_label = EGraphs Model Editor
+
+_UI_EGraphsEditorFilenameDefaultBase = My
+_UI_EGraphsEditorFilenameExtensions = egraphs
+
+_UI_Wizard_label = New
+
+_WARN_FilenameExtension = The file name must end in ''.{0}''
+_WARN_FilenameExtensions = The file name must have one of the following extensions: {0}
+
+_UI_ModelObject = &Model Object
+_UI_XMLEncoding = &XML Encoding
+_UI_XMLEncodingChoices = UTF-8 ASCII UTF-16 UTF-16BE UTF-16LE ISO-8859-1
+_UI_Wizard_initial_object_description = Select a model object to create
+
+_UI_FileConflict_label = File Conflict
+_WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes?
+
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.editor/plugin.xml b/tests/org.eclipse.emf.diffmerge.structures.model.editor/plugin.xml
new file mode 100644
index 00000000..48ce865e
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.editor/plugin.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.ui.newWizards">
+ <!-- @generated EGraphs -->
+ <category
+ id="org.eclipse.emf.ecore.Wizard.category.ID"
+ name="%_UI_Wizard_category"/>
+ <wizard
+ id="org.eclipse.emf.diffmerge.structures.model.egraphs.presentation.EGraphsModelWizardID"
+ name="%_UI_EGraphsModelWizard_label"
+ class="org.eclipse.emf.diffmerge.structures.model.egraphs.presentation.EGraphsModelWizard"
+ category="org.eclipse.emf.ecore.Wizard.category.ID"
+ icon="icons/full/obj16/EGraphsModelFile.gif">
+ <description>%_UI_EGraphsModelWizard_description</description>
+ <selection class="org.eclipse.core.resources.IResource"/>
+ </wizard>
+ </extension>
+
+ <extension point="org.eclipse.ui.editors">
+ <!-- @generated EGraphs -->
+ <editor
+ id="org.eclipse.emf.diffmerge.structures.model.egraphs.presentation.EGraphsEditorID"
+ name="%_UI_EGraphsEditor_label"
+ icon="icons/full/obj16/EGraphsModelFile.gif"
+ extensions="egraphs"
+ class="org.eclipse.emf.diffmerge.structures.model.egraphs.presentation.EGraphsEditor"
+ contributorClass="org.eclipse.emf.diffmerge.structures.model.egraphs.presentation.EGraphsActionBarContributor">
+ </editor>
+ </extension>
+
+</plugin>
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.editor/src/org/eclipse/emf/diffmerge/structures/model/egraphs/presentation/EGraphsActionBarContributor.java b/tests/org.eclipse.emf.diffmerge.structures.model.editor/src/org/eclipse/emf/diffmerge/structures/model/egraphs/presentation/EGraphsActionBarContributor.java
new file mode 100644
index 00000000..fda90550
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.editor/src/org/eclipse/emf/diffmerge/structures/model/egraphs/presentation/EGraphsActionBarContributor.java
@@ -0,0 +1,436 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs.presentation;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+
+import org.eclipse.emf.edit.ui.action.ControlAction;
+import org.eclipse.emf.edit.ui.action.CreateChildAction;
+import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+import org.eclipse.emf.edit.ui.action.LoadResourceAction;
+import org.eclipse.emf.edit.ui.action.ValidateAction;
+
+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.IContributionManager;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.SubContributionItem;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * This is the action bar contributor for the EGraphs model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+@SuppressWarnings("nls")
+public class EGraphsActionBarContributor
+ extends EditingDomainActionBarContributor
+ implements ISelectionChangedListener {
+ /**
+ * This keeps track of the active editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IEditorPart activeEditorPart;
+
+ /**
+ * This keeps track of the current selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionProvider selectionProvider;
+
+ /**
+ * This action opens the Properties view.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction showPropertiesViewAction =
+ new Action(EGraphsEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) {
+ @Override
+ public void run() {
+ try {
+ getPage().showView("org.eclipse.ui.views.PropertySheet");
+ }
+ catch (PartInitException exception) {
+ EGraphsEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * This action refreshes the viewer of the current editor if the editor
+ * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction refreshViewerAction =
+ new Action(EGraphsEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) {
+ @Override
+ public boolean isEnabled() {
+ return activeEditorPart instanceof IViewerProvider;
+ }
+
+ @Override
+ public void run() {
+ if (activeEditorPart instanceof IViewerProvider) {
+ Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer();
+ if (viewer != null) {
+ viewer.refresh();
+ }
+ }
+ }
+ };
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createChildActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateChild actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createChildMenuManager;
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createSiblingActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateSibling actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createSiblingMenuManager;
+
+ /**
+ * This creates an instance of the contributor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EGraphsActionBarContributor() {
+ super(ADDITIONS_LAST_STYLE);
+ loadResourceAction = new LoadResourceAction();
+ validateAction = new ValidateAction();
+ controlAction = new ControlAction();
+ }
+
+ /**
+ * This adds Separators for editor additions to the tool bar.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToToolBar(IToolBarManager toolBarManager) {
+ toolBarManager.add(new Separator("egraphs-settings"));
+ toolBarManager.add(new Separator("egraphs-additions"));
+ }
+
+ /**
+ * This adds to the menu bar a menu and some separators for editor additions,
+ * as well as the sub-menus for object creation items.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToMenu(IMenuManager menuManager) {
+ super.contributeToMenu(menuManager);
+
+ IMenuManager submenuManager = new MenuManager(EGraphsEditorPlugin.INSTANCE.getString("_UI_EGraphsEditor_menu"), "org.eclipse.emf.diffmerge.structures.model.egraphsMenuID");
+ menuManager.insertAfter("additions", submenuManager);
+ submenuManager.add(new Separator("settings"));
+ submenuManager.add(new Separator("actions"));
+ submenuManager.add(new Separator("additions"));
+ submenuManager.add(new Separator("additions-end"));
+
+ // Prepare for CreateChild item addition or removal.
+ //
+ createChildMenuManager = new MenuManager(EGraphsEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ submenuManager.insertBefore("additions", createChildMenuManager);
+
+ // Prepare for CreateSibling item addition or removal.
+ //
+ createSiblingMenuManager = new MenuManager(EGraphsEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ submenuManager.insertBefore("additions", createSiblingMenuManager);
+
+ // Force an update because Eclipse hides empty menus now.
+ //
+ submenuManager.addMenuListener
+ (new IMenuListener() {
+ public void menuAboutToShow(IMenuManager menuManager) {
+ menuManager.updateAll(true);
+ }
+ });
+
+ addGlobalActions(submenuManager);
+ }
+
+ /**
+ * When the active editor changes, this remembers the change and registers with it as a selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setActiveEditor(IEditorPart part) {
+ super.setActiveEditor(part);
+ activeEditorPart = part;
+
+ // Switch to the new selection provider.
+ //
+ if (selectionProvider != null) {
+ selectionProvider.removeSelectionChangedListener(this);
+ }
+ if (part == null) {
+ selectionProvider = null;
+ }
+ else {
+ selectionProvider = part.getSite().getSelectionProvider();
+ selectionProvider.addSelectionChangedListener(this);
+
+ // Fake a selection changed event to update the menus.
+ //
+ if (selectionProvider.getSelection() != null) {
+ selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection()));
+ }
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
+ * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
+ * that can be added to the selected object and updating the menus accordingly.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ // Remove any menu items for old selection.
+ //
+ if (createChildMenuManager != null) {
+ depopulateManager(createChildMenuManager, createChildActions);
+ }
+ if (createSiblingMenuManager != null) {
+ depopulateManager(createSiblingMenuManager, createSiblingActions);
+ }
+
+ // Query the new selection for appropriate new child/sibling descriptors
+ //
+ Collection<?> newChildDescriptors = null;
+ Collection<?> newSiblingDescriptors = null;
+
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) {
+ Object object = ((IStructuredSelection)selection).getFirstElement();
+
+ EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain();
+
+ newChildDescriptors = domain.getNewChildDescriptors(object, null);
+ newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
+ }
+
+ // Generate actions for selection; populate and redraw the menus.
+ //
+ createChildActions = generateCreateChildActions(newChildDescriptors, selection);
+ createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);
+
+ if (createChildMenuManager != null) {
+ populateManager(createChildMenuManager, createChildActions, null);
+ createChildMenuManager.update(true);
+ }
+ if (createSiblingMenuManager != null) {
+ populateManager(createSiblingMenuManager, createSiblingActions, null);
+ createSiblingMenuManager.update(true);
+ }
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateChildAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
+ * by inserting them before the specified contribution item <code>contributionID</code>.
+ * If <code>contributionID</code> is <code>null</code>, they are simply added.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
+ if (actions != null) {
+ for (IAction action : actions) {
+ if (contributionID != null) {
+ manager.insertBefore(contributionID, action);
+ }
+ else {
+ manager.add(action);
+ }
+ }
+ }
+ }
+
+ /**
+ * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
+ if (actions != null) {
+ IContributionItem[] items = manager.getItems();
+ for (int i = 0; i < items.length; i++) {
+ // Look into SubContributionItems
+ //
+ IContributionItem contributionItem = items[i];
+ while (contributionItem instanceof SubContributionItem) {
+ contributionItem = ((SubContributionItem)contributionItem).getInnerItem();
+ }
+
+ // Delete the ActionContributionItems with matching action.
+ //
+ if (contributionItem instanceof ActionContributionItem) {
+ IAction action = ((ActionContributionItem)contributionItem).getAction();
+ if (actions.contains(action)) {
+ manager.remove(contributionItem);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This populates the pop-up menu before it appears.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void menuAboutToShow(IMenuManager menuManager) {
+ super.menuAboutToShow(menuManager);
+ MenuManager submenuManager = null;
+
+ submenuManager = new MenuManager(EGraphsEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
+ populateManager(submenuManager, createChildActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+
+ submenuManager = new MenuManager(EGraphsEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
+ populateManager(submenuManager, createSiblingActions, null);
+ menuManager.insertBefore("edit", submenuManager);
+ }
+
+ /**
+ * This inserts global actions before the "additions-end" separator.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void addGlobalActions(IMenuManager menuManager) {
+ menuManager.insertAfter("additions-end", new Separator("ui-actions"));
+ menuManager.insertAfter("ui-actions", showPropertiesViewAction);
+
+ refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
+ menuManager.insertAfter("ui-actions", refreshViewerAction);
+
+ super.addGlobalActions(menuManager);
+ }
+
+ /**
+ * This ensures that a delete action will clean up all references to deleted objects.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean removeAllReferencesOnDelete() {
+ return true;
+ }
+
+}
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.editor/src/org/eclipse/emf/diffmerge/structures/model/egraphs/presentation/EGraphsEditor.java b/tests/org.eclipse.emf.diffmerge.structures.model.editor/src/org/eclipse/emf/diffmerge/structures/model/egraphs/presentation/EGraphsEditor.java
new file mode 100644
index 00000000..3b5b7751
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.editor/src/org/eclipse/emf/diffmerge/structures/model/egraphs/presentation/EGraphsEditor.java
@@ -0,0 +1,1834 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs.presentation;
+
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EventObject;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.custom.CTabFolder;
+
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.Transfer;
+
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+
+import org.eclipse.swt.graphics.Point;
+
+import org.eclipse.swt.layout.FillLayout;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+
+import org.eclipse.ui.dialogs.SaveAsDialog;
+
+import org.eclipse.ui.ide.IGotoMarker;
+
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.MultiPageEditorPart;
+
+import org.eclipse.ui.views.contentoutline.ContentOutline;
+import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.PropertySheet;
+import org.eclipse.ui.views.properties.PropertySheetPage;
+
+import org.eclipse.emf.common.command.BasicCommandStack;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CommandStack;
+import org.eclipse.emf.common.command.CommandStackListener;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.ui.MarkerHelper;
+import org.eclipse.emf.common.ui.ViewerPane;
+
+import org.eclipse.emf.common.ui.editor.ProblemEditorPart;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.URI;
+
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.ecore.util.EContentAdapter;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+
+import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+
+import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+
+import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor;
+
+import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;
+import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
+import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;
+
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;
+
+import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper;
+import org.eclipse.emf.edit.ui.util.EditUIUtil;
+
+import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;
+
+import org.eclipse.emf.diffmerge.structures.model.egraphs.provider.EGraphsItemProviderAdapterFactory;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+
+/**
+ * This is an example of a EGraphs model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+@SuppressWarnings("nls")
+public class EGraphsEditor
+ extends MultiPageEditorPart
+ implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker {
+ /**
+ * This keeps track of the editing domain that is used to track all changes to the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected AdapterFactoryEditingDomain editingDomain;
+
+ /**
+ * This is the one adapter factory used for providing views of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ComposedAdapterFactory adapterFactory;
+
+ /**
+ * This is the content outline page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IContentOutlinePage contentOutlinePage;
+
+ /**
+ * This is a kludge...
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStatusLineManager contentOutlineStatusLineManager;
+
+ /**
+ * This is the content outline page's viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer contentOutlineViewer;
+
+ /**
+ * This is the property sheet page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<PropertySheetPage> propertySheetPages = new ArrayList<PropertySheetPage>();
+
+ /**
+ * This is the viewer that shadows the selection in the content outline.
+ * The parent relation must be correctly defined for this to work.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer selectionViewer;
+
+ /**
+ * This inverts the roll of parent and child in the content provider and show parents as a tree.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer parentViewer;
+
+ /**
+ * This shows how a tree view works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer treeViewer;
+
+ /**
+ * This shows how a list view works.
+ * A list viewer doesn't support icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ListViewer listViewer;
+
+ /**
+ * This shows how a table view works.
+ * A table can be used as a list with icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TableViewer tableViewer;
+
+ /**
+ * This shows how a tree view with columns works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TreeViewer treeViewerWithColumns;
+
+ /**
+ * This keeps track of the active viewer pane, in the book.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ViewerPane currentViewerPane;
+
+ /**
+ * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Viewer currentViewer;
+
+ /**
+ * This listens to which ever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionChangedListener selectionChangedListener;
+
+ /**
+ * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<ISelectionChangedListener> selectionChangedListeners = new ArrayList<ISelectionChangedListener>();
+
+ /**
+ * This keeps track of the selection of the editor as a whole.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelection editorSelection = StructuredSelection.EMPTY;
+
+ /**
+ * The MarkerHelper is responsible for creating workspace resource markers presented
+ * in Eclipse's Problems View.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected MarkerHelper markerHelper = new EditUIMarkerHelper();
+
+ /**
+ * This listens for when the outline becomes active
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IPartListener partListener =
+ new IPartListener() {
+ public void partActivated(IWorkbenchPart p) {
+ if (p instanceof ContentOutline) {
+ if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) {
+ getActionBarContributor().setActiveEditor(EGraphsEditor.this);
+
+ setCurrentViewer(contentOutlineViewer);
+ }
+ }
+ else if (p instanceof PropertySheet) {
+ if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) {
+ getActionBarContributor().setActiveEditor(EGraphsEditor.this);
+ handleActivate();
+ }
+ }
+ else if (p == EGraphsEditor.this) {
+ handleActivate();
+ }
+ }
+ public void partBroughtToTop(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partClosed(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partDeactivated(IWorkbenchPart p) {
+ // Ignore.
+ }
+ public void partOpened(IWorkbenchPart p) {
+ // Ignore.
+ }
+ };
+
+ /**
+ * Resources that have been removed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been changed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been saved.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Resource> savedResources = new ArrayList<Resource>();
+
+ /**
+ * Map to store the diagnostic associated with a resource.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Map<Resource, Diagnostic> resourceToDiagnosticMap = new LinkedHashMap<Resource, Diagnostic>();
+
+ /**
+ * Controls whether the problem indication should be updated.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean updateProblemIndication = true;
+
+ /**
+ * Adapter used to update the problem indication when resources are demanded loaded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EContentAdapter problemIndicationAdapter =
+ new EContentAdapter() {
+ protected boolean dispatching;
+
+ @Override
+ public void notifyChanged(Notification notification) {
+ if (notification.getNotifier() instanceof Resource) {
+ switch (notification.getFeatureID(Resource.class)) {
+ case Resource.RESOURCE__IS_LOADED:
+ case Resource.RESOURCE__ERRORS:
+ case Resource.RESOURCE__WARNINGS: {
+ Resource resource = (Resource)notification.getNotifier();
+ Diagnostic diagnostic = analyzeResourceProblems(resource, null);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, diagnostic);
+ }
+ else {
+ resourceToDiagnosticMap.remove(resource);
+ }
+ dispatchUpdateProblemIndication();
+ break;
+ }
+ }
+ }
+ else {
+ super.notifyChanged(notification);
+ }
+ }
+
+ protected void dispatchUpdateProblemIndication() {
+ if (updateProblemIndication && !dispatching) {
+ dispatching = true;
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ dispatching = false;
+ updateProblemIndication();
+ }
+ });
+ }
+ }
+
+ @Override
+ protected void setTarget(Resource target) {
+ basicSetTarget(target);
+ }
+
+ @Override
+ protected void unsetTarget(Resource target) {
+ basicUnsetTarget(target);
+ resourceToDiagnosticMap.remove(target);
+ dispatchUpdateProblemIndication();
+ }
+ };
+
+ /**
+ * This listens for workspace changes.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IResourceChangeListener resourceChangeListener =
+ new IResourceChangeListener() {
+ public void resourceChanged(IResourceChangeEvent event) {
+ IResourceDelta delta = event.getDelta();
+ try {
+ class ResourceDeltaVisitor implements IResourceDeltaVisitor {
+ protected ResourceSet resourceSet = editingDomain.getResourceSet();
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ public boolean visit(IResourceDelta delta) {
+ if (delta.getResource().getType() == IResource.FILE) {
+ if (delta.getKind() == IResourceDelta.REMOVED ||
+ delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
+ Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
+ if (resource != null) {
+ if (delta.getKind() == IResourceDelta.REMOVED) {
+ removedResources.add(resource);
+ }
+ else if (!savedResources.remove(resource)) {
+ changedResources.add(resource);
+ }
+ }
+ }
+ return false;
+ }
+
+ return true;
+ }
+
+ public Collection<Resource> getChangedResources() {
+ return changedResources;
+ }
+
+ public Collection<Resource> getRemovedResources() {
+ return removedResources;
+ }
+ }
+
+ final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
+ delta.accept(visitor);
+
+ if (!visitor.getRemovedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ removedResources.addAll(visitor.getRemovedResources());
+ if (!isDirty()) {
+ getSite().getPage().closeEditor(EGraphsEditor.this, false);
+ }
+ }
+ });
+ }
+
+ if (!visitor.getChangedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ changedResources.addAll(visitor.getChangedResources());
+ if (getSite().getPage().getActiveEditor() == EGraphsEditor.this) {
+ handleActivate();
+ }
+ }
+ });
+ }
+ }
+ catch (CoreException exception) {
+ EGraphsEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * Handles activation of the editor or it's associated views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void handleActivate() {
+ // Recompute the read only state.
+ //
+ if (editingDomain.getResourceToReadOnlyMap() != null) {
+ editingDomain.getResourceToReadOnlyMap().clear();
+
+ // Refresh any actions that may become enabled or disabled.
+ //
+ setSelection(getSelection());
+ }
+
+ if (!removedResources.isEmpty()) {
+ if (handleDirtyConflict()) {
+ getSite().getPage().closeEditor(EGraphsEditor.this, false);
+ }
+ else {
+ removedResources.clear();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+ else if (!changedResources.isEmpty()) {
+ changedResources.removeAll(savedResources);
+ handleChangedResources();
+ changedResources.clear();
+ savedResources.clear();
+ }
+ }
+
+ /**
+ * Handles what to do with changed resources on activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void handleChangedResources() {
+ if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
+ if (isDirty()) {
+ changedResources.addAll(editingDomain.getResourceSet().getResources());
+ }
+ editingDomain.getCommandStack().flush();
+
+ updateProblemIndication = false;
+ for (Resource resource : changedResources) {
+ if (resource.isLoaded()) {
+ resource.unload();
+ try {
+ resource.load(Collections.EMPTY_MAP);
+ }
+ catch (IOException exception) {
+ if (!resourceToDiagnosticMap.containsKey(resource)) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ }
+ }
+ }
+
+ if (AdapterFactoryEditingDomain.isStale(editorSelection)) {
+ setSelection(StructuredSelection.EMPTY);
+ }
+
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+ }
+
+ /**
+ * Updates the problems indication with the information described in the specified diagnostic.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void updateProblemIndication() {
+ if (updateProblemIndication) {
+ BasicDiagnostic diagnostic =
+ new BasicDiagnostic
+ (Diagnostic.OK,
+ "org.eclipse.emf.diffmerge.structures.model.editor",
+ 0,
+ null,
+ new Object [] { editingDomain.getResourceSet() });
+ for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) {
+ if (childDiagnostic.getSeverity() != Diagnostic.OK) {
+ diagnostic.add(childDiagnostic);
+ }
+ }
+
+ int lastEditorPage = getPageCount() - 1;
+ if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) {
+ ((ProblemEditorPart)getEditor(lastEditorPage)).setDiagnostic(diagnostic);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ setActivePage(lastEditorPage);
+ }
+ }
+ else if (diagnostic.getSeverity() != Diagnostic.OK) {
+ ProblemEditorPart problemEditorPart = new ProblemEditorPart();
+ problemEditorPart.setDiagnostic(diagnostic);
+ problemEditorPart.setMarkerHelper(markerHelper);
+ try {
+ addPage(++lastEditorPage, problemEditorPart, getEditorInput());
+ setPageText(lastEditorPage, problemEditorPart.getPartName());
+ setActivePage(lastEditorPage);
+ showTabs();
+ }
+ catch (PartInitException exception) {
+ EGraphsEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+
+ if (markerHelper.hasMarkers(editingDomain.getResourceSet())) {
+ markerHelper.deleteMarkers(editingDomain.getResourceSet());
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ try {
+ markerHelper.createMarkers(diagnostic);
+ }
+ catch (CoreException exception) {
+ EGraphsEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Shows a dialog that asks if conflicting changes should be discarded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean handleDirtyConflict() {
+ return
+ MessageDialog.openQuestion
+ (getSite().getShell(),
+ getString("_UI_FileConflict_label"),
+ getString("_WARN_FileConflict"));
+ }
+
+ /**
+ * This creates a model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EGraphsEditor() {
+ super();
+ initializeEditingDomain();
+ }
+
+ /**
+ * This sets up the editing domain for the model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void initializeEditingDomain() {
+ // Create an adapter factory that yields item providers.
+ //
+ adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new EGraphsItemProviderAdapterFactory());
+ adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+
+ // Create the command stack that will notify this editor as commands are executed.
+ //
+ BasicCommandStack commandStack = new BasicCommandStack();
+
+ // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus.
+ //
+ commandStack.addCommandStackListener
+ (new CommandStackListener() {
+ @SuppressWarnings("synthetic-access")
+ public void commandStackChanged(final EventObject event) {
+ getContainer().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+
+ // Try to select the affected objects.
+ //
+ Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
+ if (mostRecentCommand != null) {
+ setSelectionToViewer(mostRecentCommand.getAffectedObjects());
+ }
+ for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) {
+ PropertySheetPage propertySheetPage = i.next();
+ if (propertySheetPage.getControl().isDisposed()) {
+ i.remove();
+ }
+ else {
+ propertySheetPage.refresh();
+ }
+ }
+ }
+ });
+ }
+ });
+
+ // Create the editing domain with a special command stack.
+ //
+ editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
+ }
+
+ /**
+ * This is here for the listener to be able to call it.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void firePropertyChange(int action) {
+ super.firePropertyChange(action);
+ }
+
+ /**
+ * This sets the selection into whichever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSelectionToViewer(Collection<?> collection) {
+ final Collection<?> theSelection = collection;
+ // Make sure it's okay.
+ //
+ if (theSelection != null && !theSelection.isEmpty()) {
+ Runnable runnable =
+ new Runnable() {
+ public void run() {
+ // Try to select the items in the current content viewer of the editor.
+ //
+ if (currentViewer != null) {
+ currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
+ }
+ }
+ };
+ getSite().getShell().getDisplay().asyncExec(runnable);
+ }
+ }
+
+ /**
+ * This returns the editing domain as required by the {@link IEditingDomainProvider} interface.
+ * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain}
+ * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EditingDomain getEditingDomain() {
+ return editingDomain;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object [] getElements(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object [] getChildren(Object object) {
+ Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean hasChildren(Object object) {
+ Object parent = super.getParent(object);
+ return parent != null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getParent(Object object) {
+ return null;
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCurrentViewerPane(ViewerPane viewerPane) {
+ if (currentViewerPane != viewerPane) {
+ if (currentViewerPane != null) {
+ currentViewerPane.showFocus(false);
+ }
+ currentViewerPane = viewerPane;
+ }
+ setCurrentViewer(currentViewerPane.getViewer());
+ }
+
+ /**
+ * This makes sure that one content viewer, either for the current page or the outline view, if it has focus,
+ * is the current one.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCurrentViewer(Viewer viewer) {
+ // If it is changing...
+ //
+ if (currentViewer != viewer) {
+ if (selectionChangedListener == null) {
+ // Create the listener on demand.
+ //
+ selectionChangedListener =
+ new ISelectionChangedListener() {
+ // This just notifies those things that are affected by the section.
+ //
+ public void selectionChanged(SelectionChangedEvent selectionChangedEvent) {
+ setSelection(selectionChangedEvent.getSelection());
+ }
+ };
+ }
+
+ // Stop listening to the old one.
+ //
+ if (currentViewer != null) {
+ currentViewer.removeSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Start listening to the new one.
+ //
+ if (viewer != null) {
+ viewer.addSelectionChangedListener(selectionChangedListener);
+ }
+
+ // Remember it.
+ //
+ currentViewer = viewer;
+
+ // Set the editors selection based on the current viewer's selection.
+ //
+ setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection());
+ }
+ }
+
+ /**
+ * This returns the viewer as required by the {@link IViewerProvider} interface.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Viewer getViewer() {
+ return currentViewer;
+ }
+
+ /**
+ * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createContextMenuFor(StructuredViewer viewer) {
+ MenuManager contextMenu = new MenuManager("#PopUp");
+ contextMenu.add(new Separator("additions"));
+ contextMenu.setRemoveAllWhenShown(true);
+ contextMenu.addMenuListener(this);
+ Menu menu= contextMenu.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
+
+ int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
+ Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance() };
+ viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
+ }
+
+ /**
+ * This is the method called to load a resource into the editing domain's resource set based on the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createModel() {
+ URI resourceURI = EditUIUtil.getURI(getEditorInput());
+ Exception exception = null;
+ Resource resource = null;
+ try {
+ // Load the resource through the editing domain.
+ //
+ resource = editingDomain.getResourceSet().getResource(resourceURI, true);
+ }
+ catch (Exception e) {
+ exception = e;
+ resource = editingDomain.getResourceSet().getResource(resourceURI, false);
+ }
+
+ Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
+ if (diagnostic.getSeverity() != Diagnostic.OK) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
+ }
+
+ /**
+ * Returns a diagnostic describing the errors and warnings listed in the resource
+ * and the specified exception (if any).
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
+ boolean hasErrors = !resource.getErrors().isEmpty();
+ if (hasErrors || !resource.getWarnings().isEmpty()) {
+ BasicDiagnostic basicDiagnostic =
+ new BasicDiagnostic
+ (hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING,
+ "org.eclipse.emf.diffmerge.structures.model.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object [] { exception == null ? (Object)resource : exception });
+ basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
+ return basicDiagnostic;
+ }
+ else if (exception != null) {
+ return
+ new BasicDiagnostic
+ (Diagnostic.ERROR,
+ "org.eclipse.emf.diffmerge.structures.model.editor",
+ 0,
+ getString("_UI_CreateModelError_message", resource.getURI()),
+ new Object[] { exception });
+ }
+ else {
+ return Diagnostic.OK_INSTANCE;
+ }
+ }
+
+ /**
+ * This is the method used by the framework to install your own controls.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void createPages() {
+ // Creates the model from the editor input
+ //
+ createModel();
+
+ // Only creates the other pages if there is something that can be edited
+ //
+ if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {
+ // Create a page for the selection tree view.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), EGraphsEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ selectionViewer = (TreeViewer)viewerPane.getViewer();
+ selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ selectionViewer.setUseHashlookup(true);
+
+ selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ selectionViewer.setInput(editingDomain.getResourceSet());
+ selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ viewerPane.setTitle(editingDomain.getResourceSet());
+
+ new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(selectionViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_SelectionPage_label"));
+ }
+
+ // Create a page for the parent tree view.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), EGraphsEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ Tree tree = new Tree(composite, SWT.MULTI);
+ TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ parentViewer = (TreeViewer)viewerPane.getViewer();
+ parentViewer.setAutoExpandLevel(30);
+ parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
+ parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(parentViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ParentPage_label"));
+ }
+
+ // This is the page for the list viewer
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), EGraphsEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new ListViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ listViewer = (ListViewer)viewerPane.getViewer();
+ listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(listViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ListPage_label"));
+ }
+
+ // This is the page for the tree viewer
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), EGraphsEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ treeViewer = (TreeViewer)viewerPane.getViewer();
+ treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
+
+ createContextMenuFor(treeViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreePage_label"));
+ }
+
+ // This is the page for the table viewer.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), EGraphsEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TableViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ tableViewer = (TableViewer)viewerPane.getViewer();
+
+ Table table = tableViewer.getTable();
+ TableLayout layout = new TableLayout();
+ table.setLayout(layout);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+
+ TableColumn objectColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(3, 100, true));
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+
+ TableColumn selfColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(2, 100, true));
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+
+ tableViewer.setColumnProperties(new String [] {"a", "b"});
+ tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(tableViewer);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TablePage_label"));
+ }
+
+ // This is the page for the table tree viewer.
+ //
+ {
+ ViewerPane viewerPane =
+ new ViewerPane(getSite().getPage(), EGraphsEditor.this) {
+ @Override
+ public Viewer createViewer(Composite composite) {
+ return new TreeViewer(composite);
+ }
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
+
+ Tree tree = treeViewerWithColumns.getTree();
+ tree.setLayoutData(new FillLayout());
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+
+ TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE);
+ objectColumn.setText(getString("_UI_ObjectColumn_label"));
+ objectColumn.setResizable(true);
+ objectColumn.setWidth(250);
+
+ TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE);
+ selfColumn.setText(getString("_UI_SelfColumn_label"));
+ selfColumn.setResizable(true);
+ selfColumn.setWidth(200);
+
+ treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"});
+ treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+
+ createContextMenuFor(treeViewerWithColumns);
+ int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label"));
+ }
+
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ @SuppressWarnings("synthetic-access")
+ public void run() {
+ setActivePage(0);
+ }
+ });
+ }
+
+ // Ensures that this editor will only display the page's tab
+ // area if there are more than one page
+ //
+ getContainer().addControlListener
+ (new ControlAdapter() {
+ boolean guard = false;
+ @Override
+ public void controlResized(ControlEvent event) {
+ if (!guard) {
+ guard = true;
+ hideTabs();
+ guard = false;
+ }
+ }
+ });
+
+ getSite().getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+
+ /**
+ * If there is just one page in the multi-page editor part,
+ * this hides the single tab at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void hideTabs() {
+ if (getPageCount() <= 1) {
+ setPageText(0, "");
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(1);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y + 6);
+ }
+ }
+ }
+
+ /**
+ * If there is more than one page in the multi-page editor part,
+ * this shows the tabs at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void showTabs() {
+ if (getPageCount() > 1) {
+ setPageText(0, getString("_UI_SelectionPage_label"));
+ if (getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT);
+ Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y - 6);
+ }
+ }
+ }
+
+ /**
+ * This is used to track the active viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void pageChange(int pageIndex) {
+ super.pageChange(pageIndex);
+
+ if (contentOutlinePage != null) {
+ handleContentOutlineSelection(contentOutlinePage.getSelection());
+ }
+ }
+
+ /**
+ * This is how the framework determines which interfaces we implement.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @Override
+ public Object getAdapter(Class key) {
+ if (key.equals(IContentOutlinePage.class)) {
+ return showOutlineView() ? getContentOutlinePage() : null;
+ }
+ else if (key.equals(IPropertySheetPage.class)) {
+ return getPropertySheetPage();
+ }
+ else if (key.equals(IGotoMarker.class)) {
+ return this;
+ }
+ else {
+ return super.getAdapter(key);
+ }
+ }
+
+ /**
+ * This accesses a cached version of the content outliner.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IContentOutlinePage getContentOutlinePage() {
+ if (contentOutlinePage == null) {
+ // The content outline is just a tree.
+ //
+ class MyContentOutlinePage extends ContentOutlinePage {
+ @Override
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ contentOutlineViewer = getTreeViewer();
+ contentOutlineViewer.addSelectionChangedListener(this);
+
+ // Set up the tree viewer.
+ //
+ contentOutlineViewer.setUseHashlookup(true);
+ contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ contentOutlineViewer.setInput(editingDomain.getResourceSet());
+
+ // Make sure our popups work.
+ //
+ createContextMenuFor(contentOutlineViewer);
+
+ if (!editingDomain.getResourceSet().getResources().isEmpty()) {
+ // Select the root object in the view.
+ //
+ contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
+ }
+ }
+
+ @Override
+ public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
+ super.makeContributions(menuManager, toolBarManager, statusLineManager);
+ contentOutlineStatusLineManager = statusLineManager;
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ }
+
+ contentOutlinePage = new MyContentOutlinePage();
+
+ // Listen to selection so that we can handle it is a special way.
+ //
+ contentOutlinePage.addSelectionChangedListener
+ (new ISelectionChangedListener() {
+ // This ensures that we handle selections correctly.
+ //
+ public void selectionChanged(SelectionChangedEvent event) {
+ handleContentOutlineSelection(event.getSelection());
+ }
+ });
+ }
+
+ return contentOutlinePage;
+ }
+
+ /**
+ * This accesses a cached version of the property sheet.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IPropertySheetPage getPropertySheetPage() {
+ PropertySheetPage propertySheetPage =
+ new ExtendedPropertySheetPage(editingDomain) {
+ @Override
+ public void setSelectionToViewer(List<?> selection) {
+ EGraphsEditor.this.setSelectionToViewer(selection);
+ EGraphsEditor.this.setFocus();
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ };
+ propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
+ propertySheetPages.add(propertySheetPage);
+
+ return propertySheetPage;
+ }
+
+ /**
+ * This deals with how we want selection in the outliner to affect the other views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void handleContentOutlineSelection(ISelection selection) {
+ if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
+ if (selectedElements.hasNext()) {
+ // Get the first selected element.
+ //
+ Object selectedElement = selectedElements.next();
+
+ // If it's the selection viewer, then we want it to select the same selection as this selection.
+ //
+ if (currentViewerPane.getViewer() == selectionViewer) {
+ ArrayList<Object> selectionList = new ArrayList<Object>();
+ selectionList.add(selectedElement);
+ while (selectedElements.hasNext()) {
+ selectionList.add(selectedElements.next());
+ }
+
+ // Set the selection to the widget.
+ //
+ selectionViewer.setSelection(new StructuredSelection(selectionList));
+ }
+ else {
+ // Set the input to the widget.
+ //
+ if (currentViewerPane.getViewer().getInput() != selectedElement) {
+ currentViewerPane.getViewer().setInput(selectedElement);
+ currentViewerPane.setTitle(selectedElement);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply tests the command stack.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isDirty() {
+ return ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply saves the model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void doSave(IProgressMonitor progressMonitor) {
+ // Save only resources that have actually changed.
+ //
+ final Map<Object, Object> saveOptions = new HashMap<Object, Object>();
+ saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
+
+ // Do the work within an operation because this is a long running activity that modifies the workbench.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ // This is the method that gets invoked when the operation runs.
+ //
+ @Override
+ public void execute(IProgressMonitor monitor) {
+ // Save the resources to the file system.
+ //
+ boolean first = true;
+ List<Resource> resources = editingDomain.getResourceSet().getResources();
+ for (int i = 0; i < resources.size(); ++i) {
+ Resource resource = resources.get(i);
+ if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) {
+ try {
+ long timeStamp = resource.getTimeStamp();
+ resource.save(saveOptions);
+ if (resource.getTimeStamp() != timeStamp) {
+ savedResources.add(resource);
+ }
+ }
+ catch (Exception exception) {
+ resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ first = false;
+ }
+ }
+ }
+ };
+
+ updateProblemIndication = false;
+ try {
+ // This runs the options, and shows progress.
+ //
+ new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);
+
+ // Refresh the necessary state.
+ //
+ ((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone();
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ }
+ catch (Exception exception) {
+ // Something went wrong that shouldn't.
+ //
+ EGraphsEditorPlugin.INSTANCE.log(exception);
+ }
+ updateProblemIndication = true;
+ updateProblemIndication();
+ }
+
+ /**
+ * This returns whether something has been persisted to the URI of the specified resource.
+ * The implementation uses the URI converter from the editor's resource set to try to open an input stream.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean isPersisted(Resource resource) {
+ boolean result = false;
+ try {
+ InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
+ if (stream != null) {
+ result = true;
+ stream.close();
+ }
+ }
+ catch (IOException e) {
+ // Ignore
+ }
+ return result;
+ }
+
+ /**
+ * This always returns true because it is not currently supported.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isSaveAsAllowed() {
+ return true;
+ }
+
+ /**
+ * This also changes the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void doSaveAs() {
+ SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
+ saveAsDialog.open();
+ IPath path = saveAsDialog.getResult();
+ if (path != null) {
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ if (file != null) {
+ doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void doSaveAs(URI uri, IEditorInput editorInput) {
+ (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ IProgressMonitor progressMonitor =
+ getActionBars().getStatusLineManager() != null ?
+ getActionBars().getStatusLineManager().getProgressMonitor() :
+ new NullProgressMonitor();
+ doSave(progressMonitor);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void gotoMarker(IMarker marker) {
+ List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker);
+ if (!targetObjects.isEmpty()) {
+ setSelectionToViewer(targetObjects);
+ }
+ }
+
+ /**
+ * This is called during startup.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void init(IEditorSite site, IEditorInput editorInput) {
+ setSite(site);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ site.setSelectionProvider(this);
+ site.getPage().addPartListener(partListener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setFocus() {
+ if (currentViewerPane != null) {
+ currentViewerPane.setFocus();
+ }
+ else {
+ getControl(getActivePage()).setFocus();
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.add(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangedListeners.remove(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ISelection getSelection() {
+ return editorSelection;
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection.
+ * Calling this result will notify the listeners.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSelection(ISelection selection) {
+ editorSelection = selection;
+
+ for (ISelectionChangedListener listener : selectionChangedListeners) {
+ listener.selectionChanged(new SelectionChangedEvent(this, selection));
+ }
+ setStatusLineManager(selection);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setStatusLineManager(ISelection selection) {
+ IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
+ contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+
+ if (statusLineManager != null) {
+ if (selection instanceof IStructuredSelection) {
+ Collection<?> collection = ((IStructuredSelection)selection).toList();
+ switch (collection.size()) {
+ case 0: {
+ statusLineManager.setMessage(getString("_UI_NoObjectSelected"));
+ break;
+ }
+ case 1: {
+ String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
+ statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text));
+ break;
+ }
+ default: {
+ statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size())));
+ break;
+ }
+ }
+ }
+ else {
+ statusLineManager.setMessage("");
+ }
+ }
+ }
+
+ /**
+ * This looks up a string in the plugin's plugin.properties file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static String getString(String key) {
+ return EGraphsEditorPlugin.INSTANCE.getString(key);
+ }
+
+ /**
+ * This looks up a string in plugin.properties, making a substitution.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static String getString(String key, Object s1) {
+ return EGraphsEditorPlugin.INSTANCE.getString(key, new Object [] { s1 });
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void menuAboutToShow(IMenuManager menuManager) {
+ ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EditingDomainActionBarContributor getActionBarContributor() {
+ return (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IActionBars getActionBars() {
+ return getActionBarContributor().getActionBars();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AdapterFactory getAdapterFactory() {
+ return adapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void dispose() {
+ updateProblemIndication = false;
+
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
+
+ getSite().getPage().removePartListener(partListener);
+
+ adapterFactory.dispose();
+
+ if (getActionBarContributor().getActiveEditor() == this) {
+ getActionBarContributor().setActiveEditor(null);
+ }
+
+ for (PropertySheetPage propertySheetPage : propertySheetPages) {
+ propertySheetPage.dispose();
+ }
+
+ if (contentOutlinePage != null) {
+ contentOutlinePage.dispose();
+ }
+
+ super.dispose();
+ }
+
+ /**
+ * Returns whether the outline view should be presented to the user.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean showOutlineView() {
+ return true;
+ }
+}
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.editor/src/org/eclipse/emf/diffmerge/structures/model/egraphs/presentation/EGraphsEditorPlugin.java b/tests/org.eclipse.emf.diffmerge.structures.model.editor/src/org/eclipse/emf/diffmerge/structures/model/egraphs/presentation/EGraphsEditorPlugin.java
new file mode 100644
index 00000000..5bd67499
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.editor/src/org/eclipse/emf/diffmerge/structures/model/egraphs/presentation/EGraphsEditorPlugin.java
@@ -0,0 +1,104 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs.presentation;
+
+import org.eclipse.emf.common.EMFPlugin;
+
+import org.eclipse.emf.common.ui.EclipseUIPlugin;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+/**
+ * This is the central singleton for the EGraphs editor plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public final class EGraphsEditorPlugin extends EMFPlugin {
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EGraphsEditorPlugin INSTANCE = new EGraphsEditorPlugin();
+
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static Implementation plugin;
+
+ /**
+ * Create the instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EGraphsEditorPlugin() {
+ super
+ (new ResourceLocator [] {
+ });
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ @Override
+ public ResourceLocator getPluginResourceLocator() {
+ return plugin;
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ public static Implementation getPlugin() {
+ return plugin;
+ }
+
+ /**
+ * The actual implementation of the Eclipse <b>Plugin</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static class Implementation extends EclipseUIPlugin {
+ /**
+ * Creates an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("synthetic-access")
+ public Implementation() {
+ super();
+
+ // Remember the static instance.
+ //
+ plugin = this;
+ }
+ }
+
+}
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model.editor/src/org/eclipse/emf/diffmerge/structures/model/egraphs/presentation/EGraphsModelWizard.java b/tests/org.eclipse.emf.diffmerge.structures.model.editor/src/org/eclipse/emf/diffmerge/structures/model/egraphs/presentation/EGraphsModelWizard.java
new file mode 100644
index 00000000..57c97ff2
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model.editor/src/org/eclipse/emf/diffmerge/structures/model/egraphs/presentation/EGraphsModelWizard.java
@@ -0,0 +1,641 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs.presentation;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.StringTokenizer;
+
+import org.eclipse.emf.common.CommonPlugin;
+
+import org.eclipse.emf.common.util.URI;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.emf.ecore.xmi.XMLResource;
+
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardPage;
+
+import org.eclipse.swt.SWT;
+
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.ModifyEvent;
+
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.ISetSelectionTarget;
+
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsFactory;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.provider.EGraphsEditPlugin;
+
+
+import org.eclipse.core.runtime.Path;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+
+
+/**
+ * This is a simple wizard for creating a new model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+@SuppressWarnings("nls")
+public class EGraphsModelWizard extends Wizard implements INewWizard {
+ /**
+ * The supported extensions for created files.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final List<String> FILE_EXTENSIONS =
+ Collections.unmodifiableList(Arrays.asList(EGraphsEditorPlugin.INSTANCE.getString("_UI_EGraphsEditorFilenameExtensions").split("\\s*,\\s*")));
+
+ /**
+ * A formatted list of supported file extensions, suitable for display.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String FORMATTED_FILE_EXTENSIONS =
+ EGraphsEditorPlugin.INSTANCE.getString("_UI_EGraphsEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", ");
+
+ /**
+ * This caches an instance of the model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EGraphsPackage eGraphsPackage = EGraphsPackage.eINSTANCE;
+
+ /**
+ * This caches an instance of the model factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EGraphsFactory eGraphsFactory = eGraphsPackage.getEGraphsFactory();
+
+ /**
+ * This is the file creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EGraphsModelWizardNewFileCreationPage newFileCreationPage;
+
+ /**
+ * This is the initial object creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EGraphsModelWizardInitialObjectCreationPage initialObjectCreationPage;
+
+ /**
+ * Remember the selection during initialization for populating the default container.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStructuredSelection selection;
+
+ /**
+ * Remember the workbench during initialization.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IWorkbench workbench;
+
+ /**
+ * Caches the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<String> initialObjectNames;
+
+ /**
+ * This just records the information.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.workbench = workbench;
+ this.selection = selection;
+ setWindowTitle(EGraphsEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
+ setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(EGraphsEditorPlugin.INSTANCE.getImage("full/wizban/NewEGraphs")));
+ }
+
+ /**
+ * Returns the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getInitialObjectNames() {
+ if (initialObjectNames == null) {
+ initialObjectNames = new ArrayList<String>();
+ for (EClassifier eClassifier : eGraphsPackage.getEClassifiers()) {
+ if (eClassifier instanceof EClass) {
+ EClass eClass = (EClass)eClassifier;
+ if (!eClass.isAbstract()) {
+ initialObjectNames.add(eClass.getName());
+ }
+ }
+ }
+ Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator());
+ }
+ return initialObjectNames;
+ }
+
+ /**
+ * Create a new model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EObject createInitialModel() {
+ EClass eClass = (EClass)eGraphsPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
+ EObject rootObject = eGraphsFactory.create(eClass);
+ return rootObject;
+ }
+
+ /**
+ * Do the work after everything is specified.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean performFinish() {
+ try {
+ // Remember the file.
+ //
+ final IFile modelFile = getModelFile();
+
+ // Do the work within an operation.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ @Override
+ protected void execute(IProgressMonitor progressMonitor) {
+ try {
+ // Create a resource set
+ //
+ ResourceSet resourceSet = new ResourceSetImpl();
+
+ // Get the URI of the model file.
+ //
+ URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true);
+
+ // Create a resource for this file.
+ //
+ Resource resource = resourceSet.createResource(fileURI);
+
+ // Add the initial model object to the contents.
+ //
+ EObject rootObject = createInitialModel();
+ if (rootObject != null) {
+ resource.getContents().add(rootObject);
+ }
+
+ // Save the contents of the resource to the file system.
+ //
+ Map<Object, Object> options = new HashMap<Object, Object>();
+ options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding());
+ resource.save(options);
+ }
+ catch (Exception exception) {
+ EGraphsEditorPlugin.INSTANCE.log(exception);
+ }
+ finally {
+ progressMonitor.done();
+ }
+ }
+ };
+
+ getContainer().run(false, false, operation);
+
+ // Select the new file resource in the current view.
+ //
+ IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page = workbenchWindow.getActivePage();
+ final IWorkbenchPart activePart = page.getActivePart();
+ if (activePart instanceof ISetSelectionTarget) {
+ final ISelection targetSelection = new StructuredSelection(modelFile);
+ getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ ((ISetSelectionTarget)activePart).selectReveal(targetSelection);
+ }
+ });
+ }
+
+ // Open an editor on the new file.
+ //
+ try {
+ page.openEditor
+ (new FileEditorInput(modelFile),
+ workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId());
+ }
+ catch (PartInitException exception) {
+ MessageDialog.openError(workbenchWindow.getShell(), EGraphsEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage());
+ return false;
+ }
+
+ return true;
+ }
+ catch (Exception exception) {
+ EGraphsEditorPlugin.INSTANCE.log(exception);
+ return false;
+ }
+ }
+
+ /**
+ * This is the one page of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class EGraphsModelWizardNewFileCreationPage extends WizardNewFileCreationPage {
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EGraphsModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) {
+ super(pageId, selection);
+ }
+
+ /**
+ * The framework calls this to see if the file is correct.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean validatePage() {
+ if (super.validatePage()) {
+ String extension = new Path(getFileName()).getFileExtension();
+ if (extension == null || !FILE_EXTENSIONS.contains(extension)) {
+ String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";
+ setErrorMessage(EGraphsEditorPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS }));
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName()));
+ }
+ }
+
+ /**
+ * This is the page where the type of object to create is selected.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class EGraphsModelWizardInitialObjectCreationPage extends WizardPage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo initialObjectField;
+
+ /**
+ * @generated
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ protected List<String> encodings;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo encodingField;
+
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EGraphsModelWizardInitialObjectCreationPage(String pageId) {
+ super(pageId);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ {
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.verticalSpacing = 12;
+ composite.setLayout(layout);
+
+ GridData data = new GridData();
+ data.verticalAlignment = GridData.FILL;
+ data.grabExcessVerticalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ composite.setLayoutData(data);
+ }
+
+ Label containerLabel = new Label(composite, SWT.LEFT);
+ {
+ containerLabel.setText(EGraphsEditorPlugin.INSTANCE.getString("_UI_ModelObject"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ containerLabel.setLayoutData(data);
+ }
+
+ initialObjectField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ initialObjectField.setLayoutData(data);
+ }
+
+ for (String objectName : getInitialObjectNames()) {
+ initialObjectField.add(getLabel(objectName));
+ }
+
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.select(0);
+ }
+ initialObjectField.addModifyListener(validator);
+
+ Label encodingLabel = new Label(composite, SWT.LEFT);
+ {
+ encodingLabel.setText(EGraphsEditorPlugin.INSTANCE.getString("_UI_XMLEncoding"));
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ encodingLabel.setLayoutData(data);
+ }
+ encodingField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ encodingField.setLayoutData(data);
+ }
+
+ for (String encoding : getEncodings()) {
+ encodingField.add(encoding);
+ }
+
+ encodingField.select(0);
+ encodingField.addModifyListener(validator);
+
+ setPageComplete(validatePage());
+ setControl(composite);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ModifyListener validator =
+ new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ setPageComplete(validatePage());
+ }
+ };
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean validatePage() {
+ return getInitialObjectName() != null && getEncodings().contains(encodingField.getText());
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible) {
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.clearSelection();
+ encodingField.setFocus();
+ }
+ else {
+ encodingField.clearSelection();
+ initialObjectField.setFocus();
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getInitialObjectName() {
+ String label = initialObjectField.getText();
+
+ for (String name : getInitialObjectNames()) {
+ if (getLabel(name).equals(label)) {
+ return name;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getEncoding() {
+ return encodingField.getText();
+ }
+
+ /**
+ * Returns the label for the specified type name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected String getLabel(String typeName) {
+ try {
+ return EGraphsEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type");
+ }
+ catch(MissingResourceException mre) {
+ EGraphsEditorPlugin.INSTANCE.log(mre);
+ }
+ return typeName;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getEncodings() {
+ if (encodings == null) {
+ encodings = new ArrayList<String>();
+ for (StringTokenizer stringTokenizer = new StringTokenizer(EGraphsEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens(); ) {
+ encodings.add(stringTokenizer.nextToken());
+ }
+ }
+ return encodings;
+ }
+ }
+
+ /**
+ * The framework calls this to create the contents of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void addPages() {
+ // Create a page, set the title, and the initial model file name.
+ //
+ newFileCreationPage = new EGraphsModelWizardNewFileCreationPage("Whatever", selection);
+ newFileCreationPage.setTitle(EGraphsEditorPlugin.INSTANCE.getString("_UI_EGraphsModelWizard_label"));
+ newFileCreationPage.setDescription(EGraphsEditorPlugin.INSTANCE.getString("_UI_EGraphsModelWizard_description"));
+ newFileCreationPage.setFileName(EGraphsEditorPlugin.INSTANCE.getString("_UI_EGraphsEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0));
+ addPage(newFileCreationPage);
+
+ // Try and get the resource selection to determine a current directory for the file dialog.
+ //
+ if (selection != null && !selection.isEmpty()) {
+ // Get the resource...
+ //
+ Object selectedElement = selection.iterator().next();
+ if (selectedElement instanceof IResource) {
+ // Get the resource parent, if its a file.
+ //
+ IResource selectedResource = (IResource)selectedElement;
+ if (selectedResource.getType() == IResource.FILE) {
+ selectedResource = selectedResource.getParent();
+ }
+
+ // This gives us a directory...
+ //
+ if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
+ // Set this for the container.
+ //
+ newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());
+
+ // Make up a unique new name here.
+ //
+ String defaultModelBaseFilename = EGraphsEditorPlugin.INSTANCE.getString("_UI_EGraphsEditorFilenameDefaultBase");
+ String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
+ String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension;
+ for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i) {
+ modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension;
+ }
+ newFileCreationPage.setFileName(modelFilename);
+ }
+ }
+ }
+ initialObjectCreationPage = new EGraphsModelWizardInitialObjectCreationPage("Whatever2");
+ initialObjectCreationPage.setTitle(EGraphsEditorPlugin.INSTANCE.getString("_UI_EGraphsModelWizard_label"));
+ initialObjectCreationPage.setDescription(EGraphsEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
+ addPage(initialObjectCreationPage);
+ }
+
+ /**
+ * Get the file from the page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return newFileCreationPage.getModelFile();
+ }
+
+}
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/.classpath b/tests/org.eclipse.emf.diffmerge.structures.model/.classpath
new file mode 100644
index 00000000..304e8618
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/.project b/tests/org.eclipse.emf.diffmerge.structures.model/.project
new file mode 100644
index 00000000..8fc4e4c8
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.diffmerge.structures.model</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.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.emf.diffmerge.structures.model/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..8d8f0632
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,104 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=private
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=enabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=disabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/META-INF/MANIFEST.MF b/tests/org.eclipse.emf.diffmerge.structures.model/META-INF/MANIFEST.MF
new file mode 100644
index 00000000..8019d883
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/META-INF/MANIFEST.MF
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.emf.diffmerge.structures.model;singleton:=true
+Bundle-Version: 0.9.0.qualifier
+Bundle-ClassPath: .
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.ecore;visibility:=reexport,
+ org.eclipse.emf.ecore.xmi;visibility:=reexport,
+ org.eclipse.emf.diffmerge.ui;visibility:=reexport
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.emf.diffmerge.structures.model.integration,
+ org.eclipse.emf.diffmerge.structures.model.egraphs,
+ org.eclipse.emf.diffmerge.structures.model.egraphs.impl,
+ org.eclipse.emf.diffmerge.structures.model.egraphs.util
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/build.properties b/tests/org.eclipse.emf.diffmerge.structures.model/build.properties
new file mode 100644
index 00000000..4465407f
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/build.properties
@@ -0,0 +1,10 @@
+#
+
+bin.includes = .,\
+ model/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties
+jars.compile.order = .
+source.. = src/
+output.. = bin/
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/model/EGraphs.ecore b/tests/org.eclipse.emf.diffmerge.structures.model/model/EGraphs.ecore
new file mode 100644
index 00000000..ae5a981e
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/model/EGraphs.ecore
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage 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" name="egraphs" nsURI="http://www.eclipse.org/emf/diffmerge/structures/egraphs/1.0.0"
+ nsPrefix="org.eclipse.emf.diffmerge.structures.model">
+ <eClassifiers xsi:type="ecore:EClass" name="EGraph">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="contents" upperBound="-1"
+ eType="#//ENode" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ENode">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="element" lowerBound="1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="outgoing" upperBound="-1"
+ eType="#//EHyperEdge" containment="true" eOpposite="#//EHyperEdge/source"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="incoming" upperBound="-1"
+ eType="#//EHyperEdge" eOpposite="#//EHyperEdge/targets"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="EHyperEdge">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="label" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="source" lowerBound="1"
+ eType="#//ENode" eOpposite="#//ENode/outgoing"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="targets" upperBound="-1"
+ eType="#//ENode" eOpposite="#//ENode/incoming"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/model/EGraphs.genmodel b/tests/org.eclipse.emf.diffmerge.structures.model/model/EGraphs.genmodel
new file mode 100644
index 00000000..bd3991b7
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/model/EGraphs.genmodel
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.emf.diffmerge.structures.model/src"
+ modelPluginID="org.eclipse.emf.diffmerge.structures.model" modelName="EGraphs"
+ rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" rootImplementsInterface=""
+ importerID="org.eclipse.emf.importer.ecore" complianceLevel="5.0" copyrightFields="false"
+ runtimeVersion="2.6" operationReflection="true" importOrganizing="true">
+ <foreignModel>EGraphs.ecore</foreignModel>
+ <genPackages prefix="EGraphs" basePackage="org.eclipse.emf.diffmerge.structures.model"
+ resource="XMI" disposableProviderFactory="true" contentTypeIdentifier="" fileExtensions="egraphs"
+ ecorePackage="EGraphs.ecore#/">
+ <genClasses ecoreClass="EGraphs.ecore#//EGraph">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference EGraphs.ecore#//EGraph/contents"/>
+ </genClasses>
+ <genClasses ecoreClass="EGraphs.ecore#//ENode">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute EGraphs.ecore#//ENode/element"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference EGraphs.ecore#//ENode/outgoing"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference EGraphs.ecore#//ENode/incoming"/>
+ </genClasses>
+ <genClasses ecoreClass="EGraphs.ecore#//EHyperEdge">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute EGraphs.ecore#//EHyperEdge/label"/>
+ <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference EGraphs.ecore#//EHyperEdge/source"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference EGraphs.ecore#//EHyperEdge/targets"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/plugin.properties b/tests/org.eclipse.emf.diffmerge.structures.model/plugin.properties
new file mode 100644
index 00000000..50dba550
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/plugin.properties
@@ -0,0 +1,9 @@
+###############################################################################
+# Copyright (c) 2017 Thales Global Services S.A.S.
+# 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
+###############################################################################
+pluginName = EMF Diff/Merge Structures Model Plug-In (Incubation)
+providerName = Eclipse Modeling Project
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/plugin.xml b/tests/org.eclipse.emf.diffmerge.structures.model/plugin.xml
new file mode 100644
index 00000000..80ca9e6c
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/plugin.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+-->
+
+<plugin>
+
+
+
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <!-- @generated EGraphs -->
+ <package
+ uri="http://www.eclipse.org/emf/diffmerge/structures/egraphs/1.0.0"
+ class="org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage"
+ genModel="model/EGraphs.genmodel"/>
+ </extension>
+
+ <extension point="org.eclipse.emf.ecore.extension_parser">
+ <!-- @generated EGraphs -->
+ <parser
+ type="egraphs"
+ class="org.eclipse.emf.diffmerge.structures.model.egraphs.util.EGraphsResourceFactoryImpl"/>
+ </extension>
+</plugin>
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/EGraph.java b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/EGraph.java
new file mode 100644
index 00000000..20081779
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/EGraph.java
@@ -0,0 +1,54 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>EGraph</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.emf.diffmerge.structures.model.egraphs.EGraph#getContents <em>Contents</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage#getEGraph()
+ * @model
+ * @generated
+ */
+public interface EGraph extends EObject {
+ /**
+ * Returns the value of the '<em><b>Contents</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.emf.diffmerge.structures.model.egraphs.ENode}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Contents</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Contents</em>' containment reference list.
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage#getEGraph_Contents()
+ * @model containment="true"
+ * @generated
+ */
+ EList<ENode> getContents();
+
+} // EGraph
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/EGraphsFactory.java b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/EGraphsFactory.java
new file mode 100644
index 00000000..d4d13225
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/EGraphsFactory.java
@@ -0,0 +1,72 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage
+ * @generated
+ */
+public interface EGraphsFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EGraphsFactory eINSTANCE = org.eclipse.emf.diffmerge.structures.model.egraphs.impl.EGraphsFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>EGraph</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>EGraph</em>'.
+ * @generated
+ */
+ EGraph createEGraph();
+
+ /**
+ * Returns a new object of class '<em>ENode</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>ENode</em>'.
+ * @generated
+ */
+ ENode createENode();
+
+ /**
+ * Returns a new object of class '<em>EHyper Edge</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>EHyper Edge</em>'.
+ * @generated
+ */
+ EHyperEdge createEHyperEdge();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ EGraphsPackage getEGraphsPackage();
+
+} //EGraphsFactory
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/EGraphsPackage.java b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/EGraphsPackage.java
new file mode 100644
index 00000000..c8883b7b
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/EGraphsPackage.java
@@ -0,0 +1,437 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface EGraphsPackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "egraphs";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.eclipse.org/emf/diffmerge/structures/egraphs/1.0.0";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "org.eclipse.emf.diffmerge.structures.model";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EGraphsPackage eINSTANCE = org.eclipse.emf.diffmerge.structures.model.egraphs.impl.EGraphsPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.impl.EGraphImpl <em>EGraph</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.impl.EGraphImpl
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.impl.EGraphsPackageImpl#getEGraph()
+ * @generated
+ */
+ int EGRAPH = 0;
+
+ /**
+ * The feature id for the '<em><b>Contents</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EGRAPH__CONTENTS = 0;
+
+ /**
+ * The number of structural features of the '<em>EGraph</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EGRAPH_FEATURE_COUNT = 1;
+
+ /**
+ * The number of operations of the '<em>EGraph</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EGRAPH_OPERATION_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.impl.ENodeImpl <em>ENode</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.impl.ENodeImpl
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.impl.EGraphsPackageImpl#getENode()
+ * @generated
+ */
+ int ENODE = 1;
+
+ /**
+ * The feature id for the '<em><b>Element</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ENODE__ELEMENT = 0;
+
+ /**
+ * The feature id for the '<em><b>Outgoing</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ENODE__OUTGOING = 1;
+
+ /**
+ * The feature id for the '<em><b>Incoming</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ENODE__INCOMING = 2;
+
+ /**
+ * The number of structural features of the '<em>ENode</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ENODE_FEATURE_COUNT = 3;
+
+ /**
+ * The number of operations of the '<em>ENode</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int ENODE_OPERATION_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.impl.EHyperEdgeImpl <em>EHyper Edge</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.impl.EHyperEdgeImpl
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.impl.EGraphsPackageImpl#getEHyperEdge()
+ * @generated
+ */
+ int EHYPER_EDGE = 2;
+
+ /**
+ * The feature id for the '<em><b>Label</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EHYPER_EDGE__LABEL = 0;
+
+ /**
+ * The feature id for the '<em><b>Source</b></em>' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EHYPER_EDGE__SOURCE = 1;
+
+ /**
+ * The feature id for the '<em><b>Targets</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EHYPER_EDGE__TARGETS = 2;
+
+ /**
+ * The number of structural features of the '<em>EHyper Edge</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EHYPER_EDGE_FEATURE_COUNT = 3;
+
+ /**
+ * The number of operations of the '<em>EHyper Edge</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EHYPER_EDGE_OPERATION_COUNT = 0;
+
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.EGraph <em>EGraph</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>EGraph</em>'.
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EGraph
+ * @generated
+ */
+ EClass getEGraph();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.EGraph#getContents <em>Contents</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Contents</em>'.
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EGraph#getContents()
+ * @see #getEGraph()
+ * @generated
+ */
+ EReference getEGraph_Contents();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.ENode <em>ENode</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>ENode</em>'.
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.ENode
+ * @generated
+ */
+ EClass getENode();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.ENode#getElement <em>Element</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Element</em>'.
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.ENode#getElement()
+ * @see #getENode()
+ * @generated
+ */
+ EAttribute getENode_Element();
+
+ /**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.ENode#getOutgoing <em>Outgoing</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Outgoing</em>'.
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.ENode#getOutgoing()
+ * @see #getENode()
+ * @generated
+ */
+ EReference getENode_Outgoing();
+
+ /**
+ * Returns the meta object for the reference list '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.ENode#getIncoming <em>Incoming</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Incoming</em>'.
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.ENode#getIncoming()
+ * @see #getENode()
+ * @generated
+ */
+ EReference getENode_Incoming();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge <em>EHyper Edge</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>EHyper Edge</em>'.
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge
+ * @generated
+ */
+ EClass getEHyperEdge();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge#getLabel <em>Label</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Label</em>'.
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge#getLabel()
+ * @see #getEHyperEdge()
+ * @generated
+ */
+ EAttribute getEHyperEdge_Label();
+
+ /**
+ * Returns the meta object for the container reference '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge#getSource <em>Source</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the container reference '<em>Source</em>'.
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge#getSource()
+ * @see #getEHyperEdge()
+ * @generated
+ */
+ EReference getEHyperEdge_Source();
+
+ /**
+ * Returns the meta object for the reference list '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge#getTargets <em>Targets</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Targets</em>'.
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge#getTargets()
+ * @see #getEHyperEdge()
+ * @generated
+ */
+ EReference getEHyperEdge_Targets();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ EGraphsFactory getEGraphsFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.impl.EGraphImpl <em>EGraph</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.impl.EGraphImpl
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.impl.EGraphsPackageImpl#getEGraph()
+ * @generated
+ */
+ EClass EGRAPH = eINSTANCE.getEGraph();
+
+ /**
+ * The meta object literal for the '<em><b>Contents</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference EGRAPH__CONTENTS = eINSTANCE.getEGraph_Contents();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.impl.ENodeImpl <em>ENode</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.impl.ENodeImpl
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.impl.EGraphsPackageImpl#getENode()
+ * @generated
+ */
+ EClass ENODE = eINSTANCE.getENode();
+
+ /**
+ * The meta object literal for the '<em><b>Element</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute ENODE__ELEMENT = eINSTANCE.getENode_Element();
+
+ /**
+ * The meta object literal for the '<em><b>Outgoing</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference ENODE__OUTGOING = eINSTANCE.getENode_Outgoing();
+
+ /**
+ * The meta object literal for the '<em><b>Incoming</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference ENODE__INCOMING = eINSTANCE.getENode_Incoming();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.impl.EHyperEdgeImpl <em>EHyper Edge</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.impl.EHyperEdgeImpl
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.impl.EGraphsPackageImpl#getEHyperEdge()
+ * @generated
+ */
+ EClass EHYPER_EDGE = eINSTANCE.getEHyperEdge();
+
+ /**
+ * The meta object literal for the '<em><b>Label</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute EHYPER_EDGE__LABEL = eINSTANCE.getEHyperEdge_Label();
+
+ /**
+ * The meta object literal for the '<em><b>Source</b></em>' container reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference EHYPER_EDGE__SOURCE = eINSTANCE.getEHyperEdge_Source();
+
+ /**
+ * The meta object literal for the '<em><b>Targets</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference EHYPER_EDGE__TARGETS = eINSTANCE.getEHyperEdge_Targets();
+
+ }
+
+} //EGraphsPackage
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/EHyperEdge.java b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/EHyperEdge.java
new file mode 100644
index 00000000..3ce965d5
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/EHyperEdge.java
@@ -0,0 +1,112 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>EHyper Edge</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge#getLabel <em>Label</em>}</li>
+ * <li>{@link org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge#getSource <em>Source</em>}</li>
+ * <li>{@link org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge#getTargets <em>Targets</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage#getEHyperEdge()
+ * @model
+ * @generated
+ */
+public interface EHyperEdge extends EObject {
+ /**
+ * Returns the value of the '<em><b>Label</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Label</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Label</em>' attribute.
+ * @see #setLabel(String)
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage#getEHyperEdge_Label()
+ * @model
+ * @generated
+ */
+ String getLabel();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge#getLabel <em>Label</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Label</em>' attribute.
+ * @see #getLabel()
+ * @generated
+ */
+ void setLabel(String value);
+
+ /**
+ * Returns the value of the '<em><b>Source</b></em>' container reference.
+ * It is bidirectional and its opposite is '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.ENode#getOutgoing <em>Outgoing</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Source</em>' container reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Source</em>' container reference.
+ * @see #setSource(ENode)
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage#getEHyperEdge_Source()
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.ENode#getOutgoing
+ * @model opposite="outgoing" required="true" transient="false"
+ * @generated
+ */
+ ENode getSource();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge#getSource <em>Source</em>}' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Source</em>' container reference.
+ * @see #getSource()
+ * @generated
+ */
+ void setSource(ENode value);
+
+ /**
+ * Returns the value of the '<em><b>Targets</b></em>' reference list.
+ * The list contents are of type {@link org.eclipse.emf.diffmerge.structures.model.egraphs.ENode}.
+ * It is bidirectional and its opposite is '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.ENode#getIncoming <em>Incoming</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Targets</em>' reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Targets</em>' reference list.
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage#getEHyperEdge_Targets()
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.ENode#getIncoming
+ * @model opposite="incoming"
+ * @generated
+ */
+ EList<ENode> getTargets();
+
+} // EHyperEdge
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/ENode.java b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/ENode.java
new file mode 100644
index 00000000..4a5863a0
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/ENode.java
@@ -0,0 +1,102 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>ENode</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.emf.diffmerge.structures.model.egraphs.ENode#getElement <em>Element</em>}</li>
+ * <li>{@link org.eclipse.emf.diffmerge.structures.model.egraphs.ENode#getOutgoing <em>Outgoing</em>}</li>
+ * <li>{@link org.eclipse.emf.diffmerge.structures.model.egraphs.ENode#getIncoming <em>Incoming</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage#getENode()
+ * @model
+ * @generated
+ */
+public interface ENode extends EObject {
+ /**
+ * Returns the value of the '<em><b>Element</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Element</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Element</em>' attribute.
+ * @see #setElement(String)
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage#getENode_Element()
+ * @model required="true"
+ * @generated
+ */
+ String getElement();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.ENode#getElement <em>Element</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Element</em>' attribute.
+ * @see #getElement()
+ * @generated
+ */
+ void setElement(String value);
+
+ /**
+ * Returns the value of the '<em><b>Outgoing</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge}.
+ * It is bidirectional and its opposite is '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge#getSource <em>Source</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Outgoing</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Outgoing</em>' containment reference list.
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage#getENode_Outgoing()
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge#getSource
+ * @model opposite="source" containment="true"
+ * @generated
+ */
+ EList<EHyperEdge> getOutgoing();
+
+ /**
+ * Returns the value of the '<em><b>Incoming</b></em>' reference list.
+ * The list contents are of type {@link org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge}.
+ * It is bidirectional and its opposite is '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge#getTargets <em>Targets</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Incoming</em>' reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Incoming</em>' reference list.
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage#getENode_Incoming()
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge#getTargets
+ * @model opposite="targets"
+ * @generated
+ */
+ EList<EHyperEdge> getIncoming();
+
+} // ENode
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/impl/EGraphImpl.java b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/impl/EGraphImpl.java
new file mode 100644
index 00000000..f8a9cb0d
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/impl/EGraphImpl.java
@@ -0,0 +1,163 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EGraph;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.ENode;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>EGraph</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.emf.diffmerge.structures.model.egraphs.impl.EGraphImpl#getContents <em>Contents</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class EGraphImpl extends MinimalEObjectImpl.Container implements EGraph {
+ /**
+ * The cached value of the '{@link #getContents() <em>Contents</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getContents()
+ * @generated
+ * @ordered
+ */
+ protected EList<ENode> contents;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EGraphImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return EGraphsPackage.Literals.EGRAPH;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<ENode> getContents() {
+ if (contents == null) {
+ contents = new EObjectContainmentEList<ENode>(ENode.class, this, EGraphsPackage.EGRAPH__CONTENTS);
+ }
+ return contents;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case EGraphsPackage.EGRAPH__CONTENTS:
+ return ((InternalEList<?>)getContents()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case EGraphsPackage.EGRAPH__CONTENTS:
+ return getContents();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case EGraphsPackage.EGRAPH__CONTENTS:
+ getContents().clear();
+ getContents().addAll((Collection<? extends ENode>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case EGraphsPackage.EGRAPH__CONTENTS:
+ getContents().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case EGraphsPackage.EGRAPH__CONTENTS:
+ return contents != null && !contents.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //EGraphImpl
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/impl/EGraphsFactoryImpl.java b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/impl/EGraphsFactoryImpl.java
new file mode 100644
index 00000000..663c3ff4
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/impl/EGraphsFactoryImpl.java
@@ -0,0 +1,129 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs.impl;
+
+import org.eclipse.emf.diffmerge.structures.model.egraphs.*;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class EGraphsFactoryImpl extends EFactoryImpl implements EGraphsFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static EGraphsFactory init() {
+ try {
+ EGraphsFactory theEGraphsFactory = (EGraphsFactory)EPackage.Registry.INSTANCE.getEFactory(EGraphsPackage.eNS_URI);
+ if (theEGraphsFactory != null) {
+ return theEGraphsFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new EGraphsFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EGraphsFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case EGraphsPackage.EGRAPH: return createEGraph();
+ case EGraphsPackage.ENODE: return createENode();
+ case EGraphsPackage.EHYPER_EDGE: return createEHyperEdge();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EGraph createEGraph() {
+ EGraphImpl eGraph = new EGraphImpl();
+ return eGraph;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ENode createENode() {
+ ENodeImpl eNode = new ENodeImpl();
+ return eNode;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EHyperEdge createEHyperEdge() {
+ EHyperEdgeImpl eHyperEdge = new EHyperEdgeImpl();
+ return eHyperEdge;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EGraphsPackage getEGraphsPackage() {
+ return (EGraphsPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static EGraphsPackage getPackage() {
+ return EGraphsPackage.eINSTANCE;
+ }
+
+} //EGraphsFactoryImpl
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/impl/EGraphsPackageImpl.java b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/impl/EGraphsPackageImpl.java
new file mode 100644
index 00000000..711c9fbb
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/impl/EGraphsPackageImpl.java
@@ -0,0 +1,298 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs.impl;
+
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EGraph;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsFactory;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.ENode;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class EGraphsPackageImpl extends EPackageImpl implements EGraphsPackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass eGraphEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass eNodeEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass eHyperEdgeEClass = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * <p>Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private EGraphsPackageImpl() {
+ super(eNS_URI, EGraphsFactory.eINSTANCE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
+ *
+ * <p>This method is used to initialize {@link EGraphsPackage#eINSTANCE} when that field is accessed.
+ * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static EGraphsPackage init() {
+ if (isInited) return (EGraphsPackage)EPackage.Registry.INSTANCE.getEPackage(EGraphsPackage.eNS_URI);
+
+ // Obtain or create and register package
+ EGraphsPackageImpl theEGraphsPackage = (EGraphsPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EGraphsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new EGraphsPackageImpl());
+
+ isInited = true;
+
+ // Create package meta-data objects
+ theEGraphsPackage.createPackageContents();
+
+ // Initialize created meta-data
+ theEGraphsPackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theEGraphsPackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(EGraphsPackage.eNS_URI, theEGraphsPackage);
+ return theEGraphsPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getEGraph() {
+ return eGraphEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getEGraph_Contents() {
+ return (EReference)eGraphEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getENode() {
+ return eNodeEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getENode_Element() {
+ return (EAttribute)eNodeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getENode_Outgoing() {
+ return (EReference)eNodeEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getENode_Incoming() {
+ return (EReference)eNodeEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getEHyperEdge() {
+ return eHyperEdgeEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getEHyperEdge_Label() {
+ return (EAttribute)eHyperEdgeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getEHyperEdge_Source() {
+ return (EReference)eHyperEdgeEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getEHyperEdge_Targets() {
+ return (EReference)eHyperEdgeEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EGraphsFactory getEGraphsFactory() {
+ return (EGraphsFactory)getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createPackageContents() {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ eGraphEClass = createEClass(EGRAPH);
+ createEReference(eGraphEClass, EGRAPH__CONTENTS);
+
+ eNodeEClass = createEClass(ENODE);
+ createEAttribute(eNodeEClass, ENODE__ELEMENT);
+ createEReference(eNodeEClass, ENODE__OUTGOING);
+ createEReference(eNodeEClass, ENODE__INCOMING);
+
+ eHyperEdgeEClass = createEClass(EHYPER_EDGE);
+ createEAttribute(eHyperEdgeEClass, EHYPER_EDGE__LABEL);
+ createEReference(eHyperEdgeEClass, EHYPER_EDGE__SOURCE);
+ createEReference(eHyperEdgeEClass, EHYPER_EDGE__TARGETS);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void initializePackageContents() {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+
+ // Initialize classes, features, and operations; add parameters
+ initEClass(eGraphEClass, EGraph.class, "EGraph", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getEGraph_Contents(), this.getENode(), null, "contents", null, 0, -1, EGraph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(eNodeEClass, ENode.class, "ENode", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getENode_Element(), ecorePackage.getEString(), "element", null, 1, 1, ENode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getENode_Outgoing(), this.getEHyperEdge(), this.getEHyperEdge_Source(), "outgoing", null, 0, -1, ENode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getENode_Incoming(), this.getEHyperEdge(), this.getEHyperEdge_Targets(), "incoming", null, 0, -1, ENode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(eHyperEdgeEClass, EHyperEdge.class, "EHyperEdge", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getEHyperEdge_Label(), ecorePackage.getEString(), "label", null, 0, 1, EHyperEdge.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getEHyperEdge_Source(), this.getENode(), this.getENode_Outgoing(), "source", null, 1, 1, EHyperEdge.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getEHyperEdge_Targets(), this.getENode(), this.getENode_Incoming(), "targets", null, 0, -1, EHyperEdge.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Create resource
+ createResource(eNS_URI);
+ }
+
+} //EGraphsPackageImpl
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/impl/EHyperEdgeImpl.java b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/impl/EHyperEdgeImpl.java
new file mode 100644
index 00000000..25ceea21
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/impl/EHyperEdgeImpl.java
@@ -0,0 +1,320 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.ENode;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>EHyper Edge</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.emf.diffmerge.structures.model.egraphs.impl.EHyperEdgeImpl#getLabel <em>Label</em>}</li>
+ * <li>{@link org.eclipse.emf.diffmerge.structures.model.egraphs.impl.EHyperEdgeImpl#getSource <em>Source</em>}</li>
+ * <li>{@link org.eclipse.emf.diffmerge.structures.model.egraphs.impl.EHyperEdgeImpl#getTargets <em>Targets</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class EHyperEdgeImpl extends MinimalEObjectImpl.Container implements EHyperEdge {
+ /**
+ * The default value of the '{@link #getLabel() <em>Label</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLabel()
+ * @generated
+ * @ordered
+ */
+ protected static final String LABEL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getLabel() <em>Label</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLabel()
+ * @generated
+ * @ordered
+ */
+ protected String label = LABEL_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getTargets() <em>Targets</em>}' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTargets()
+ * @generated
+ * @ordered
+ */
+ protected EList<ENode> targets;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EHyperEdgeImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return EGraphsPackage.Literals.EHYPER_EDGE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getLabel() {
+ return label;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setLabel(String newLabel) {
+ String oldLabel = label;
+ label = newLabel;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, EGraphsPackage.EHYPER_EDGE__LABEL, oldLabel, label));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ENode getSource() {
+ if (eContainerFeatureID() != EGraphsPackage.EHYPER_EDGE__SOURCE) return null;
+ return (ENode)eInternalContainer();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetSource(ENode newSource, NotificationChain msgs) {
+ msgs = eBasicSetContainer((InternalEObject)newSource, EGraphsPackage.EHYPER_EDGE__SOURCE, msgs);
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSource(ENode newSource) {
+ if (newSource != eInternalContainer() || (eContainerFeatureID() != EGraphsPackage.EHYPER_EDGE__SOURCE && newSource != null)) {
+ if (EcoreUtil.isAncestor(this, newSource))
+ throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
+ NotificationChain msgs = null;
+ if (eInternalContainer() != null)
+ msgs = eBasicRemoveFromContainer(msgs);
+ if (newSource != null)
+ msgs = ((InternalEObject)newSource).eInverseAdd(this, EGraphsPackage.ENODE__OUTGOING, ENode.class, msgs);
+ msgs = basicSetSource(newSource, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, EGraphsPackage.EHYPER_EDGE__SOURCE, newSource, newSource));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<ENode> getTargets() {
+ if (targets == null) {
+ targets = new EObjectWithInverseResolvingEList.ManyInverse<ENode>(ENode.class, this, EGraphsPackage.EHYPER_EDGE__TARGETS, EGraphsPackage.ENODE__INCOMING);
+ }
+ return targets;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case EGraphsPackage.EHYPER_EDGE__SOURCE:
+ if (eInternalContainer() != null)
+ msgs = eBasicRemoveFromContainer(msgs);
+ return basicSetSource((ENode)otherEnd, msgs);
+ case EGraphsPackage.EHYPER_EDGE__TARGETS:
+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getTargets()).basicAdd(otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case EGraphsPackage.EHYPER_EDGE__SOURCE:
+ return basicSetSource(null, msgs);
+ case EGraphsPackage.EHYPER_EDGE__TARGETS:
+ return ((InternalEList<?>)getTargets()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
+ switch (eContainerFeatureID()) {
+ case EGraphsPackage.EHYPER_EDGE__SOURCE:
+ return eInternalContainer().eInverseRemove(this, EGraphsPackage.ENODE__OUTGOING, ENode.class, msgs);
+ }
+ return super.eBasicRemoveFromContainerFeature(msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case EGraphsPackage.EHYPER_EDGE__LABEL:
+ return getLabel();
+ case EGraphsPackage.EHYPER_EDGE__SOURCE:
+ return getSource();
+ case EGraphsPackage.EHYPER_EDGE__TARGETS:
+ return getTargets();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case EGraphsPackage.EHYPER_EDGE__LABEL:
+ setLabel((String)newValue);
+ return;
+ case EGraphsPackage.EHYPER_EDGE__SOURCE:
+ setSource((ENode)newValue);
+ return;
+ case EGraphsPackage.EHYPER_EDGE__TARGETS:
+ getTargets().clear();
+ getTargets().addAll((Collection<? extends ENode>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case EGraphsPackage.EHYPER_EDGE__LABEL:
+ setLabel(LABEL_EDEFAULT);
+ return;
+ case EGraphsPackage.EHYPER_EDGE__SOURCE:
+ setSource((ENode)null);
+ return;
+ case EGraphsPackage.EHYPER_EDGE__TARGETS:
+ getTargets().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case EGraphsPackage.EHYPER_EDGE__LABEL:
+ return LABEL_EDEFAULT == null ? label != null : !LABEL_EDEFAULT.equals(label);
+ case EGraphsPackage.EHYPER_EDGE__SOURCE:
+ return getSource() != null;
+ case EGraphsPackage.EHYPER_EDGE__TARGETS:
+ return targets != null && !targets.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (label: ");
+ result.append(label);
+ result.append(')');
+ return result.toString();
+ }
+
+} //EHyperEdgeImpl
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/impl/ENodeImpl.java b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/impl/ENodeImpl.java
new file mode 100644
index 00000000..41969992
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/impl/ENodeImpl.java
@@ -0,0 +1,286 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.ENode;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
+import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>ENode</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.emf.diffmerge.structures.model.egraphs.impl.ENodeImpl#getElement <em>Element</em>}</li>
+ * <li>{@link org.eclipse.emf.diffmerge.structures.model.egraphs.impl.ENodeImpl#getOutgoing <em>Outgoing</em>}</li>
+ * <li>{@link org.eclipse.emf.diffmerge.structures.model.egraphs.impl.ENodeImpl#getIncoming <em>Incoming</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class ENodeImpl extends MinimalEObjectImpl.Container implements ENode {
+ /**
+ * The default value of the '{@link #getElement() <em>Element</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getElement()
+ * @generated
+ * @ordered
+ */
+ protected static final String ELEMENT_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getElement() <em>Element</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getElement()
+ * @generated
+ * @ordered
+ */
+ protected String element = ELEMENT_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getOutgoing() <em>Outgoing</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getOutgoing()
+ * @generated
+ * @ordered
+ */
+ protected EList<EHyperEdge> outgoing;
+
+ /**
+ * The cached value of the '{@link #getIncoming() <em>Incoming</em>}' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getIncoming()
+ * @generated
+ * @ordered
+ */
+ protected EList<EHyperEdge> incoming;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ENodeImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return EGraphsPackage.Literals.ENODE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getElement() {
+ return element;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setElement(String newElement) {
+ String oldElement = element;
+ element = newElement;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, EGraphsPackage.ENODE__ELEMENT, oldElement, element));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<EHyperEdge> getOutgoing() {
+ if (outgoing == null) {
+ outgoing = new EObjectContainmentWithInverseEList<EHyperEdge>(EHyperEdge.class, this, EGraphsPackage.ENODE__OUTGOING, EGraphsPackage.EHYPER_EDGE__SOURCE);
+ }
+ return outgoing;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<EHyperEdge> getIncoming() {
+ if (incoming == null) {
+ incoming = new EObjectWithInverseResolvingEList.ManyInverse<EHyperEdge>(EHyperEdge.class, this, EGraphsPackage.ENODE__INCOMING, EGraphsPackage.EHYPER_EDGE__TARGETS);
+ }
+ return incoming;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case EGraphsPackage.ENODE__OUTGOING:
+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getOutgoing()).basicAdd(otherEnd, msgs);
+ case EGraphsPackage.ENODE__INCOMING:
+ return ((InternalEList<InternalEObject>)(InternalEList<?>)getIncoming()).basicAdd(otherEnd, msgs);
+ }
+ return super.eInverseAdd(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case EGraphsPackage.ENODE__OUTGOING:
+ return ((InternalEList<?>)getOutgoing()).basicRemove(otherEnd, msgs);
+ case EGraphsPackage.ENODE__INCOMING:
+ return ((InternalEList<?>)getIncoming()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case EGraphsPackage.ENODE__ELEMENT:
+ return getElement();
+ case EGraphsPackage.ENODE__OUTGOING:
+ return getOutgoing();
+ case EGraphsPackage.ENODE__INCOMING:
+ return getIncoming();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case EGraphsPackage.ENODE__ELEMENT:
+ setElement((String)newValue);
+ return;
+ case EGraphsPackage.ENODE__OUTGOING:
+ getOutgoing().clear();
+ getOutgoing().addAll((Collection<? extends EHyperEdge>)newValue);
+ return;
+ case EGraphsPackage.ENODE__INCOMING:
+ getIncoming().clear();
+ getIncoming().addAll((Collection<? extends EHyperEdge>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case EGraphsPackage.ENODE__ELEMENT:
+ setElement(ELEMENT_EDEFAULT);
+ return;
+ case EGraphsPackage.ENODE__OUTGOING:
+ getOutgoing().clear();
+ return;
+ case EGraphsPackage.ENODE__INCOMING:
+ getIncoming().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case EGraphsPackage.ENODE__ELEMENT:
+ return ELEMENT_EDEFAULT == null ? element != null : !ELEMENT_EDEFAULT.equals(element);
+ case EGraphsPackage.ENODE__OUTGOING:
+ return outgoing != null && !outgoing.isEmpty();
+ case EGraphsPackage.ENODE__INCOMING:
+ return incoming != null && !incoming.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (element: ");
+ result.append(element);
+ result.append(')');
+ return result.toString();
+ }
+
+} //ENodeImpl
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/util/EGraphsAdapterFactory.java b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/util/EGraphsAdapterFactory.java
new file mode 100644
index 00000000..f842e0b9
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/util/EGraphsAdapterFactory.java
@@ -0,0 +1,168 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs.util;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.diffmerge.structures.model.egraphs.*;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage
+ * @generated
+ */
+public class EGraphsAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static EGraphsPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EGraphsAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = EGraphsPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EGraphsSwitch<Adapter> modelSwitch =
+ new EGraphsSwitch<Adapter>() {
+ @Override
+ public Adapter caseEGraph(EGraph object) {
+ return createEGraphAdapter();
+ }
+ @Override
+ public Adapter caseENode(ENode object) {
+ return createENodeAdapter();
+ }
+ @Override
+ public Adapter caseEHyperEdge(EHyperEdge object) {
+ return createEHyperEdgeAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.EGraph <em>EGraph</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EGraph
+ * @generated
+ */
+ public Adapter createEGraphAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.ENode <em>ENode</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.ENode
+ * @generated
+ */
+ public Adapter createENodeAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge <em>EHyper Edge</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge
+ * @generated
+ */
+ public Adapter createEHyperEdgeAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //EGraphsAdapterFactory
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/util/EGraphsResourceFactoryImpl.java b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/util/EGraphsResourceFactoryImpl.java
new file mode 100644
index 00000000..df421760
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/util/EGraphsResourceFactoryImpl.java
@@ -0,0 +1,53 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs.util;
+
+import org.eclipse.emf.common.util.URI;
+
+import org.eclipse.emf.ecore.resource.Resource;
+
+import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Resource Factory</b> associated with the package.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.util.EGraphsResourceImpl
+ * @generated
+ */
+public class EGraphsResourceFactoryImpl extends ResourceFactoryImpl {
+ /**
+ * Creates an instance of the resource factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EGraphsResourceFactoryImpl() {
+ super();
+ }
+
+ /**
+ * Creates an instance of the resource.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Resource createResource(URI uri) {
+ Resource result = new EGraphsResourceImpl(uri);
+ return result;
+ }
+
+} //EGraphsResourceFactoryImpl
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/util/EGraphsResourceImpl.java b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/util/EGraphsResourceImpl.java
new file mode 100644
index 00000000..30096719
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/util/EGraphsResourceImpl.java
@@ -0,0 +1,40 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs.util;
+
+import org.eclipse.emf.common.util.URI;
+
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Resource </b> associated with the package.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.util.EGraphsResourceFactoryImpl
+ * @generated
+ */
+public class EGraphsResourceImpl extends XMIResourceImpl {
+ /**
+ * Creates an instance of the resource.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param uri the URI of the new resource.
+ * @generated
+ */
+ public EGraphsResourceImpl(URI uri) {
+ super(uri);
+ }
+
+} //EGraphsResourceImpl
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/util/EGraphsSwitch.java b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/util/EGraphsSwitch.java
new file mode 100644
index 00000000..edbb7afd
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/egraphs/util/EGraphsSwitch.java
@@ -0,0 +1,180 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.egraphs.util;
+
+import java.util.List;
+
+import org.eclipse.emf.diffmerge.structures.model.egraphs.*;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsPackage
+ * @generated
+ */
+public class EGraphsSwitch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static EGraphsPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EGraphsSwitch() {
+ if (modelPackage == null) {
+ modelPackage = EGraphsPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ public T doSwitch(EObject theEObject) {
+ return doSwitch(theEObject.eClass(), theEObject);
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ protected T doSwitch(EClass theEClass, EObject theEObject) {
+ if (theEClass.eContainer() == modelPackage) {
+ return doSwitch(theEClass.getClassifierID(), theEObject);
+ }
+ else {
+ List<EClass> eSuperTypes = theEClass.getESuperTypes();
+ return
+ eSuperTypes.isEmpty() ?
+ defaultCase(theEObject) :
+ doSwitch(eSuperTypes.get(0), theEObject);
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case EGraphsPackage.EGRAPH: {
+ EGraph eGraph = (EGraph)theEObject;
+ T result = caseEGraph(eGraph);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case EGraphsPackage.ENODE: {
+ ENode eNode = (ENode)theEObject;
+ T result = caseENode(eNode);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case EGraphsPackage.EHYPER_EDGE: {
+ EHyperEdge eHyperEdge = (EHyperEdge)theEObject;
+ T result = caseEHyperEdge(eHyperEdge);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EGraph</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EGraph</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseEGraph(EGraph object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>ENode</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>ENode</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseENode(ENode object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EHyper Edge</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EHyper Edge</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseEHyperEdge(EHyperEdge object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //EGraphsSwitch
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/integration/EImpact.java b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/integration/EImpact.java
new file mode 100644
index 00000000..05f4eab4
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/integration/EImpact.java
@@ -0,0 +1,60 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.integration;
+
+import java.util.Collection;
+
+import org.eclipse.emf.diffmerge.structures.IEqualityTester;
+import org.eclipse.emf.diffmerge.structures.endo.qualified.IRangedQEndorelation;
+import org.eclipse.emf.diffmerge.structures.impacts.CachingImpact;
+import org.eclipse.emf.diffmerge.structures.impacts.IImpactRule;
+
+
+/**
+ * An EMF-based implementation of an impact.
+ *
+ * @author Olivier Constant
+ */
+public class EImpact extends CachingImpact {
+
+ /**
+ * Constructor
+ * @param origins_p the non-null set of sources of the impact
+ * @param rules_p the non-null set of impact rules
+ */
+ public EImpact(Collection<?> origins_p, Collection<IImpactRule> rules_p) {
+ this(origins_p, rules_p, null);
+ }
+
+ /**
+ * Constructor
+ * @param origins_p the non-null set of sources of the impact
+ * @param rules_p the non-null set of impact rules
+ * @param tester_p a potentially null equality tester
+ */
+ public EImpact(Collection<?> origins_p, Collection<IImpactRule> rules_p,
+ IEqualityTester tester_p) {
+ super(origins_p, rules_p, tester_p);
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.util.relations.endo.qualified.IncQEndorelation#newExploredSubset()
+ */
+ @Override
+ protected IRangedQEndorelation.Editable<Object, IImpactRule> newExploredSubset() {
+ return new EImpactExploredSubset(defaultQualifier(), getEqualityTester());
+ }
+
+}
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/integration/EImpactExploredSubset.java b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/integration/EImpactExploredSubset.java
new file mode 100644
index 00000000..941d573b
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/integration/EImpactExploredSubset.java
@@ -0,0 +1,69 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.integration;
+
+import org.eclipse.emf.diffmerge.structures.IEqualityTester;
+import org.eclipse.emf.diffmerge.structures.binary.qualified.IRangedQBinaryRelation;
+import org.eclipse.emf.diffmerge.structures.endo.qualified.EditableQEndorelation;
+import org.eclipse.emf.diffmerge.structures.impacts.IImpactRule;
+
+
+/**
+ * An EMF-based implementation of a qualified endorelation.
+ *
+ * @author Olivier Constant
+ */
+public class EImpactExploredSubset extends EditableQEndorelation<Object, IImpactRule> {
+
+ /** The potentially null default qualifier */
+ private final IImpactRule _defaultQualifier;
+
+
+ /**
+ * Constructor for the default equality tester (by reference)
+ * @param defaultQualifier_p the potentially null default qualifier
+ */
+ public EImpactExploredSubset(IImpactRule defaultQualifier_p) {
+ this(defaultQualifier_p, null);
+ }
+
+ /**
+ * Constructor
+ * @param defaultQualifier_p the potentially null default qualifier
+ * @param tester_p a potentially null equality tester for comparing elements
+ */
+ public EImpactExploredSubset(IImpactRule defaultQualifier_p, IEqualityTester tester_p) {
+ super(tester_p);
+ _defaultQualifier = defaultQualifier_p;
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.util.relations.binary.qualified.AbstractQBinaryRelation#defaultQualifier()
+ */
+ @Override
+ public IImpactRule defaultQualifier() {
+ return _defaultQualifier;
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.util.relations.endo.qualified.EditableQEndorelation#newContents(org.eclipse.emf.diffmerge.util.structures.IEqualityTester)
+ */
+ @Override
+ protected IRangedQBinaryRelation.Editable<Object, Object, IImpactRule> newContents(
+ IEqualityTester tester_p) {
+ return new GraphQBinaryRelation(tester_p);
+ }
+
+}
diff --git a/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/integration/GraphQBinaryRelation.java b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/integration/GraphQBinaryRelation.java
new file mode 100644
index 00000000..6d4be162
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.structures.model/src/org/eclipse/emf/diffmerge/structures/model/integration/GraphQBinaryRelation.java
@@ -0,0 +1,472 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2017 Thales Global Services S.A.S.
+ * 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:
+ * Thales Global Services S.A.S. - initial API and implementation
+ *
+ * </copyright>
+ */
+package org.eclipse.emf.diffmerge.structures.model.integration;
+
+import static org.eclipse.emf.diffmerge.structures.Relations.qualifiedCopyInto;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.emf.common.util.EMap;
+import org.eclipse.emf.diffmerge.structures.IEqualityTester;
+import org.eclipse.emf.diffmerge.structures.binary.qualified.AbstractQBinaryRelation;
+import org.eclipse.emf.diffmerge.structures.binary.qualified.IQBinaryRelation;
+import org.eclipse.emf.diffmerge.structures.binary.qualified.IRangedQBinaryRelation;
+import org.eclipse.emf.diffmerge.structures.common.FArrayList;
+import org.eclipse.emf.diffmerge.structures.common.FHashMap;
+import org.eclipse.emf.diffmerge.structures.common.FHashSet;
+import org.eclipse.emf.diffmerge.structures.common.FLinkedList;
+import org.eclipse.emf.diffmerge.structures.common.FOrderedSet;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EGraph;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EGraphsFactory;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.EHyperEdge;
+import org.eclipse.emf.diffmerge.structures.model.egraphs.ENode;
+
+
+/**
+ * An implementation of modifiable finite, qualified binary relations whose
+ * internal state is defined as a graph.
+ * @see org.eclipse.emf.diffmerge.util.relations.binary.qualified.IQBinaryRelation
+ *
+ * @param <T> the type of the domain elements
+ * @param <U> the type of the codomain elements
+ * @param <Q> the type of the qualifiers
+ * @author Olivier Constant
+ */
+public class GraphQBinaryRelation<T, U, Q> extends AbstractQBinaryRelation<T, U, Q>
+implements IQBinaryRelation.Invertible<T, U, Q> {
+
+ /** The non-null internal state */
+ protected final EGraph _state;
+
+ /** The non-null (element -> node) cache. */
+ protected final EMap<Object, ENode> _cache;
+
+
+ /**
+ * Constructor for the default equality tester (by reference)
+ */
+ public GraphQBinaryRelation() {
+ this((IEqualityTester)null);
+ }
+
+ /**
+ * Constructor
+ * @param tester_p a potentially null equality tester for comparing elements
+ * (null means default)
+ */
+ public GraphQBinaryRelation(IEqualityTester tester_p) {
+ this(null, tester_p);
+ }
+
+ /**
+ * Constructor
+ * @param tester_p a potentially null equality tester for comparing elements
+ * (null means default)
+ * @param initialContents_p a potentially null initial state
+ */
+ public GraphQBinaryRelation(EGraph initialContents_p, IEqualityTester tester_p) {
+ super(tester_p);
+ _state = initialContents_p != null? initialContents_p:
+ EGraphsFactory.eINSTANCE.createEGraph();
+ _cache = new FHashMap<Object, ENode>(getEqualityTester());
+ if (initialContents_p != null) {
+ for (ENode node : initialContents_p.getContents()) {
+ _cache.put(node.getElement(), node);
+ }
+ }
+ }
+
+ /**
+ * Constructor
+ * @param initialContents_p a non-null ranged qualified binary relation defining the
+ * initial contents of this relation
+ */
+ public GraphQBinaryRelation(
+ IRangedQBinaryRelation<T, U, Q> initialContents_p) {
+ this(initialContents_p.getEqualityTester());
+ qualifiedCopyInto(initialContents_p, this);
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.util.relations.binary.qualified.IQBinaryRelation.Editable#add(java.lang.Object, java.lang.Object, java.lang.Object)
+ */
+ public boolean add(T source_p, U target_p, Q qualifier_p) {
+ EHyperEdge edge = getCreateEdge(source_p, qualifier_p);
+ ENode targetNode = getCreateNode(target_p);
+ boolean result = edge.getTargets().add(targetNode);
+ return result;
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.util.relations.binary.qualified.IQBinaryRelation.Editable#addAll(java.lang.Object, java.util.Collection, java.lang.Object)
+ */
+ public boolean addAll(T source_p, Collection<? extends U> targets_p, Q qualifier_p) {
+ EHyperEdge edge = getCreateEdge(source_p, qualifier_p);
+ boolean result = false;
+ for (U target : targets_p) {
+ ENode targetNode = getCreateNode(target);
+ boolean actuallyAdded = edge.getTargets().add(targetNode);
+ result = result || actuallyAdded;
+ }
+ return result;
+ }
+
+ /**
+ * Check whether the given edge must be removed after the removal
+ * of at least one of its targets
+ * @param node_p a non-null node
+ * @return whether it was removed
+ */
+ protected boolean checkGarbage(EHyperEdge edge_p) {
+ boolean result = false;
+ if (edge_p.getTargets().isEmpty()) {
+ result = true;
+ ENode sourceNode = edge_p.getSource();
+ edge_p.setSource(null);
+ if (sourceNode != null)
+ checkGarbage(sourceNode);
+ }
+ return result;
+ }
+
+ /**
+ * Check whether the given node must be removed
+ * @param node_p a non-null node
+ * @return whether it was removed
+ */
+ protected boolean checkGarbage(ENode node_p) {
+ boolean result = false;
+ if (node_p.getIncoming().isEmpty() && node_p.getOutgoing().isEmpty()) {
+ result = _state.getContents().remove(node_p);
+ _cache.removeKey(node_p.getElement());
+ }
+ return result;
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.util.relations.binary.IBinaryRelation.Editable#clear()
+ */
+ public void clear() {
+ _state.getContents().clear();
+ _cache.clear();
+ }
+
+ /**
+ * Return, and create if needed, the outgoing edge for the given element through
+ * the given qualifier
+ * @param source_p a non-null element
+ * @param qualifier_p a non-null qualifier
+ * @return a non-null, potentially empty, modifiable collection for storing targets
+ */
+ protected EHyperEdge getCreateEdge(T source_p, Q qualifier_p) {
+ ENode node = getCreateNode(source_p);
+ EHyperEdge edge = getOutgoingEdge(node, qualifier_p);
+ if (edge == null) {
+ edge = EGraphsFactory.eINSTANCE.createEHyperEdge();
+ edge.setLabel(qualifier_p.toString());
+ edge.setSource(node);
+ }
+ return edge;
+ }
+
+ /**
+ * Return, and create if needed, the node for the given element
+ * @param element_p a non-null element
+ * @return a non-null, potentially empty, modifiable collection for storing targets
+ */
+ protected ENode getCreateNode(Object element_p) {
+ ENode result = _cache.get(element_p);
+ if (result == null) {
+ result = EGraphsFactory.eINSTANCE.createENode();
+ result.setElement(element_p.toString());
+ _state.getContents().add(result);
+ _cache.put(element_p, result);
+ }
+ return result;
+ }
+
+ /**
+ * Return the edge for the given qualifier on the given node, if any
+ * @param node_p a non-null node
+ * @param qualifier_p a potentially null qualifier
+ * @return a potentially null edge
+ */
+ protected EHyperEdge getOutgoingEdge(ENode node_p, Q qualifier_p) {
+ IEqualityTester tester = getEqualityTester();
+ for (EHyperEdge edge : node_p.getOutgoing()) {
+ if (tester.areEqual(qualifier_p, edge.getLabel()))
+ return edge;
+ }
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.util.relations.binary.qualified.IQBinaryRelation.Invertible#getInverse(java.lang.Object)
+ */
+ public Collection<T> getInverse(U element_p) {
+ Collection<T> result;
+ ENode node = _cache.get(element_p);
+ if (node != null) {
+ result = new FOrderedSet<T>(getEqualityTester());
+ for (EHyperEdge edge : node.getIncoming()) {
+ result.add((T)edge.getSource().getElement());
+ }
+ result = Collections.unmodifiableCollection(result);
+ } else {
+ result = Collections.emptySet();
+ }
+ return result;
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.util.relations.binary.qualified.IQBinaryRelation.Invertible#getInverse(java.lang.Object, java.lang.Object)
+ */
+ public Collection<T> getInverse(U element_p, Q qualifier_p) {
+ Collection<T> result;
+ IEqualityTester tester = getEqualityTester();
+ ENode node = _cache.get(element_p);
+ if (node != null) {
+ result = new FOrderedSet<T>(tester);
+ for (EHyperEdge edge : node.getIncoming()) {
+ if (tester.areEqual(qualifier_p, edge.getLabel()))
+ result.add((T)edge.getSource().getElement());
+ }
+ result = Collections.unmodifiableCollection(result);
+ } else {
+ result = Collections.emptySet();
+ }
+ return result;
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.util.relations.binary.qualified.IQBinaryRelation.Invertible#getInverseQualifiers(java.lang.Object)
+ */
+ public Collection<Q> getInverseQualifiers(U element_p) {
+ Collection<Q> result;
+ ENode node = _cache.get(element_p);
+ if (node != null) {
+ result = new FOrderedSet<Q>(getEqualityTester());
+ for (EHyperEdge edge : node.getIncoming()) {
+ result.add((Q)edge.getLabel());
+ }
+ result = Collections.unmodifiableCollection(result);
+ } else {
+ result = Collections.emptySet();
+ }
+ return result;
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.util.relations.binary.qualified.IQBinaryRelation.Invertible#getInverseWithDetails(java.lang.Object)
+ */
+ public Map<Q, Collection<T>> getInverseWithDetails(U element_p) {
+ IEqualityTester tester = getEqualityTester();
+ EMap<Q, Collection<T>> result = new FHashMap<Q, Collection<T>>(tester);
+ ENode node = _cache.get(element_p);
+ if (node != null) {
+ for (EHyperEdge edge : node.getIncoming()) {
+ Q qualifier = (Q)edge.getLabel();
+ Collection<T> sources = result.get(qualifier);
+ if (sources == null) {
+ sources = new FArrayList<T>(tester);
+ result.put(qualifier, sources);
+ }
+ T source = (T)edge.getSource().getElement();
+ sources.add(source);
+ }
+ }
+ return Collections.unmodifiableMap(result.map());
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.util.relations.binary.qualified.IRangedQBinaryRelation#getQualifiers()
+ */
+ public Collection<Q> getQualifiers() {
+ Set<Q> result = new FHashSet<Q>(getEqualityTester());
+ for (ENode node : _state.getContents()) {
+ result.addAll(getQualifiers((T)node.getElement()));
+ }
+ return Collections.unmodifiableSet(result);
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.util.relations.binary.IRangedBinaryRelation#getSources()
+ */
+ public Collection<T> getSources() {
+ Collection<T> result = new FLinkedList<T>(getEqualityTester());
+ for (ENode node : _state.getContents()) {
+ if (!node.getOutgoing().isEmpty())
+ result.add((T)node.getElement());
+ }
+ return Collections.unmodifiableCollection(result);
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.util.relations.binary.IRangedBinaryRelation#getTargets()
+ */
+ public Collection<U> getTargets() {
+ Collection<U> result = new FLinkedList<U>(getEqualityTester());
+ for (ENode node : _state.getContents()) {
+ if (!node.getIncoming().isEmpty())
+ result.add((U)node.getElement());
+ }
+ return Collections.unmodifiableCollection(result);
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.util.relations.binary.qualified.IQBinaryRelation#getWithDetails(java.lang.Object)
+ */
+ public Map<Q, Collection<U>> getWithDetails(T element_p) {
+ EMap<Q, Collection<U>> result = new FHashMap<Q, Collection<U>>(getEqualityTester());
+ ENode node = _cache.get(element_p);
+ if (node != null) {
+ for (EHyperEdge edge : node.getOutgoing()) {
+ Collection<U> targets = (Collection)Collections.unmodifiableCollection(
+ edge.getTargets());
+ result.put((Q)edge.getLabel(), targets);
+ }
+ }
+ return Collections.unmodifiableMap(result.map());
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.util.relations.binary.IBinaryRelation.Editable#remove(java.lang.Object, java.lang.Object)
+ */
+ public boolean remove(T source_p, U target_p) {
+ boolean result = false;
+ ENode sourceNode = _cache.get(source_p);
+ ENode targetNode = _cache.get(target_p);
+ if (sourceNode != null && targetNode != null) {
+ for (EHyperEdge edge : sourceNode.getOutgoing()) {
+ boolean actuallyRemoved = edge.getTargets().remove(targetNode);
+ result = result || actuallyRemoved;
+ if (actuallyRemoved)
+ checkGarbage(edge);
+ }
+ if (result) {
+ checkGarbage(sourceNode);
+ checkGarbage(targetNode);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.util.relations.binary.qualified.IQBinaryRelation.Editable#remove(java.lang.Object, java.lang.Object, java.lang.Object)
+ */
+ public boolean remove(T source_p, U target_p, Q qualifier_p) {
+ boolean result = false;
+ ENode sourceNode = _cache.get(source_p);
+ ENode targetNode = _cache.get(target_p);
+ if (sourceNode != null && targetNode != null) {
+ EHyperEdge edge = getOutgoingEdge(sourceNode, qualifier_p);
+ if (edge != null) {
+ result = edge.getTargets().remove(targetNode);
+ if (result) {
+ checkGarbage(edge);
+ checkGarbage(sourceNode);
+ checkGarbage(targetNode);
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.util.relations.binary.qualified.IRangedQBinaryRelation.Editable#removeQualifier(java.lang.Object)
+ */
+ public boolean removeQualifier(Q qualifier_p) {
+ boolean result = false;
+ for (ENode node : new FLinkedList<ENode>(_state.getContents(), null)) {
+ boolean actuallyRemoved = removeQualifier(node, qualifier_p);
+ result = result || actuallyRemoved;
+ }
+ return result;
+ }
+
+ /**
+ * Remove the edge corresponding to the given qualifier on the given node
+ * @param source_p a non-null node
+ * @param qualifier_p a non-null qualifier
+ * @return whether the operation had an actual effect
+ */
+ protected boolean removeQualifier(ENode sourceNode_p, Q qualifier_p) {
+ boolean result = false;
+ EHyperEdge edge = getOutgoingEdge(sourceNode_p, qualifier_p);
+ if (edge != null) {
+ result = true;
+ Collection<ENode> targetNodes = new FLinkedList<ENode>(edge.getTargets(), null);
+ edge.getTargets().clear();
+ for (ENode targetNode : targetNodes) {
+ checkGarbage(targetNode);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.util.relations.binary.qualified.IQBinaryRelation.Editable#removeQualifier(java.lang.Object, java.lang.Object)
+ */
+ public boolean removeQualifier(T source_p, Q qualifier_p) {
+ boolean result = false;
+ ENode sourceNode = _cache.get(source_p);
+ if (sourceNode != null)
+ result = removeQualifier(sourceNode, qualifier_p);
+ return result;
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.util.relations.binary.IRangedBinaryRelation.Editable#removeSource(java.lang.Object)
+ */
+ public boolean removeSource(T source_p) {
+ boolean result = false;
+ ENode node = _cache.get(source_p);
+ if (node != null) {
+ result = !node.getOutgoing().isEmpty();
+ for (EHyperEdge edge : node.getOutgoing()) {
+ Collection<ENode> targetNodes = new FLinkedList<ENode>(edge.getTargets(), null);
+ edge.getTargets().clear();
+ for (ENode targetNode : targetNodes) {
+ checkGarbage(targetNode);
+ }
+ }
+ node.getOutgoing().clear();
+ checkGarbage(node);
+ }
+ return result;
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.util.relations.binary.IRangedBinaryRelation.Editable#removeTarget(java.lang.Object)
+ */
+ public boolean removeTarget(U target_p) {
+ boolean result = false;
+ ENode node = _cache.get(target_p);
+ if (node != null) {
+ for (EHyperEdge edge : new FLinkedList<EHyperEdge>(node.getIncoming(), null)) {
+ boolean actuallyRemoved = edge.getTargets().remove(node);
+ result = result || actuallyRemoved;
+ checkGarbage(edge);
+ }
+ if (result)
+ checkGarbage(node);
+ }
+ return result;
+ }
+
+}

Back to the top