Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2014-01-22 09:12:55 +0000
committerptessier2014-01-22 09:12:55 +0000
commitdce8398f8c59a125d0908ec7ad7e33eec2cd9f85 (patch)
treeca6b0c90fd686bc8396dc4cc0e5340776550c71a /extraplugins
parente22498da9368936542b7c7e522b7d88e1de50331 (diff)
downloadorg.eclipse.papyrus-dce8398f8c59a125d0908ec7ad7e33eec2cd9f85.tar.gz
org.eclipse.papyrus-dce8398f8c59a125d0908ec7ad7e33eec2cd9f85.tar.xz
org.eclipse.papyrus-dce8398f8c59a125d0908ec7ad7e33eec2cd9f85.zip
386118: [EMF Facet] Papyrus should progressively support EMF Facet 0.2
https://bugs.eclipse.org/bugs/show_bug.cgi?id=386118 move /org.eclipse.papyrus.infra.emf.nattable.converter /org.eclipse.papyrus.infra.table.instance /org.eclipse.papyrus.infra.table.modelexplorer to extraplugins tablemigration
Diffstat (limited to 'extraplugins')
-rw-r--r--extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/.classpath7
-rw-r--r--extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/.project28
-rw-r--r--extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/META-INF/MANIFEST.MF27
-rw-r--r--extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/OSGI-INF/l10n/bundle.properties3
-rw-r--r--extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/about.html28
-rw-r--r--extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/build.properties9
-rw-r--r--extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/plugin.pdoc4
-rw-r--r--extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/plugin.xml39
-rw-r--r--extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/Activator.java71
-rw-r--r--extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/handlers/ConvertAllTablesHandler.java61
-rw-r--r--extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/handlers/ConvertOldTableHandler.java422
-rw-r--r--extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/messages/Messages.java33
-rw-r--r--extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/messages/messages.properties9
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/.classpath8
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/.project28
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/META-INF/MANIFEST.MF33
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/about.html28
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/build.properties8
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/custom-src/org/eclipse/papyrus/infra/table/instance/util/TableContentsUtils.java200
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/model/papyrustableinstance.ecore48
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/model/papyrustableinstance.genmodel19
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/plugin.properties2
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/plugin.xml20
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/Activator.java67
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/PapyrusTableInstance.java212
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/PapyrustableinstanceFactory.java46
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/PapyrustableinstancePackage.java332
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/impl/PapyrusTableInstanceImpl.java498
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/impl/PapyrustableinstanceFactoryImpl.java99
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/impl/PapyrustableinstancePackageImpl.java262
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/util/PapyrustableinstanceAdapterFactory.java143
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/util/PapyrustableinstanceSwitch.java131
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/.classpath7
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/.project28
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/META-INF/MANIFEST.MF37
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/about.html28
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/build.properties12
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/documentation.pdoc4
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/icons/table.pngbin0 -> 1347 bytes
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/plugin.properties3
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/plugin.xml59
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableFacet.facetSet12
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableFacetCustomization.uiCustom17
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableInstanceCustomization.uiCustom28
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableQuery.querySet23
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/Activator.java121
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/AbstractTableModelExplorerHandler.java61
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DeleteTableHandler.java71
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DuplicateTableHandler.java82
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/RenameTableHandler.java84
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/messages/Messages.java34
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/messages/messages.properties3
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/providers/TablePropertyTester.java85
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetContainedTables.java65
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetTableIcon.java33
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetTableName.java31
-rw-r--r--extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/IsTableContainer.java63
60 files changed, 3934 insertions, 0 deletions
diff --git a/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/.classpath b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/.classpath
new file mode 100644
index 00000000000..8a8f1668cdc
--- /dev/null
+++ b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/.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.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/.project b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/.project
new file mode 100644
index 00000000000..f5d365ab83a
--- /dev/null
+++ b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.emf.nattable.converter</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/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/.settings/org.eclipse.jdt.core.prefs b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..f287d53cf45
--- /dev/null
+++ b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/.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.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/META-INF/MANIFEST.MF b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..68b127c8adc
--- /dev/null
+++ b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/META-INF/MANIFEST.MF
@@ -0,0 +1,27 @@
+Manifest-Version: 1.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.table.instance;bundle-version="1.0.0",
+ org.eclipse.emf.facet.widgets.nattable.instance;bundle-version="0.3.0",
+ org.eclipse.core.expressions,
+ org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.emf;bundle-version="1.0.0",
+ org.eclipse.emf.transaction;bundle-version="1.4.0",
+ org.eclipse.papyrus.infra.nattable;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.nattable.model;bundle-version="1.0.0",
+ org.eclipse.gmf.runtime.emf.type.core,
+ org.eclipse.papyrus.infra.services.edit;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.nattable.common;bundle-version="1.0.0"
+Bundle-Vendor: %Bundle-Vendor
+Bundle-ActivationPolicy: lazy
+Bundle-Version: 1.0.0.qualifier
+Bundle-Name: %Bundle-Name
+Bundle-ManifestVersion: 2
+Bundle-Activator: org.eclipse.papyrus.uml.nattable.converter.Activator
+Bundle-SymbolicName: org.eclipse.papyrus.infra.emf.nattable.converter;
+ singleton:=true
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+
diff --git a/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/OSGI-INF/l10n/bundle.properties b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000000..e26619d4d2f
--- /dev/null
+++ b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.papyrus.uml.nattable.converter
+Bundle-Vendor = Eclipse Modeling Project
+Bundle-Name = Old Table Converter (Incubation) \ No newline at end of file
diff --git a/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/about.html b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/about.html
new file mode 100644
index 00000000000..598b3684879
--- /dev/null
+++ b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>May 12, 2008</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/build.properties b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/build.properties
new file mode 100644
index 00000000000..1961e7848c9
--- /dev/null
+++ b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/build.properties
@@ -0,0 +1,9 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.pdoc,\
+ about.html,\
+ OSGI-INF/
+src.includes = about.html
diff --git a/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/plugin.pdoc b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/plugin.pdoc
new file mode 100644
index 00000000000..e76e9322193
--- /dev/null
+++ b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/plugin.pdoc
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<doc:Documentation xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:doc="http://www.eclipse.org/papyrus/documentation/plugin/documentation" description="This plugin provides handlers to convert the old tables to the new tables">
+ <referent firstName="vincent" lastName="lorenzo" eMail="vincent.lorenzo@cea.fr" currentCompany="CEA-LIST"/>
+</doc:Documentation>
diff --git a/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/plugin.xml b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/plugin.xml
new file mode 100644
index 00000000000..cf6573c0c4d
--- /dev/null
+++ b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/plugin.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup?after=org.eclipse.papyrus.views.modelexplorer.popupmenu.creatediagram">
+ <command
+ commandId="org.eclipse.papyrus.uml.nattable.converter.command"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.uml.nattable.converter.all.tables.command"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ defaultHandler="org.eclipse.papyrus.uml.nattable.converter.handlers.ConvertOldTableHandler"
+ id="org.eclipse.papyrus.uml.nattable.converter.command"
+ name="Convert Old Table to New Table">
+ </command>
+ <command
+ defaultHandler="org.eclipse.papyrus.uml.nattable.converter.handlers.ConvertAllTablesHandler"
+ id="org.eclipse.papyrus.uml.nattable.converter.all.tables.command"
+ name="Convert All Old Tables to New Tables">
+ </command>
+ </extension>
+
+</plugin>
diff --git a/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/Activator.java b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/Activator.java
new file mode 100644
index 00000000000..859ab8f36c4
--- /dev/null
+++ b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/Activator.java
@@ -0,0 +1,71 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.nattable.converter;
+
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.emf.nattable.converter"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ public static LogHelper log;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ log = new LogHelper(this);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/handlers/ConvertAllTablesHandler.java b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/handlers/ConvertAllTablesHandler.java
new file mode 100644
index 00000000000..3575a6649f1
--- /dev/null
+++ b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/handlers/ConvertAllTablesHandler.java
@@ -0,0 +1,61 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.nattable.converter.handlers;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance;
+
+
+public class ConvertAllTablesHandler extends ConvertOldTableHandler {
+
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.nattable.converter.handlers.ConvertOldTableHandler#setEnabled(java.lang.Object)
+ *
+ * @param evaluationContext
+ */
+ @Override
+ public void setEnabled(Object evaluationContext) {
+ Object selection = ((IEvaluationContext)evaluationContext).getDefaultVariable();
+ List<PapyrusTableInstance> allPapyrusTableInstances = new ArrayList<PapyrusTableInstance>();
+ if(selection instanceof List<?>) {
+ List<?> list = (List<?>)selection;
+ Iterator<?> iter = list.iterator();
+ while(iter.hasNext()) {
+ Object current = iter.next();
+ if(current instanceof IAdaptable) {
+ EObject eobject = (EObject)((IAdaptable)current).getAdapter(EObject.class);
+ if(eobject != null) {
+ final IPageManager manager = getPageManager(eobject);
+ for(final Object page : manager.allPages()) {
+ if(page instanceof PapyrusTableInstance) {
+ allPapyrusTableInstances.add((PapyrusTableInstance)page);
+ }
+ }
+ }
+ }
+ }
+ }
+ this.oldPapyrusTableInstance = allPapyrusTableInstances;
+ setBaseEnabled(!this.oldPapyrusTableInstance.isEmpty());
+ }
+}
diff --git a/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/handlers/ConvertOldTableHandler.java b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/handlers/ConvertOldTableHandler.java
new file mode 100644
index 00000000000..6930666bb11
--- /dev/null
+++ b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/handlers/ConvertOldTableHandler.java
@@ -0,0 +1,422 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.nattable.converter.handlers;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EStructuralFeature.Setting;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.ECrossReferenceAdapter;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
+import org.eclipse.papyrus.infra.core.sashwindows.di.DiPackage;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
+import org.eclipse.papyrus.infra.nattable.common.modelresource.PapyrusNattableModel;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.EObjectAxis;
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxis.NattableaxisFactory;
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AxisManagerRepresentation;
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattableconfiguration.TableConfiguration;
+import org.eclipse.papyrus.infra.nattable.nattableconfiguration.NattableConfigurationRegistry;
+import org.eclipse.papyrus.infra.nattable.utils.TableHelper;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance;
+import org.eclipse.papyrus.uml.nattable.converter.Activator;
+import org.eclipse.papyrus.uml.nattable.converter.messages.Messages;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * This handler allows to convert ONE old PapyrusTableInstance to a new Papyrus table
+ *
+ * @author vl222926
+ *
+ */
+public class ConvertOldTableHandler extends AbstractHandler {
+
+ public static final String OLD_DEFAULT_TABLE_TYPE = "PapyrusDefaultTable"; //$NON-NLS-1$
+
+ public static final String OLD_REQUIREMENT_TABLE = "PapyrusRequirementTable"; //$NON-NLS-1$
+
+ public static final String OLD_ALLOCATION_TABLE = "PapyrusAllocationTable"; //$NON-NLS-1$
+
+ public static final String PAPYRUS_NEW_DEFAULT_TABLE = "PapyrusGenericTable"; //$NON-NLS-1$
+
+ public static final String PAPYRUS_NEW_REQUIREMENT_TABLE = "PapyrusSysMLRequirementTable"; //$NON-NLS-1$
+
+ public static final String PAPYRUS_NEW_ALLOCATION_TABLE = "PapyrusSysMLAllocationTable"; //$NON-NLS-1$
+
+ protected List<PapyrusTableInstance> oldPapyrusTableInstance;
+
+ /**
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ *
+ * @param event
+ * @return null
+ * @throws ExecutionException
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ boolean destroyOldTable = false;
+ boolean replaceOldRequirementTableByNewRequirementTable = false;
+ boolean replaceOldSysMLAllocationTableByNewSysMLAllocationTable = false;
+ boolean selectionContainsRequirementsTable = false;
+ boolean selectionContainsAllocationTable = false;
+ boolean selectionContainsCustomTableKind = false;
+ boolean convertCustomTabletoGenericTable = false;
+ final List<PapyrusTableInstance> oldTables = oldPapyrusTableInstance;
+ if(!oldTables.isEmpty()) {
+ for(final PapyrusTableInstance oldTable : oldTables) {
+ final String type = oldTable.getType();
+ if(OLD_REQUIREMENT_TABLE.equals(type)) {
+ selectionContainsRequirementsTable = true;
+ }
+ if(OLD_ALLOCATION_TABLE.equals(type)) {
+ selectionContainsAllocationTable = true;
+ }
+ if(selectionContainsAllocationTable && selectionContainsRequirementsTable) {
+ break;
+ }
+ }
+
+ String dialogTitle = Messages.ConvertOldTableHandler_ConvertOldTableQuestion;
+ boolean answer = MessageDialog.openQuestion(Display.getDefault().getActiveShell(), dialogTitle, Messages.ConvertOldTableHandler_AdvicesForUser);
+ if(!answer) {
+ return null;
+ }
+
+ String dialogGlobalMessage = Messages.ConvertOldTableHandler_DialogMessage;
+ String dialogAllocationMessage = String.format(dialogGlobalMessage, "Allocation"); //$NON-NLS-1$
+ String dialogRequirementMessage = String.format(dialogGlobalMessage, "Requirement"); //$NON-NLS-1$
+
+ if(selectionContainsAllocationTable) {
+ MessageDialog dialog = new MessageDialog(Display.getDefault().getActiveShell(), dialogTitle, null, dialogAllocationMessage, MessageDialog.QUESTION_WITH_CANCEL, new String[]{ Messages.ConvertOldTableHandler_ConvertToNewAllocationTable, Messages.ConvertOldTableHandler_ConvertToNewUMLGenericTable, Messages.ConvertOldTableHandler_Cancel }, 0);
+ switch(dialog.open()) {
+ case 0:
+ replaceOldSysMLAllocationTableByNewSysMLAllocationTable = true;
+ break;
+ case 1:
+ replaceOldSysMLAllocationTableByNewSysMLAllocationTable = false;
+ break;
+ case 2:
+ return null;
+ }
+ }
+ if(selectionContainsRequirementsTable) {
+ MessageDialog dialog = new MessageDialog(Display.getDefault().getActiveShell(), dialogTitle, null, dialogRequirementMessage, MessageDialog.QUESTION_WITH_CANCEL, new String[]{ Messages.ConvertOldTableHandler_ConvertToNewRequirementTable, Messages.ConvertOldTableHandler_ConvertToNewUMLGenericTable, Messages.ConvertOldTableHandler_Cancel }, 0);
+ switch(dialog.open()) {
+ case 0:
+ replaceOldRequirementTableByNewRequirementTable = true;
+ break;
+ case 1:
+ replaceOldRequirementTableByNewRequirementTable = false;
+ break;
+ case 2:
+ return null;
+
+ }
+ }
+ if(selectionContainsCustomTableKind) {
+ convertCustomTabletoGenericTable = MessageDialog.openQuestion(Display.getDefault().getActiveShell(), dialogTitle, Messages.ConvertOldTableHandler_QuestionAboutCustomTable);
+ }
+
+ destroyOldTable = MessageDialog.openQuestion(Display.getDefault().getActiveShell(), Messages.ConvertOldTableHandler_ConvertOldTableQuestion, Messages.ConvertOldTableHandler_DestroyTheTableAtTheEndQuestion);
+ final CompoundCommand convertCommand = new CompoundCommand();
+ TransactionalEditingDomain domain = null;
+ try {
+ domain = ServiceUtilsForEObject.getInstance().getTransactionalEditingDomain(oldTables.get(0));
+ } catch (ServiceException e1) {
+ Activator.log.error("Can't found the editing domain", e1); //$NON-NLS-1$
+ }
+ for(final PapyrusTableInstance oldTable : oldTables) {
+ final String type = oldTable.getType();
+
+ Table newTable = null;
+ if(OLD_DEFAULT_TABLE_TYPE.equals(type)) {
+ newTable = getCreateUMLGenericTableCommand(oldTable);
+ } else if(OLD_REQUIREMENT_TABLE.equals(type)) {
+ if(replaceOldRequirementTableByNewRequirementTable) {
+ newTable = getCreateSysMLRequirementTableCommand(oldTable);
+ } else {
+ newTable = getCreateUMLGenericTableCommand(oldTable);
+ }
+ } else if(OLD_ALLOCATION_TABLE.equals(type)) {
+ if(replaceOldSysMLAllocationTableByNewSysMLAllocationTable) {
+ newTable = getCreateSysMLAllocationTableCommand(oldTable);
+ } else {
+ newTable = getCreateUMLGenericTableCommand(oldTable);
+ }
+ } else if(convertCustomTabletoGenericTable) {
+ newTable = getCreateUMLGenericTableCommand(oldTable);
+ } else {
+ continue;
+ }
+
+
+ final Resource notationResource = ((ModelSet)oldTable.eResource().getResourceSet()).getAssociatedResource(oldTable, PapyrusNattableModel.TABLE_MODEL_FILE_EXTENSION, true);
+ final IPageManager manager = getPageManager(oldTable);//to be sure to have the correct page manager, we do it each time.
+ convertCommand.append(getAddToResourceCommand(domain, notationResource, newTable));
+ Assert.isNotNull(manager);
+ convertCommand.append(getAddToPageManagerCommand(domain, manager, newTable));
+ Command tmp = getReplaceExistingTableCommand(domain, oldTable, newTable);
+ if(tmp != null) {
+ convertCommand.append(tmp);
+ }
+
+ if(destroyOldTable) {
+ convertCommand.append(getDestroyOldTableCommand(domain, oldTable));
+ }
+ }
+
+
+ if(!convertCommand.isEmpty()) {
+ domain.getCommandStack().execute(convertCommand);
+ }
+
+ // clear the selection
+ this.oldPapyrusTableInstance.clear();
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @param domain
+ * the editing domain
+ * @param oldTable
+ * an old table
+ * @return
+ * the command to destroy the old table
+ */
+ protected Command getDestroyOldTableCommand(final TransactionalEditingDomain domain, final PapyrusTableInstance oldTable) {
+ final IEditCommandRequest request = new DestroyElementRequest(domain, oldTable, false);
+ final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(oldTable);
+ return new GMFtoEMFCommandWrapper(provider.getEditCommand(request));
+ }
+
+ /**
+ *
+ * @param oldTable
+ * an old table
+ * @return
+ * a new UML Generic Table initialized with the same rows as the old table
+ */
+ @SuppressWarnings("deprecation")
+ protected Table getCreateUMLGenericTableCommand(final PapyrusTableInstance oldTable) {
+ URI uri = NattableConfigurationRegistry.INSTANCE.getConfigurationURI(PAPYRUS_NEW_DEFAULT_TABLE);
+ ResourceSet resourceSet = oldTable.eResource().getResourceSet();
+ TableConfiguration configuration = (TableConfiguration)resourceSet.getResource(uri, true).getContents().get(0);
+ Table newTable = getCreateTableFromConfiguration(oldTable, configuration);
+ final AxisManagerRepresentation representation = configuration.getRowHeaderAxisConfiguration().getAxisManagers().get(0);
+ for(final EObject element : oldTable.getTable().getElements()) {
+ EObjectAxis axis = NattableaxisFactory.eINSTANCE.createEObjectAxis();
+ axis.setElement(element);
+ axis.setManager(representation);
+ newTable.getCurrentRowAxisProvider().getAxis().add(axis);
+ }
+ return newTable;
+ }
+
+ /**
+ *
+ * @param oldTable
+ * an old table
+ * @return
+ * a new SysML Requirement table
+ */
+ protected Table getCreateSysMLRequirementTableCommand(final PapyrusTableInstance oldTable) {
+ URI uri = NattableConfigurationRegistry.INSTANCE.getConfigurationURI(PAPYRUS_NEW_REQUIREMENT_TABLE);
+ ResourceSet resourceSet = oldTable.eResource().getResourceSet();
+ TableConfiguration configuration = (TableConfiguration)resourceSet.getResource(uri, true).getContents().get(0);
+ return getCreateTableFromConfiguration(oldTable, configuration);
+ }
+
+ /**
+ *
+ * @param oldTable
+ * the old table
+ * @return
+ * a new SysML Allocation table
+ *
+ */
+ protected Table getCreateSysMLAllocationTableCommand(final PapyrusTableInstance oldTable) {
+ URI uri = NattableConfigurationRegistry.INSTANCE.getConfigurationURI(PAPYRUS_NEW_ALLOCATION_TABLE);
+ ResourceSet resourceSet = oldTable.eResource().getResourceSet();
+ TableConfiguration configuration = (TableConfiguration)resourceSet.getResource(uri, true).getContents().get(0);
+ return getCreateTableFromConfiguration(oldTable, configuration);
+ }
+
+ /**
+ *
+ * @param oldTable
+ * the old table
+ * @param tableConfiguration
+ * the configuration to use to initialize it
+ * @return
+ * the new table initialized with its configuration
+ */
+ @SuppressWarnings("deprecation")
+ protected Table getCreateTableFromConfiguration(final PapyrusTableInstance oldTable, final TableConfiguration tableConfiguration) {
+ return TableHelper.createTable(tableConfiguration, oldTable.getTable().getContext(), oldTable.getName() + "(Converted)", oldTable.getTable().getDescription()); //$NON-NLS-1$
+ }
+
+ /**
+ *
+ * @param domain
+ * @param manager
+ * @param newTable
+ * @return
+ * the command to add the new table to the page manager
+ */
+ protected Command getAddToPageManagerCommand(final TransactionalEditingDomain domain, final IPageManager manager, final Table newTable) {
+ return new RecordingCommand(domain) {
+
+ @Override
+ protected void doExecute() {
+ manager.addPage(newTable);
+ }
+ };
+ }
+
+ /**
+ *
+ * @param domain
+ * @param notationResource
+ * @param newTable
+ * @return
+ * the command to add the new table to the resouce
+ */
+
+ protected Command getAddToResourceCommand(final TransactionalEditingDomain domain, final Resource notationResource, final Table newTable) {
+ return new RecordingCommand(domain) {
+
+ @Override
+ protected void doExecute() {
+ notationResource.getContents().add(newTable);
+ }
+ };
+ }
+
+ /**
+ *
+ * @param domain
+ * the editing domain
+ * @param oldTable
+ * the old table
+ * @param newTable
+ * the newTable
+ * @return
+ * the command to replace referenced to old table by references to new table
+ */
+ protected Command getReplaceExistingTableCommand(final TransactionalEditingDomain domain, final PapyrusTableInstance oldTable, final Table newTable) {
+ final CompoundCommand compoundCommand = new CompoundCommand("Replace Old table Command"); //$NON-NLS-1$
+ final ECrossReferenceAdapter crossReferenceAdapter = CrossReferenceAdapter.getCrossReferenceAdapter(oldTable);
+ Collection<Setting> settings = crossReferenceAdapter.getNonNavigableInverseReferences(oldTable);
+
+ //replace the references to the old table to reference to the new table
+ for(final Setting setting : settings) {
+ EStructuralFeature feature = setting.getEStructuralFeature();
+ if(feature != DiPackage.eINSTANCE.getPageRef_EmfPageIdentifier()) {//we replace all references excepted references in the page manager
+ Command cmd = new RecordingCommand(domain) {
+
+ /**
+ *
+ * @see org.eclipse.emf.transaction.RecordingCommand#doExecute()
+ *
+ */
+ @Override
+ protected void doExecute() {
+ EcoreUtil.replace(setting, oldTable, newTable);
+ }
+ };
+ compoundCommand.append(cmd);
+ }
+ }
+ if(compoundCommand.isEmpty()) {
+ return null;
+ }
+ return compoundCommand;
+ }
+
+
+ /**
+ *
+ * @param eobject
+ * an eobject
+ * @return
+ * the page manager
+ */
+ protected IPageManager getPageManager(final EObject eobject) {
+ IPageManager manager = null;
+ try {
+ manager = ServiceUtilsForEObject.getInstance().getIPageManager(eobject);
+ } catch (ServiceException e) {
+ Activator.log.error(e);
+ }
+ return manager;
+ }
+
+ /**
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#setEnabled(java.lang.Object)
+ *
+ * @param evaluationContext
+ */
+ @Override
+ public void setEnabled(Object evaluationContext) {
+ this.oldPapyrusTableInstance = new ArrayList<PapyrusTableInstance>();
+ if(evaluationContext instanceof IEvaluationContext) {
+ Object selection = ((IEvaluationContext)evaluationContext).getDefaultVariable();
+ if(selection instanceof Collection<?>) {
+ List<?> currentSelection = (selection instanceof List<?>) ? (List<?>)selection : new java.util.ArrayList<Object>((Collection<?>)selection);
+ if(currentSelection.size() == 1) {
+ Object current = currentSelection.get(0);
+ if(current instanceof IAdaptable) {
+ EObject eobject = (EObject)((IAdaptable)current).getAdapter(EObject.class);
+ if(eobject instanceof PapyrusTableInstance) {
+
+ this.oldPapyrusTableInstance.add((PapyrusTableInstance)eobject);
+ }
+ setBaseEnabled(this.oldPapyrusTableInstance != null && this.oldPapyrusTableInstance.size() == 1);
+ return;
+ }
+ }
+ }
+ }
+ setBaseEnabled(false);
+ }
+}
diff --git a/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/messages/Messages.java b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/messages/Messages.java
new file mode 100644
index 00000000000..b428d500191
--- /dev/null
+++ b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/messages/Messages.java
@@ -0,0 +1,33 @@
+package org.eclipse.papyrus.uml.nattable.converter.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+
+ private static final String BUNDLE_NAME = "org.eclipse.papyrus.uml.nattable.converter.messages.messages"; //$NON-NLS-1$
+
+ public static String ConvertOldTableHandler_AdvicesForUser;
+
+ public static String ConvertOldTableHandler_Cancel;
+
+ public static String ConvertOldTableHandler_ConvertOldTableQuestion;
+
+ public static String ConvertOldTableHandler_ConvertToNewAllocationTable;
+
+ public static String ConvertOldTableHandler_ConvertToNewRequirementTable;
+
+ public static String ConvertOldTableHandler_ConvertToNewUMLGenericTable;
+
+ public static String ConvertOldTableHandler_DestroyTheTableAtTheEndQuestion;
+
+ public static String ConvertOldTableHandler_DialogMessage;
+
+ public static String ConvertOldTableHandler_QuestionAboutCustomTable;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/messages/messages.properties b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/messages/messages.properties
new file mode 100644
index 00000000000..2aaf1bcc60a
--- /dev/null
+++ b/extraplugins/tablemigration/nattable/org.eclipse.papyrus.infra.emf.nattable.converter/src/org/eclipse/papyrus/uml/nattable/converter/messages/messages.properties
@@ -0,0 +1,9 @@
+ConvertOldTableHandler_AdvicesForUser=We advice you to do a copy of your model before to convert it. \n \n Continue?
+ConvertOldTableHandler_Cancel=Cancel
+ConvertOldTableHandler_ConvertOldTableQuestion=Convert Old Table Question
+ConvertOldTableHandler_ConvertToNewAllocationTable=Convert to new Allocation Table
+ConvertOldTableHandler_ConvertToNewRequirementTable=Convert to new Requirement Table
+ConvertOldTableHandler_ConvertToNewUMLGenericTable=Convert to UML Generic Table
+ConvertOldTableHandler_DestroyTheTableAtTheEndQuestion=Destroy the tables at the end of this process?
+ConvertOldTableHandler_DialogMessage=Your selection contains old %s Table. This old table was filled by the user, the new version is filled dynamically, so you may lose rows converting it. You could convert it too in new Generic UML Table.
+ConvertOldTableHandler_QuestionAboutCustomTable=Your selection contains custom table. I only can convert them into UML Generic Table. \n \n Do you accept this conversion?
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/.classpath b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/.classpath
new file mode 100644
index 00000000000..f6326c88c74
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="custom-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/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/.project b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/.project
new file mode 100644
index 00000000000..c95a6c4418d
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.table.instance</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/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/META-INF/MANIFEST.MF b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..5ea468624d3
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/META-INF/MANIFEST.MF
@@ -0,0 +1,33 @@
+Manifest-Version: 1.0
+Export-Package: org.eclipse.papyrus.infra.table.instance,
+ org.eclipse.papyrus.infra.table.instance.papyrustableinstance;uses:="org.eclipse.emf.ecore,org.eclipse.emf.facet.widgets.nattable.instance.tableinstance",
+ org.eclipse.papyrus.infra.table.instance.papyrustableinstance.impl,
+ org.eclipse.papyrus.infra.table.instance.papyrustableinstance.util;
+ uses:="org.eclipse.emf.ecore.util,
+ org.eclipse.emf.ecore,
+ org.eclipse.emf.common.notify.impl,
+ org.eclipse.emf.common.notify",
+ org.eclipse.papyrus.infra.table.instance.util
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.ecore;visibility:=reexport,
+ org.eclipse.emf.facet.widgets.celleditors;visibility:=reexport,
+ org.eclipse.emf.facet.infra.facet;visibility:=reexport,
+ org.eclipse.emf.facet.infra.query;visibility:=reexport,
+ org.eclipse.emf.facet.widgets.nattable.tableconfiguration;visibility:=reexport,
+ org.eclipse.emf.facet.widgets.nattable.instance;bundle-version="0.1.0",
+ org.eclipse.emf.facet.infra.browser.custom;visibility:=reexport,
+ org.eclipse.ui.workbench,
+ com.google.guava;bundle-version="11.0.0",
+ org.eclipse.papyrus.infra.emf;bundle-version="1.0.0"
+Bundle-Vendor: %providerName
+Bundle-ActivationPolicy: lazy
+Bundle-ClassPath: .
+Bundle-Version: 1.0.0.qualifier
+Bundle-Name: %pluginName
+Bundle-Localization: plugin
+Bundle-ManifestVersion: 2
+Bundle-Activator: org.eclipse.papyrus.infra.table.instance.Activator
+Bundle-SymbolicName: org.eclipse.papyrus.infra.table.instance;singleto
+ n:=true
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/about.html b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/about.html
new file mode 100644
index 00000000000..82d49bf5f81
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/build.properties b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/build.properties
new file mode 100644
index 00000000000..854052f66d4
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/build.properties
@@ -0,0 +1,8 @@
+#
+#Mon Sep 12 09:30:18 CEST 2011
+output..=bin/
+bin.includes=.,model/,META-INF/,plugin.xml,plugin.properties,about.html
+jars.compile.order=.
+src.includes = about.html
+source..=src/
+bin..=bin/
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/custom-src/org/eclipse/papyrus/infra/table/instance/util/TableContentsUtils.java b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/custom-src/org/eclipse/papyrus/infra/table/instance/util/TableContentsUtils.java
new file mode 100644
index 00000000000..adb5edc4d7f
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/custom-src/org/eclipse/papyrus/infra/table/instance/util/TableContentsUtils.java
@@ -0,0 +1,200 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.table.instance.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature.Setting;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.facet.widgets.nattable.instance.tableinstance.TableInstance;
+import org.eclipse.emf.facet.widgets.nattable.instance.tableinstance.TableinstancePackage;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance;
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrustableinstancePackage;
+
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Iterators;
+import com.google.common.collect.Sets;
+
+
+public class TableContentsUtils {
+
+
+ private TableContentsUtils() {
+ //to prevent instanciation
+ }
+
+ /**
+ *
+ * @param papyrusTable
+ * the table to analyse
+ * @param synchronizedContent
+ * <li>if <code>true</code> the method returns the list of the elements which should be contained by the table (using the queries or the
+ * features)</li> <li>if <code>false</code> the method returns the list of the elements currently contained by the table (we use the
+ * serialized table)</li>
+ * @return
+ */
+ public static final List<EObject> getTableContents(final PapyrusTableInstance papyrusTable, final EObject tableContext, final boolean synchronizedContent) {
+// final List<EObject> result = new LinkedList<EObject>();
+// if(synchronizedContent && !papyrusTable.isUsingUser()) {
+// if(papyrusTable.isUsingContextFeature()) {
+// final EReference feature = papyrusTable.getContextFeature();
+// Object value = null;
+// try {
+// value = tableContext.eGet(feature);
+// } catch (final Exception e) {
+// //nothing to do
+// }
+// // if(value == null) {//teh feature has not been found
+// // final EStructuralFeature matchingFeature = tableContext.eClass().getEStructuralFeature(feature.getName());
+// // if(matchingFeature != null) {
+// // value = tableContext.eGet(matchingFeature);
+// // }
+// //
+// // }
+//
+//
+// if(value instanceof List<?>) {
+// result.addAll((List<EObject>)value);
+// } else if(value instanceof EObject) {
+// result.add((EObject)value);
+// }
+// } else if(papyrusTable.isUsingQueries()) {
+// //TODO
+// }
+// } else {
+// //duplicated code from TableWidgetUtils#public static List<EObject> getElements(final Table tableInstance) {
+// //TODO ask to Mia-Software to change this method in a upper plugin to avoid dependencies on UI
+// if(papyrusTable.getTable() != null) {
+// for(final Row row : papyrusTable.getTable().getRows()) {
+// result.add(row.getElement());
+// }
+// }
+// }
+// return result;
+
+ //FIXME
+ return new ArrayList<EObject>(papyrusTable.getTable().getElements());
+ }
+
+ /**
+ * Creates an iterable containing all the Papyrus Tables that are descending from the context.
+ *
+ * @author olivier melois (Atos)
+ */
+ public static Iterable<EObject> createDescendantTablesIterable(EObject context) {
+
+ Set<EObject> result = Sets.newHashSet();
+
+ TreeIterator<EObject> eAllContents = EcoreUtil.getAllProperContents(context, true);
+ Iterator<EObject> contextAndDescendants = Iterators.concat(eAllContents, Iterators.singletonIterator(context));
+
+ final Predicate<Setting> keepPapyrusTableInstances = new Predicate<Setting>() {
+
+ public boolean apply(Setting setting) {
+ boolean result = true;
+ if(setting != null) {
+ EObject settingEObject = setting.getEObject();
+ result &= settingEObject instanceof PapyrusTableInstance;
+ result &= PapyrustableinstancePackage.Literals.PAPYRUS_TABLE_INSTANCE__TABLE == setting.getEStructuralFeature();
+ } else {
+ result = false;
+ }
+ return result;
+ }
+ };
+
+ /*
+ * Predicate used to keep the usages which are PapyrusTableInstances
+ */
+ Predicate<Setting> keepTableInstances = new Predicate<Setting>() {
+
+ public boolean apply(Setting setting) {
+ boolean result = true;
+ if(setting != null) {
+ EObject settingEObject = setting.getEObject();
+ result &= settingEObject instanceof TableInstance;
+ result &= setting.getEStructuralFeature() == TableinstancePackage.Literals.TABLE_INSTANCE__CONTEXT;
+
+ Collection<Setting> references = EMFHelper.getUsages(settingEObject);
+ Iterable<Setting> papyrusTableInstances = Iterables.filter(references, keepPapyrusTableInstances);
+ //Veryfing that there is at least one papyrusTableInstance
+ result = result && !Iterables.isEmpty(papyrusTableInstances);
+
+ } else {
+ result = false;
+ }
+ return result;
+ }
+ };
+
+ /*
+ * Function to get the eObject from a setting
+ */
+ Function<Setting, EObject> getEObject = new Function<Setting, EObject>() {
+
+ public EObject apply(Setting input) {
+ EObject settingEObject = input.getEObject();
+ Collection<Setting> references = EMFHelper.getUsages(settingEObject);
+ Iterable<Setting> papyrusTableInstances = Iterables.filter(references, keepPapyrusTableInstances);
+ //Getting the eobject of thie first element of this iterable.
+ return Iterables.get(papyrusTableInstances, 0).getEObject();
+ }
+
+ };
+
+ /*
+ * For the context and his descendants :
+ */
+ while(contextAndDescendants.hasNext()) {
+ EObject current = contextAndDescendants.next();
+ //Usages
+ Iterable<Setting> usages = EMFHelper.getUsages(current);
+ //Filtering to keep only papyrus table instances.
+ Iterable<Setting> tableInstanceSettings = Iterables.filter(usages, keepTableInstances);
+ //Getting the eObjects
+ Iterable<EObject> papyrusTableInstances = Iterables.transform(tableInstanceSettings, getEObject);
+ //Adding all the kept usages.
+ Iterables.addAll(result, papyrusTableInstances);
+ }
+
+ return result;
+ }
+
+ /**
+ *
+ * @param selection
+ * the current selection
+ * @return
+ * the list of the papyrus table instance which have the selection has context
+ */
+ public static Collection<PapyrusTableInstance> getPapyrusTableInstances(final EObject selection) {
+ final Collection<PapyrusTableInstance> pTables = new ArrayList<PapyrusTableInstance>();
+ Iterable<EObject> allDescendingPapyrusTables = createDescendantTablesIterable(selection);
+ for(EObject eObject : allDescendingPapyrusTables) {
+ if(eObject instanceof PapyrusTableInstance) {
+ pTables.add((PapyrusTableInstance)eObject);
+ }
+ }
+ return pTables;
+ }
+}
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/model/papyrustableinstance.ecore b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/model/papyrustableinstance.ecore
new file mode 100644
index 00000000000..19092e38d55
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/model/papyrustableinstance.ecore
@@ -0,0 +1,48 @@
+<?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="papyrustableinstance" nsURI="http://www.eclipse.org/Papyrus/Table/0.8.0/papyrustableinstance"
+ nsPrefix="org.eclipse.papyrus.infra.table.instance.papyrustableinstance">
+ <eClassifiers xsi:type="ecore:EClass" name="PapyrusTableInstance" eSuperTypes="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EModelElement">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
+ defaultValueLiteral="no name">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="The name of the table."/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
+ defaultValueLiteral="PapyrusDefaultTable">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="The type of the table"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="isSynchronized" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
+ defaultValueLiteral="false">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="Indicates if the table is synchronized with its context or not. Synchronization is done with the filling queries."/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="table" eType="ecore:EClass platform:/plugin/org.eclipse.emf.facet.widgets.nattable.instance/model/tableinstance2.ecore#//TableInstance2">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="The TableInstance"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="fillingQueries" upperBound="-1"
+ eType="ecore:EClass platform:/plugin/org.eclipse.emf.facet.infra.query/model/query.ecore#//ModelQuery">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="The queries used to fill the table"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="pastedElementId" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
+ defaultValueLiteral="">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="This attribute stores the id of the element represented by the row during a paste action in the table."/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="pastedElementContainmentFeature"
+ eType="ecore:EClass platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EReference">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="This property reference the feature of the context of the table which is used as containement feature&#xD;&#xA;for the pasted elements."/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/model/papyrustableinstance.genmodel b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/model/papyrustableinstance.genmodel
new file mode 100644
index 00000000000..d98cf5d65bd
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/model/papyrustableinstance.genmodel
@@ -0,0 +1,19 @@
+<?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.papyrus.infra.table.instance/src"
+ modelPluginID="org.eclipse.papyrus.infra.table.instance" modelName="Papyrustableinstance"
+ importerID="org.eclipse.emf.importer.ecore" complianceLevel="5.0" copyrightFields="false"
+ usedGenPackages="platform:/plugin/org.eclipse.emf.facet.widgets.celleditors/model/celleditors.genmodel#//modelCellEditor platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore platform:/plugin/org.eclipse.emf.facet.infra.facet/model/facet.genmodel#//facet platform:/plugin/org.eclipse.emf.facet.infra.query/model/query.genmodel#//query platform:/plugin/org.eclipse.emf.facet.widgets.nattable.tableconfiguration/model/tableConfiguration.genmodel#//tableconfiguration platform:/plugin/org.eclipse.emf.facet.widgets.nattable.instance/model/tableinstance.genmodel#//tableinstance platform:/plugin/org.eclipse.emf.facet.widgets.nattable.instance/model/tableinstance2.genmodel#//tableinstance2 platform:/plugin/org.eclipse.emf.facet.infra.browser.custom/models/uiCustom.genmodel#//custom">
+ <foreignModel>papyrustableinstance.ecore</foreignModel>
+ <genPackages prefix="Papyrustableinstance" basePackage="org.eclipse.papyrus.infra.table.instance"
+ disposableProviderFactory="true" ecorePackage="papyrustableinstance.ecore#/">
+ <genClasses ecoreClass="papyrustableinstance.ecore#//PapyrusTableInstance">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute papyrustableinstance.ecore#//PapyrusTableInstance/name"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute papyrustableinstance.ecore#//PapyrusTableInstance/type"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute papyrustableinstance.ecore#//PapyrusTableInstance/isSynchronized"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference papyrustableinstance.ecore#//PapyrusTableInstance/table"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference papyrustableinstance.ecore#//PapyrusTableInstance/fillingQueries"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/plugin.properties b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/plugin.properties
new file mode 100644
index 00000000000..8de7ccf1e58
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/plugin.properties
@@ -0,0 +1,2 @@
+pluginName = Papyrus Nattable Instance (Incubation)
+providerName = Eclipse Modeling Project
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/plugin.xml b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/plugin.xml
new file mode 100644
index 00000000000..77083607b71
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/plugin.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+ <copyright>
+ </copyright>
+
+ $Id$
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <package
+ uri="http://www.eclipse.org/Papyrus/Table/0.8.0/papyrustableinstance"
+ class="org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrustableinstancePackage"
+ genModel="model/papyrusnattableinstance.genmodel"/>
+ </extension>
+
+</plugin>
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/Activator.java b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/Activator.java
new file mode 100644
index 00000000000..06103eb245a
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/Activator.java
@@ -0,0 +1,67 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.table.instance;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.table.instance"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(final BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(final BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/PapyrusTableInstance.java b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/PapyrusTableInstance.java
new file mode 100644
index 00000000000..197bc08133e
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/PapyrusTableInstance.java
@@ -0,0 +1,212 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.infra.table.instance.papyrustableinstance;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.emf.facet.infra.query.ModelQuery;
+
+import org.eclipse.emf.facet.widgets.nattable.instance.tableinstance2.TableInstance2;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Papyrus Table Instance</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getType <em>Type</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#isIsSynchronized <em>Is Synchronized</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getTable <em>Table</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getFillingQueries <em>Filling Queries</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getPastedElementId <em>Pasted Element Id</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getPastedElementContainmentFeature <em>Pasted Element Containment Feature</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrustableinstancePackage#getPapyrusTableInstance()
+ * @model
+ * @generated
+ */
+public interface PapyrusTableInstance extends EModelElement {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * The default value is <code>"no name"</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * The name of the table.
+ * <!-- end-model-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrustableinstancePackage#getPapyrusTableInstance_Name()
+ * @model default="no name"
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Type</b></em>' attribute.
+ * The default value is <code>"PapyrusDefaultTable"</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * The type of the table
+ * <!-- end-model-doc -->
+ * @return the value of the '<em>Type</em>' attribute.
+ * @see #setType(String)
+ * @see org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrustableinstancePackage#getPapyrusTableInstance_Type()
+ * @model default="PapyrusDefaultTable"
+ * @generated
+ */
+ String getType();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getType <em>Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Type</em>' attribute.
+ * @see #getType()
+ * @generated
+ */
+ void setType(String value);
+
+ /**
+ * Returns the value of the '<em><b>Is Synchronized</b></em>' attribute.
+ * The default value is <code>"false"</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * Indicates if the table is synchronized with its context or not. Synchronization is done with the filling queries.
+ * <!-- end-model-doc -->
+ * @return the value of the '<em>Is Synchronized</em>' attribute.
+ * @see #setIsSynchronized(boolean)
+ * @see org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrustableinstancePackage#getPapyrusTableInstance_IsSynchronized()
+ * @model default="false"
+ * @generated
+ */
+ boolean isIsSynchronized();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#isIsSynchronized <em>Is Synchronized</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Is Synchronized</em>' attribute.
+ * @see #isIsSynchronized()
+ * @generated
+ */
+ void setIsSynchronized(boolean value);
+
+ /**
+ * Returns the value of the '<em><b>Table</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * The TableInstance
+ * <!-- end-model-doc -->
+ * @return the value of the '<em>Table</em>' reference.
+ * @see #setTable(TableInstance2)
+ * @see org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrustableinstancePackage#getPapyrusTableInstance_Table()
+ * @model
+ * @generated
+ */
+ TableInstance2 getTable();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getTable <em>Table</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Table</em>' reference.
+ * @see #getTable()
+ * @generated
+ */
+ void setTable(TableInstance2 value);
+
+ /**
+ * Returns the value of the '<em><b>Filling Queries</b></em>' reference list.
+ * The list contents are of type {@link org.eclipse.emf.facet.infra.query.ModelQuery}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * The queries used to fill the table
+ * <!-- end-model-doc -->
+ * @return the value of the '<em>Filling Queries</em>' reference list.
+ * @see org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrustableinstancePackage#getPapyrusTableInstance_FillingQueries()
+ * @model
+ * @generated
+ */
+ EList<ModelQuery> getFillingQueries();
+
+ /**
+ * Returns the value of the '<em><b>Pasted Element Id</b></em>' attribute.
+ * The default value is <code>""</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * This attribute stores the id of the element represented by the row during a paste action in the table.
+ * <!-- end-model-doc -->
+ * @return the value of the '<em>Pasted Element Id</em>' attribute.
+ * @see #setPastedElementId(String)
+ * @see org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrustableinstancePackage#getPapyrusTableInstance_PastedElementId()
+ * @model default=""
+ * @generated
+ */
+ String getPastedElementId();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getPastedElementId <em>Pasted Element Id</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Pasted Element Id</em>' attribute.
+ * @see #getPastedElementId()
+ * @generated
+ */
+ void setPastedElementId(String value);
+
+ /**
+ * Returns the value of the '<em><b>Pasted Element Containment Feature</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * This property reference the feature of the context of the table which is used as containement feature
+ * for the pasted elements.
+ * <!-- end-model-doc -->
+ * @return the value of the '<em>Pasted Element Containment Feature</em>' reference.
+ * @see #setPastedElementContainmentFeature(EReference)
+ * @see org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrustableinstancePackage#getPapyrusTableInstance_PastedElementContainmentFeature()
+ * @model
+ * @generated
+ */
+ EReference getPastedElementContainmentFeature();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getPastedElementContainmentFeature <em>Pasted Element Containment Feature</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Pasted Element Containment Feature</em>' reference.
+ * @see #getPastedElementContainmentFeature()
+ * @generated
+ */
+ void setPastedElementContainmentFeature(EReference value);
+
+} // PapyrusTableInstance
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/PapyrustableinstanceFactory.java b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/PapyrustableinstanceFactory.java
new file mode 100644
index 00000000000..a724600c975
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/PapyrustableinstanceFactory.java
@@ -0,0 +1,46 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.infra.table.instance.papyrustableinstance;
+
+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.papyrus.infra.table.instance.papyrustableinstance.PapyrustableinstancePackage
+ * @generated
+ */
+public interface PapyrustableinstanceFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ PapyrustableinstanceFactory eINSTANCE = org.eclipse.papyrus.infra.table.instance.papyrustableinstance.impl.PapyrustableinstanceFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Papyrus Table Instance</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Papyrus Table Instance</em>'.
+ * @generated
+ */
+ PapyrusTableInstance createPapyrusTableInstance();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ PapyrustableinstancePackage getPapyrustableinstancePackage();
+
+} //PapyrustableinstanceFactory
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/PapyrustableinstancePackage.java b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/PapyrustableinstancePackage.java
new file mode 100644
index 00000000000..8225654ec0a
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/PapyrustableinstancePackage.java
@@ -0,0 +1,332 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.infra.table.instance.papyrustableinstance;
+
+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.EcorePackage;
+
+/**
+ * <!-- 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 enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrustableinstanceFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface PapyrustableinstancePackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "papyrustableinstance";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.eclipse.org/Papyrus/Table/0.8.0/papyrustableinstance";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "org.eclipse.papyrus.infra.table.instance.papyrustableinstance";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ PapyrustableinstancePackage eINSTANCE = org.eclipse.papyrus.infra.table.instance.papyrustableinstance.impl.PapyrustableinstancePackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.impl.PapyrusTableInstanceImpl <em>Papyrus Table Instance</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.infra.table.instance.papyrustableinstance.impl.PapyrusTableInstanceImpl
+ * @see org.eclipse.papyrus.infra.table.instance.papyrustableinstance.impl.PapyrustableinstancePackageImpl#getPapyrusTableInstance()
+ * @generated
+ */
+ int PAPYRUS_TABLE_INSTANCE = 0;
+
+ /**
+ * The feature id for the '<em><b>EAnnotations</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE_INSTANCE__EANNOTATIONS = EcorePackage.EMODEL_ELEMENT__EANNOTATIONS;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE_INSTANCE__NAME = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Type</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE_INSTANCE__TYPE = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Is Synchronized</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE_INSTANCE__IS_SYNCHRONIZED = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 2;
+
+ /**
+ * The feature id for the '<em><b>Table</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE_INSTANCE__TABLE = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 3;
+
+ /**
+ * The feature id for the '<em><b>Filling Queries</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE_INSTANCE__FILLING_QUERIES = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 4;
+
+ /**
+ * The feature id for the '<em><b>Pasted Element Id</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE_INSTANCE__PASTED_ELEMENT_ID = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 5;
+
+ /**
+ * The feature id for the '<em><b>Pasted Element Containment Feature</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE_INSTANCE__PASTED_ELEMENT_CONTAINMENT_FEATURE = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 6;
+
+ /**
+ * The number of structural features of the '<em>Papyrus Table Instance</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE_INSTANCE_FEATURE_COUNT = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 7;
+
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance <em>Papyrus Table Instance</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Papyrus Table Instance</em>'.
+ * @see org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance
+ * @generated
+ */
+ EClass getPapyrusTableInstance();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getName()
+ * @see #getPapyrusTableInstance()
+ * @generated
+ */
+ EAttribute getPapyrusTableInstance_Name();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getType <em>Type</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Type</em>'.
+ * @see org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getType()
+ * @see #getPapyrusTableInstance()
+ * @generated
+ */
+ EAttribute getPapyrusTableInstance_Type();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#isIsSynchronized <em>Is Synchronized</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Is Synchronized</em>'.
+ * @see org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#isIsSynchronized()
+ * @see #getPapyrusTableInstance()
+ * @generated
+ */
+ EAttribute getPapyrusTableInstance_IsSynchronized();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getTable <em>Table</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Table</em>'.
+ * @see org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getTable()
+ * @see #getPapyrusTableInstance()
+ * @generated
+ */
+ EReference getPapyrusTableInstance_Table();
+
+ /**
+ * Returns the meta object for the reference list '{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getFillingQueries <em>Filling Queries</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Filling Queries</em>'.
+ * @see org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getFillingQueries()
+ * @see #getPapyrusTableInstance()
+ * @generated
+ */
+ EReference getPapyrusTableInstance_FillingQueries();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getPastedElementId <em>Pasted Element Id</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Pasted Element Id</em>'.
+ * @see org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getPastedElementId()
+ * @see #getPapyrusTableInstance()
+ * @generated
+ */
+ EAttribute getPapyrusTableInstance_PastedElementId();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getPastedElementContainmentFeature <em>Pasted Element Containment Feature</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Pasted Element Containment Feature</em>'.
+ * @see org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance#getPastedElementContainmentFeature()
+ * @see #getPapyrusTableInstance()
+ * @generated
+ */
+ EReference getPapyrusTableInstance_PastedElementContainmentFeature();
+
+ /**
+ * 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
+ */
+ PapyrustableinstanceFactory getPapyrustableinstanceFactory();
+
+ /**
+ * <!-- 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 enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.impl.PapyrusTableInstanceImpl <em>Papyrus Table Instance</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.infra.table.instance.papyrustableinstance.impl.PapyrusTableInstanceImpl
+ * @see org.eclipse.papyrus.infra.table.instance.papyrustableinstance.impl.PapyrustableinstancePackageImpl#getPapyrusTableInstance()
+ * @generated
+ */
+ EClass PAPYRUS_TABLE_INSTANCE = eINSTANCE.getPapyrusTableInstance();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PAPYRUS_TABLE_INSTANCE__NAME = eINSTANCE.getPapyrusTableInstance_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Type</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PAPYRUS_TABLE_INSTANCE__TYPE = eINSTANCE.getPapyrusTableInstance_Type();
+
+ /**
+ * The meta object literal for the '<em><b>Is Synchronized</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PAPYRUS_TABLE_INSTANCE__IS_SYNCHRONIZED = eINSTANCE.getPapyrusTableInstance_IsSynchronized();
+
+ /**
+ * The meta object literal for the '<em><b>Table</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PAPYRUS_TABLE_INSTANCE__TABLE = eINSTANCE.getPapyrusTableInstance_Table();
+
+ /**
+ * The meta object literal for the '<em><b>Filling Queries</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PAPYRUS_TABLE_INSTANCE__FILLING_QUERIES = eINSTANCE.getPapyrusTableInstance_FillingQueries();
+
+ /**
+ * The meta object literal for the '<em><b>Pasted Element Id</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PAPYRUS_TABLE_INSTANCE__PASTED_ELEMENT_ID = eINSTANCE.getPapyrusTableInstance_PastedElementId();
+
+ /**
+ * The meta object literal for the '<em><b>Pasted Element Containment Feature</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PAPYRUS_TABLE_INSTANCE__PASTED_ELEMENT_CONTAINMENT_FEATURE = eINSTANCE.getPapyrusTableInstance_PastedElementContainmentFeature();
+
+ }
+
+} //PapyrustableinstancePackage
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/impl/PapyrusTableInstanceImpl.java b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/impl/PapyrusTableInstanceImpl.java
new file mode 100644
index 00000000000..7b9318da85d
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/impl/PapyrusTableInstanceImpl.java
@@ -0,0 +1,498 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.infra.table.instance.papyrustableinstance.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.EModelElementImpl;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.EObjectResolvingEList;
+
+import org.eclipse.emf.facet.infra.query.ModelQuery;
+
+import org.eclipse.emf.facet.widgets.nattable.instance.tableinstance2.TableInstance2;
+
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance;
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrustableinstancePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Papyrus Table Instance</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.impl.PapyrusTableInstanceImpl#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.impl.PapyrusTableInstanceImpl#getType <em>Type</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.impl.PapyrusTableInstanceImpl#isIsSynchronized <em>Is Synchronized</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.impl.PapyrusTableInstanceImpl#getTable <em>Table</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.impl.PapyrusTableInstanceImpl#getFillingQueries <em>Filling Queries</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.impl.PapyrusTableInstanceImpl#getPastedElementId <em>Pasted Element Id</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.instance.papyrustableinstance.impl.PapyrusTableInstanceImpl#getPastedElementContainmentFeature <em>Pasted Element Containment Feature</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class PapyrusTableInstanceImpl extends
+EModelElementImpl implements PapyrusTableInstance {
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = "no name";
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getType() <em>Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getType()
+ * @generated
+ * @ordered
+ */
+ protected static final String TYPE_EDEFAULT = "PapyrusDefaultTable";
+
+ /**
+ * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getType()
+ * @generated
+ * @ordered
+ */
+ protected String type = TYPE_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #isIsSynchronized() <em>Is Synchronized</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isIsSynchronized()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean IS_SYNCHRONIZED_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isIsSynchronized() <em>Is Synchronized</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isIsSynchronized()
+ * @generated
+ * @ordered
+ */
+ protected boolean isSynchronized = IS_SYNCHRONIZED_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getTable() <em>Table</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTable()
+ * @generated
+ * @ordered
+ */
+ protected TableInstance2 table;
+
+ /**
+ * The cached value of the '{@link #getFillingQueries() <em>Filling Queries</em>}' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getFillingQueries()
+ * @generated
+ * @ordered
+ */
+ protected EList<ModelQuery> fillingQueries;
+
+ /**
+ * The default value of the '{@link #getPastedElementId() <em>Pasted Element Id</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPastedElementId()
+ * @generated
+ * @ordered
+ */
+ protected static final String PASTED_ELEMENT_ID_EDEFAULT = "";
+
+ /**
+ * The cached value of the '{@link #getPastedElementId() <em>Pasted Element Id</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPastedElementId()
+ * @generated
+ * @ordered
+ */
+ protected String pastedElementId = PASTED_ELEMENT_ID_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getPastedElementContainmentFeature() <em>Pasted Element Containment Feature</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPastedElementContainmentFeature()
+ * @generated
+ * @ordered
+ */
+ protected EReference pastedElementContainmentFeature;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrusTableInstanceImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PapyrustableinstancePackage.Literals.PAPYRUS_TABLE_INSTANCE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName) {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setType(String newType) {
+ String oldType = type;
+ type = newType;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__TYPE, oldType, type));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isIsSynchronized() {
+ return isSynchronized;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setIsSynchronized(boolean newIsSynchronized) {
+ boolean oldIsSynchronized = isSynchronized;
+ isSynchronized = newIsSynchronized;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__IS_SYNCHRONIZED, oldIsSynchronized, isSynchronized));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TableInstance2 getTable() {
+ if (table != null && table.eIsProxy()) {
+ InternalEObject oldTable = (InternalEObject)table;
+ table = (TableInstance2)eResolveProxy(oldTable);
+ if (table != oldTable) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__TABLE, oldTable, table));
+ }
+ }
+ return table;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TableInstance2 basicGetTable() {
+ return table;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setTable(TableInstance2 newTable) {
+ TableInstance2 oldTable = table;
+ table = newTable;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__TABLE, oldTable, table));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<ModelQuery> getFillingQueries() {
+ if (fillingQueries == null) {
+ fillingQueries = new EObjectResolvingEList<ModelQuery>(ModelQuery.class, this, PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__FILLING_QUERIES);
+ }
+ return fillingQueries;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getPastedElementId() {
+ return pastedElementId;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setPastedElementId(String newPastedElementId) {
+ String oldPastedElementId = pastedElementId;
+ pastedElementId = newPastedElementId;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__PASTED_ELEMENT_ID, oldPastedElementId, pastedElementId));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPastedElementContainmentFeature() {
+ if (pastedElementContainmentFeature != null && pastedElementContainmentFeature.eIsProxy()) {
+ InternalEObject oldPastedElementContainmentFeature = (InternalEObject)pastedElementContainmentFeature;
+ pastedElementContainmentFeature = (EReference)eResolveProxy(oldPastedElementContainmentFeature);
+ if (pastedElementContainmentFeature != oldPastedElementContainmentFeature) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__PASTED_ELEMENT_CONTAINMENT_FEATURE, oldPastedElementContainmentFeature, pastedElementContainmentFeature));
+ }
+ }
+ return pastedElementContainmentFeature;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference basicGetPastedElementContainmentFeature() {
+ return pastedElementContainmentFeature;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setPastedElementContainmentFeature(EReference newPastedElementContainmentFeature) {
+ EReference oldPastedElementContainmentFeature = pastedElementContainmentFeature;
+ pastedElementContainmentFeature = newPastedElementContainmentFeature;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__PASTED_ELEMENT_CONTAINMENT_FEATURE, oldPastedElementContainmentFeature, pastedElementContainmentFeature));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__NAME:
+ return getName();
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__TYPE:
+ return getType();
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__IS_SYNCHRONIZED:
+ return isIsSynchronized();
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__TABLE:
+ if (resolve) return getTable();
+ return basicGetTable();
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__FILLING_QUERIES:
+ return getFillingQueries();
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__PASTED_ELEMENT_ID:
+ return getPastedElementId();
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__PASTED_ELEMENT_CONTAINMENT_FEATURE:
+ if (resolve) return getPastedElementContainmentFeature();
+ return basicGetPastedElementContainmentFeature();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__NAME:
+ setName((String)newValue);
+ return;
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__TYPE:
+ setType((String)newValue);
+ return;
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__IS_SYNCHRONIZED:
+ setIsSynchronized((Boolean)newValue);
+ return;
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__TABLE:
+ setTable((TableInstance2)newValue);
+ return;
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__FILLING_QUERIES:
+ getFillingQueries().clear();
+ getFillingQueries().addAll((Collection<? extends ModelQuery>)newValue);
+ return;
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__PASTED_ELEMENT_ID:
+ setPastedElementId((String)newValue);
+ return;
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__PASTED_ELEMENT_CONTAINMENT_FEATURE:
+ setPastedElementContainmentFeature((EReference)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__TYPE:
+ setType(TYPE_EDEFAULT);
+ return;
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__IS_SYNCHRONIZED:
+ setIsSynchronized(IS_SYNCHRONIZED_EDEFAULT);
+ return;
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__TABLE:
+ setTable((TableInstance2)null);
+ return;
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__FILLING_QUERIES:
+ getFillingQueries().clear();
+ return;
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__PASTED_ELEMENT_ID:
+ setPastedElementId(PASTED_ELEMENT_ID_EDEFAULT);
+ return;
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__PASTED_ELEMENT_CONTAINMENT_FEATURE:
+ setPastedElementContainmentFeature((EReference)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__TYPE:
+ return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type);
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__IS_SYNCHRONIZED:
+ return isSynchronized != IS_SYNCHRONIZED_EDEFAULT;
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__TABLE:
+ return table != null;
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__FILLING_QUERIES:
+ return fillingQueries != null && !fillingQueries.isEmpty();
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__PASTED_ELEMENT_ID:
+ return PASTED_ELEMENT_ID_EDEFAULT == null ? pastedElementId != null : !PASTED_ELEMENT_ID_EDEFAULT.equals(pastedElementId);
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__PASTED_ELEMENT_CONTAINMENT_FEATURE:
+ return pastedElementContainmentFeature != null;
+ }
+ 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(" (name: ");
+ result.append(name);
+ result.append(", type: ");
+ result.append(type);
+ result.append(", isSynchronized: ");
+ result.append(isSynchronized);
+ result.append(", pastedElementId: ");
+ result.append(pastedElementId);
+ result.append(')');
+ return result.toString();
+ }
+
+} //PapyrusTableInstanceImpl
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/impl/PapyrustableinstanceFactoryImpl.java b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/impl/PapyrustableinstanceFactoryImpl.java
new file mode 100644
index 00000000000..fd7ec822bdc
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/impl/PapyrustableinstanceFactoryImpl.java
@@ -0,0 +1,99 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.infra.table.instance.papyrustableinstance.impl;
+
+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;
+
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PapyrustableinstanceFactoryImpl extends EFactoryImpl implements PapyrustableinstanceFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static PapyrustableinstanceFactory init() {
+ try {
+ PapyrustableinstanceFactory thePapyrustableinstanceFactory = (PapyrustableinstanceFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/Papyrus/Table/0.8.0/papyrustableinstance");
+ if (thePapyrustableinstanceFactory != null) {
+ return thePapyrustableinstanceFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new PapyrustableinstanceFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrustableinstanceFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE: return createPapyrusTableInstance();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrusTableInstance createPapyrusTableInstance() {
+ PapyrusTableInstanceImpl papyrusTableInstance = new PapyrusTableInstanceImpl();
+ return papyrusTableInstance;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrustableinstancePackage getPapyrustableinstancePackage() {
+ return (PapyrustableinstancePackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static PapyrustableinstancePackage getPackage() {
+ return PapyrustableinstancePackage.eINSTANCE;
+ }
+
+} //PapyrustableinstanceFactoryImpl
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/impl/PapyrustableinstancePackageImpl.java b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/impl/PapyrustableinstancePackageImpl.java
new file mode 100644
index 00000000000..c4800df16e8
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/impl/PapyrustableinstancePackageImpl.java
@@ -0,0 +1,262 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.infra.table.instance.papyrustableinstance.impl;
+
+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.EcorePackage;
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.eclipse.emf.facet.infra.query.QueryPackage;
+
+import org.eclipse.emf.facet.widgets.nattable.instance.tableinstance2.Tableinstance2Package;
+
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance;
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrustableinstanceFactory;
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrustableinstancePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PapyrustableinstancePackageImpl extends EPackageImpl implements PapyrustableinstancePackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass papyrusTableInstanceEClass = 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.papyrus.infra.table.instance.papyrustableinstance.PapyrustableinstancePackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private PapyrustableinstancePackageImpl() {
+ super(eNS_URI, PapyrustableinstanceFactory.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 PapyrustableinstancePackage#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 PapyrustableinstancePackage init() {
+ if (isInited) return (PapyrustableinstancePackage)EPackage.Registry.INSTANCE.getEPackage(PapyrustableinstancePackage.eNS_URI);
+
+ // Obtain or create and register package
+ PapyrustableinstancePackageImpl thePapyrustableinstancePackage = (PapyrustableinstancePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof PapyrustableinstancePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new PapyrustableinstancePackageImpl());
+
+ isInited = true;
+
+ // Initialize simple dependencies
+ Tableinstance2Package.eINSTANCE.eClass();
+
+ // Create package meta-data objects
+ thePapyrustableinstancePackage.createPackageContents();
+
+ // Initialize created meta-data
+ thePapyrustableinstancePackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ thePapyrustableinstancePackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(PapyrustableinstancePackage.eNS_URI, thePapyrustableinstancePackage);
+ return thePapyrustableinstancePackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getPapyrusTableInstance() {
+ return papyrusTableInstanceEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPapyrusTableInstance_Name() {
+ return (EAttribute)papyrusTableInstanceEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPapyrusTableInstance_Type() {
+ return (EAttribute)papyrusTableInstanceEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPapyrusTableInstance_IsSynchronized() {
+ return (EAttribute)papyrusTableInstanceEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPapyrusTableInstance_Table() {
+ return (EReference)papyrusTableInstanceEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPapyrusTableInstance_FillingQueries() {
+ return (EReference)papyrusTableInstanceEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPapyrusTableInstance_PastedElementId() {
+ return (EAttribute)papyrusTableInstanceEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPapyrusTableInstance_PastedElementContainmentFeature() {
+ return (EReference)papyrusTableInstanceEClass.getEStructuralFeatures().get(6);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrustableinstanceFactory getPapyrustableinstanceFactory() {
+ return (PapyrustableinstanceFactory)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
+ papyrusTableInstanceEClass = createEClass(PAPYRUS_TABLE_INSTANCE);
+ createEAttribute(papyrusTableInstanceEClass, PAPYRUS_TABLE_INSTANCE__NAME);
+ createEAttribute(papyrusTableInstanceEClass, PAPYRUS_TABLE_INSTANCE__TYPE);
+ createEAttribute(papyrusTableInstanceEClass, PAPYRUS_TABLE_INSTANCE__IS_SYNCHRONIZED);
+ createEReference(papyrusTableInstanceEClass, PAPYRUS_TABLE_INSTANCE__TABLE);
+ createEReference(papyrusTableInstanceEClass, PAPYRUS_TABLE_INSTANCE__FILLING_QUERIES);
+ createEAttribute(papyrusTableInstanceEClass, PAPYRUS_TABLE_INSTANCE__PASTED_ELEMENT_ID);
+ createEReference(papyrusTableInstanceEClass, PAPYRUS_TABLE_INSTANCE__PASTED_ELEMENT_CONTAINMENT_FEATURE);
+ }
+
+ /**
+ * <!-- 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);
+
+ // Obtain other dependent packages
+ EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
+ Tableinstance2Package theTableinstance2Package = (Tableinstance2Package)EPackage.Registry.INSTANCE.getEPackage(Tableinstance2Package.eNS_URI);
+ QueryPackage theQueryPackage = (QueryPackage)EPackage.Registry.INSTANCE.getEPackage(QueryPackage.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+ papyrusTableInstanceEClass.getESuperTypes().add(theEcorePackage.getEModelElement());
+
+ // Initialize classes and features; add operations and parameters
+ initEClass(papyrusTableInstanceEClass, PapyrusTableInstance.class, "PapyrusTableInstance", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getPapyrusTableInstance_Name(), ecorePackage.getEString(), "name", "no name", 0, 1, PapyrusTableInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getPapyrusTableInstance_Type(), ecorePackage.getEString(), "type", "PapyrusDefaultTable", 0, 1, PapyrusTableInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getPapyrusTableInstance_IsSynchronized(), ecorePackage.getEBoolean(), "isSynchronized", "false", 0, 1, PapyrusTableInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getPapyrusTableInstance_Table(), theTableinstance2Package.getTableInstance2(), null, "table", null, 0, 1, PapyrusTableInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getPapyrusTableInstance_FillingQueries(), theQueryPackage.getModelQuery(), null, "fillingQueries", null, 0, -1, PapyrusTableInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getPapyrusTableInstance_PastedElementId(), ecorePackage.getEString(), "pastedElementId", "", 0, 1, PapyrusTableInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getPapyrusTableInstance_PastedElementContainmentFeature(), theEcorePackage.getEReference(), null, "pastedElementContainmentFeature", null, 0, 1, PapyrusTableInstance.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);
+ }
+
+} //PapyrustableinstancePackageImpl
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/util/PapyrustableinstanceAdapterFactory.java b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/util/PapyrustableinstanceAdapterFactory.java
new file mode 100644
index 00000000000..a0a7b717956
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/util/PapyrustableinstanceAdapterFactory.java
@@ -0,0 +1,143 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.infra.table.instance.papyrustableinstance.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.ecore.EModelElement;
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.*;
+
+/**
+ * <!-- 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.papyrus.infra.table.instance.papyrustableinstance.PapyrustableinstancePackage
+ * @generated
+ */
+public class PapyrustableinstanceAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static PapyrustableinstancePackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrustableinstanceAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = PapyrustableinstancePackage.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 PapyrustableinstanceSwitch<Adapter> modelSwitch =
+ new PapyrustableinstanceSwitch<Adapter>() {
+ @Override
+ public Adapter casePapyrusTableInstance(PapyrusTableInstance object) {
+ return createPapyrusTableInstanceAdapter();
+ }
+ @Override
+ public Adapter caseEModelElement(EModelElement object) {
+ return createEModelElementAdapter();
+ }
+ @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.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance <em>Papyrus Table Instance</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.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance
+ * @generated
+ */
+ public Adapter createPapyrusTableInstanceAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecore.EModelElement <em>EModel Element</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.ecore.EModelElement
+ * @generated
+ */
+ public Adapter createEModelElementAdapter() {
+ 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;
+ }
+
+} //PapyrustableinstanceAdapterFactory
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/util/PapyrustableinstanceSwitch.java b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/util/PapyrustableinstanceSwitch.java
new file mode 100644
index 00000000000..4a494087777
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.instance/src/org/eclipse/papyrus/infra/table/instance/papyrustableinstance/util/PapyrustableinstanceSwitch.java
@@ -0,0 +1,131 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.papyrus.infra.table.instance.papyrustableinstance.util;
+
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.Switch;
+
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.*;
+
+/**
+ * <!-- 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.papyrus.infra.table.instance.papyrustableinstance.PapyrustableinstancePackage
+ * @generated
+ */
+public class PapyrustableinstanceSwitch<T> extends Switch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static PapyrustableinstancePackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrustableinstanceSwitch() {
+ if (modelPackage == null) {
+ modelPackage = PapyrustableinstancePackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Checks whether this is a switch for the given package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @parameter ePackage the package in question.
+ * @return whether this is a switch for the given package.
+ * @generated
+ */
+ @Override
+ protected boolean isSwitchFor(EPackage ePackage) {
+ return ePackage == modelPackage;
+ }
+
+ /**
+ * 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
+ */
+ @Override
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE: {
+ PapyrusTableInstance papyrusTableInstance = (PapyrusTableInstance)theEObject;
+ T result = casePapyrusTableInstance(papyrusTableInstance);
+ if (result == null) result = caseEModelElement(papyrusTableInstance);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Papyrus Table Instance</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>Papyrus Table Instance</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T casePapyrusTableInstance(PapyrusTableInstance object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EModel Element</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>EModel Element</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseEModelElement(EModelElement 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
+ */
+ @Override
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //PapyrustableinstanceSwitch
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/.classpath b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/.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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/.project b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/.project
new file mode 100644
index 00000000000..db2442f94ec
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.table.modelexplorer</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/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/.settings/org.eclipse.core.resources.prefs b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 00000000000..c82fec208fa
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Fri Nov 04 17:02:59 CET 2011
+eclipse.preferences.version=1
+encoding//src/org/eclipse/papyrus/infra/table/modelexplorer/messages/messages.properties=ISO-8859-1
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/.settings/org.eclipse.jdt.core.prefs b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..eef3e01dddb
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Fri Feb 18 14:48:14 CET 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/META-INF/MANIFEST.MF b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..2afb7c89239
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/META-INF/MANIFEST.MF
@@ -0,0 +1,37 @@
+Manifest-Version: 1.0
+Require-Bundle: org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.1.0",
+ org.eclipse.emf.facet.infra.browser.custom.core,
+ org.eclipse.papyrus.views.modelexplorer;bundle-version="1.0.0",
+ org.eclipse.core.expressions,
+ org.eclipse.emf.facet.widgets.nattable.instance;bundle-version="0.1.0",
+ org.eclipse.papyrus.infra.table.instance;bundle-version="1.0.0",
+ org.eclipse.uml2.uml,
+ org.eclipse.emf.facet.infra.query.core,
+ org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.eclipse.emf.transaction;bundle-version="1.4.0",
+ org.eclipse.gmf.runtime.common.core;bundle-version="1.4.1",
+ org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.4.0",
+ org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.4.0",
+ org.eclipse.papyrus.infra.core.sasheditor;bundle-version="1.0.0",
+ org.eclipse.jface;bundle-version="3.8.0",
+ org.eclipse.ui,
+ org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.emf;bundle-version="1.0.0"
+Export-Package: org.eclipse.papyrus.infra.table.modelexplorer,
+ org.eclipse.papyrus.infra.table.modelexplorer.handlers,
+ org.eclipse.papyrus.infra.table.modelexplorer.messages,
+ org.eclipse.papyrus.infra.table.modelexplorer.providers
+Bundle-Vendor: %pluginProvider
+Bundle-ActivationPolicy: lazy
+Bundle-Version: 1.0.0.qualifier
+Bundle-Name: %pluginName
+Bundle-Localization: plugin
+Bundle-ManifestVersion: 2
+Bundle-Activator: org.eclipse.papyrus.infra.table.modelexplorer.Activa
+ tor
+Bundle-SymbolicName: org.eclipse.papyrus.infra.table.modelexplorer;sin
+ gleton:=true
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/about.html b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/about.html
new file mode 100644
index 00000000000..82d49bf5f81
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/build.properties b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/build.properties
new file mode 100644
index 00000000000..8f5a4c96094
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/build.properties
@@ -0,0 +1,12 @@
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ resources/,\
+ plugin.properties,\
+ about.html,\
+ bin/,\
+ documentation.pdoc
+output.. = bin/
+src.includes = about.html
+source.. = src/
+bin.. = bin/
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/documentation.pdoc b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/documentation.pdoc
new file mode 100644
index 00000000000..e7a7257ea7e
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/documentation.pdoc
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<doc:Documentation xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:doc="http://www.eclipse.org/papyrus/documentation/plugin/documentation" description="This plugin contributes to the ModelExplorer View. It provides customization&#xD;&#xA;to display the Table in the ModelExplorer View + some other functionalities concerning the tables">
+ <referent firstName="Vincent" lastName="Lorenzo" eMail="vincent.lorenzo@cea.fr" currentCompany="CEA-LIST"/>
+</doc:Documentation>
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/icons/table.png b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/icons/table.png
new file mode 100644
index 00000000000..2a979527f4a
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/icons/table.png
Binary files differ
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/plugin.properties b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/plugin.properties
new file mode 100644
index 00000000000..218c6567b7f
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/plugin.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.papyrus.infra.table.modelexplorer
+pluginProvider = Eclipse Modeling Project
+pluginName = Table Customization For Model Explorer (Incubation) \ No newline at end of file
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/plugin.xml b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/plugin.xml
new file mode 100644
index 00000000000..9281887daf2
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/plugin.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?eclipse version="3.4"?>
+
+<plugin>
+ <!-- we provide a new navigator content for the tables. To be called, this navigator content should have an id beginning with org.eclipse.papyrus.views.modelexplorer.* -->
+
+ <!--extension point="org.eclipse.ui.handlers">
+ <handler class="org.eclipse.papyrus.infra.table.modelexplorer.handlers.DuplicateTableHandler" commandId="org.eclipse.papyrus.views.modelexplorer.duplicate.command">
+ <activeWhen>
+ <and>
+ <with variable="selection">
+ //We add these tests for :
+ // - force the refresh of the action in the menu edit
+ // - avoid have 2 handlers enabled in the same time
+
+ <and>
+ <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.isDiagram" value="false">
+ </test>
+ <test forcePluginActivation="true" property="org.eclipse.papyrus.table.modelexplorer.tester.isTable" value="true">
+ </test>
+ </and>
+ </with>
+ </and>
+ </activeWhen>
+ </handler>
+ <handler class="org.eclipse.papyrus.infra.table.modelexplorer.handlers.RenameTableHandler" commandId="org.eclipse.ui.edit.rename">
+ <activeWhen>
+ <or>
+ <with variable="selection">
+ <and>
+ <count value="1">
+ </count>
+ <test forcePluginActivation="true" property="org.eclipse.papyrus.table.menu.providers.TableTester.isTable" value="true">
+ </test>
+ <test forcePluginActivation="true" property="org.eclipse.papyrus.views.modelexplorer.tester.view.isModelExplorer" value="true">
+ </test>
+ </and>
+ </with>
+ </or>
+ </activeWhen>
+ </handler>
+ </extension-->
+ <extension point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester class="org.eclipse.papyrus.infra.table.modelexplorer.providers.TablePropertyTester" id="org.eclipse.papyrus.table.modelexplorer.tester" namespace="org.eclipse.papyrus.table.modelexplorer.tester" properties="isTable" type="org.eclipse.jface.viewers.IStructuredSelection">
+ </propertyTester>
+ </extension>
+ <extension point="org.eclipse.emf.facet.infra.facet.registration">
+ <facetset file="resources/PapyrusTableFacet.facetSet"/>
+ </extension>
+ <extension point="org.eclipse.emf.facet.infra.query.registration">
+ <modelqueryset file="resources/PapyrusTableQuery.querySet"/>
+ </extension>
+ <extension point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
+ <browserCustomization file="resources/PapyrusTableFacetCustomization.uiCustom" loadByDefault="true"/>
+ </extension>
+ <extension point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
+ <browserCustomization file="resources/PapyrusTableInstanceCustomization.uiCustom" loadByDefault="true"/>
+ </extension>
+</plugin>
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableFacet.facetSet b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableFacet.facetSet
new file mode 100644
index 00000000000..b766ef65cfe
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableFacet.facetSet
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="ASCII"?>
+<facet:FacetSet xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:facet="http://www.eclipse.org/EmfFacet/infra/facet/0.8.incubation" xmlns:query="http://www.eclipse.org/EmfFacet/infra/query/0.8.incubation" name="PapyrusTableFacet" nsURI="http://org.eclipse.org/papyrus/modelExplorer/PapyrusTableFacet" nsPrefix="PapyrusTableFacet">
+ <eClassifiers xsi:type="facet:Facet" name="FacetTableContainer" abstract="true">
+ <eSuperTypes href="http://www.eclipse.org/uml2/4.0.0/UML#//Element"/>
+ <eStructuralFeatures xsi:type="facet:FacetReference" name="tables" upperBound="-1" volatile="true" unsettable="true">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/Papyrus/Table/0.8.0/papyrustableinstance#//PapyrusTableInstance"/>
+ <valueQuery xsi:type="query:JavaModelQuery" href="emffacet:/query/PapyrusTableQuery#GetContainedTables"/>
+ </eStructuralFeatures>
+ <conditionQuery xsi:type="query:JavaModelQuery" href="emffacet:/query/PapyrusTableQuery#IsTableContainer"/>
+ </eClassifiers>
+ <extendedPackage href="http://www.eclipse.org/uml2/4.0.0/UML#/"/>
+</facet:FacetSet>
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableFacetCustomization.uiCustom b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableFacetCustomization.uiCustom
new file mode 100644
index 00000000000..6b65c85443d
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableFacetCustomization.uiCustom
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="ASCII"?>
+<uicustom:MetamodelView xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:query="http://www.eclipse.org/EmfFacet/infra/query/0.8.incubation" xmlns:uicustom="http://www.eclipse.org/EmfFacet/infra/browser/custom/0.8" metamodelURI="http://org.eclipse.org/papyrus/modelExplorer/PapyrusTableFacet">
+ <types metaclassName="PapyrusTableFacet.FacetTableContainer">
+ <references referenceName="tables">
+ <customizedFeatures>
+ <valueCases>
+ <value xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ <condition xsi:type="query:JavaModelQuery" href="emffacet:/query/PapyrusTableQuery#IsTableContainer"/>
+ </valueCases>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ <customizedFeatures customizedFeature="collapseLink">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="true"/>
+ </customizedFeatures>
+ </references>
+ </types>
+</uicustom:MetamodelView>
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableInstanceCustomization.uiCustom b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableInstanceCustomization.uiCustom
new file mode 100644
index 00000000000..14f759c0697
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableInstanceCustomization.uiCustom
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ASCII"?>
+<uicustom:MetamodelView xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:query="http://www.eclipse.org/EmfFacet/infra/query/0.8.incubation" xmlns:uicustom="http://www.eclipse.org/EmfFacet/infra/browser/custom/0.8" metamodelURI="http://www.eclipse.org/Papyrus/Table/0.8.0/papyrustableinstance">
+ <types metaclassName="papyrustableinstance.PapyrusTableInstance">
+ <customizedFeatures customizedFeature="icon">
+ <defaultValue xsi:type="uicustom:DerivedFeatureValue">
+ <valueCalculator xsi:type="query:JavaModelQuery" href="emffacet:/query/PapyrusTableQuery#GetTableIcon"/>
+ </defaultValue>
+ </customizedFeatures>
+ <customizedFeatures customizedFeature="hideMetaclassName">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="true"/>
+ </customizedFeatures>
+ <customizedFeatures customizedFeature="label">
+ <defaultValue xsi:type="uicustom:DerivedFeatureValue">
+ <valueCalculator xsi:type="query:JavaModelQuery" href="emffacet:/query/PapyrusTableQuery#GetTableName"/>
+ </defaultValue>
+ </customizedFeatures>
+ <references referenceName="fillingQueries">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="table">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+</uicustom:MetamodelView>
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableQuery.querySet b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableQuery.querySet
new file mode 100644
index 00000000000..607a65452d2
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableQuery.querySet
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ASCII"?>
+<query:ModelQuerySet xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:query="http://www.eclipse.org/EmfFacet/infra/query/0.8.incubation" name="PapyrusTableQuery">
+ <associatedMetamodels href="http://www.eclipse.org/Papyrus/Table/0.8.0/papyrustableinstance#/"/>
+ <associatedMetamodels href="http://www.eclipse.org/emf/2002/Ecore#/"/>
+ <associatedMetamodels href="http://www.eclipse.org/uml2/4.0.0/UML#/"/>
+ <associatedMetamodels href="http://www.eclipse.org/uml2/4.0.0/Types#/"/>
+ <queries xsi:type="query:JavaModelQuery" name="IsTableContainer" description="Returns true if the element contains a Table" implementationClassName="org.eclipse.papyrus.infra.table.modelexplorer.queries.IsTableContainer">
+ <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
+ <scope href="http://www.eclipse.org/uml2/4.0.0/UML#//Element"/>
+ </queries>
+ <queries xsi:type="query:JavaModelQuery" name="GetContainedTables" description="Get the collection of all contained tables" upperBound="-1" implementationClassName="org.eclipse.papyrus.infra.table.modelexplorer.queries.GetContainedTables">
+ <returnType xsi:type="ecore:EClass" href="http://www.eclipse.org/Papyrus/Table/0.8.0/papyrustableinstance#//PapyrusTableInstance"/>
+ <scope href="http://www.eclipse.org/uml2/4.0.0/UML#//Element"/>
+ </queries>
+ <queries xsi:type="query:JavaModelQuery" name="GetTableIcon" description="Return the path to the icon of the corresponding table" implementationClassName="org.eclipse.papyrus.infra.table.modelexplorer.queries.GetTableIcon">
+ <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//String"/>
+ <scope href="http://www.eclipse.org/Papyrus/Table/0.8.0/papyrustableinstance#//PapyrusTableInstance"/>
+ </queries>
+ <queries xsi:type="query:JavaModelQuery" name="GetTableName" description="Return the name for the table" implementationClassName="org.eclipse.papyrus.infra.table.modelexplorer.queries.GetTableName">
+ <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//String"/>
+ <scope href="http://www.eclipse.org/Papyrus/Table/0.8.0/papyrustableinstance#//PapyrusTableInstance"/>
+ </queries>
+</query:ModelQuerySet>
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/Activator.java b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/Activator.java
new file mode 100644
index 00000000000..e7433ff7ace
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/Activator.java
@@ -0,0 +1,121 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.table.modelexplorer;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.edit.EMFEditPlugin;
+import org.eclipse.emf.facet.infra.browser.custom.MetamodelView;
+import org.eclipse.emf.facet.infra.browser.custom.core.CustomizationsCatalog;
+import org.eclipse.emf.facet.infra.browser.uicore.CustomizationManager;
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.table.modelexplorer"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /** the customization manager */
+ private CustomizationManager fCustomizationManager;
+
+ public static LogHelper log;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ log = new LogHelper(this);
+ EMFEditPlugin.getComposedAdapterFactoryDescriptorRegistry();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ *
+ * @return the customization manager in charge to adapt element in modisco
+ */
+ public CustomizationManager getCustomizationManager() {
+ if(this.fCustomizationManager == null) {
+ this.fCustomizationManager = new CustomizationManager();
+ init(this.fCustomizationManager);
+ }
+ return this.fCustomizationManager;
+ }
+
+ /**
+ *
+ * @param customizationManager
+ * the customization manager to init
+ */
+ private void init(final CustomizationManager customizationManager) {
+ // the appearance can be customized here:
+
+ customizationManager.setShowDerivedLinks(true);
+
+ try {
+
+ // load customizations defined as default through the customization
+ // extension
+ List<MetamodelView> registryDefaultCustomizations = CustomizationsCatalog.getInstance().getRegistryDefaultCustomizations();
+ for(MetamodelView metamodelView : registryDefaultCustomizations) {
+ customizationManager.registerCustomization(metamodelView);
+ }
+ customizationManager.loadCustomizations();
+
+ } catch (Throwable e) {
+ Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Error initializing customizations", e)); //$NON-NLS-1$
+ }
+ }
+
+}
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/AbstractTableModelExplorerHandler.java b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/AbstractTableModelExplorerHandler.java
new file mode 100644
index 00000000000..9ff84a43227
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/AbstractTableModelExplorerHandler.java
@@ -0,0 +1,61 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.table.modelexplorer.handlers;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance;
+import org.eclipse.papyrus.views.modelexplorer.handler.AbstractCommandHandler;
+import org.eclipse.ui.PlatformUI;
+
+
+public abstract class AbstractTableModelExplorerHandler extends AbstractCommandHandler {
+
+ /**
+ * Returns the list of selected tables
+ *
+ * @return
+ * the list of selected tables
+ */
+ protected List<PapyrusTableInstance> getSelectedTables() {
+ List<PapyrusTableInstance> tables = new ArrayList<PapyrusTableInstance>();
+ ISelection selection = null;
+
+ // Get current selection
+ selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
+
+ // Get first element if the selection is an IStructuredSelection
+ if(selection instanceof IStructuredSelection) {
+ IStructuredSelection structuredSelection = (IStructuredSelection)selection;
+ Iterator<?> iter = structuredSelection.iterator();
+ while(iter.hasNext()) {
+ Object current = iter.next();
+ if(current instanceof IAdaptable){
+ EObject table = (EObject)((IAdaptable)current).getAdapter(EObject.class);
+ if(table instanceof PapyrusTableInstance){
+ tables.add((PapyrusTableInstance)table);
+ }
+ }
+ }
+ }
+ return tables;
+ }
+
+}
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DeleteTableHandler.java b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DeleteTableHandler.java
new file mode 100644
index 00000000000..6c9a9372551
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DeleteTableHandler.java
@@ -0,0 +1,71 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.table.modelexplorer.handlers;
+
+import java.util.List;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.command.UnexecutableCommand;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.papyrus.commands.DestroyElementPapyrusCommand;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance;
+
+/**
+ * Handler for the delete Table action
+ *
+ *
+ *
+ */
+public class DeleteTableHandler extends AbstractTableModelExplorerHandler {
+
+
+ /**
+ *
+ * @see org.eclipse.papyrus.views.modelexplorer.handler.AbstractCommandHandler#getCommand()
+ *
+ * @return
+ */
+ @Override
+ protected Command getCommand() {
+ TransactionalEditingDomain editingDomain = getEditingDomain();
+ final IPageManager pageMngr = getPageManager();
+
+ List<PapyrusTableInstance> tables = getSelectedTables();
+
+ if(editingDomain != null && pageMngr != null && !tables.isEmpty()) {
+ CompoundCommand command = new CompoundCommand();
+
+ for(final PapyrusTableInstance table : tables) {
+ Command sashRemoveComd = new RecordingCommand(editingDomain) {
+
+ @Override
+ protected void doExecute() {
+ pageMngr.removePage(table);
+ }
+ };
+ // the destroy element command is a good way to destroy the cross reference
+ command.append(sashRemoveComd);
+ command.append(new GMFtoEMFCommandWrapper(new DestroyElementPapyrusCommand(new DestroyElementRequest(table.getTable(), false))));
+ command.append(new GMFtoEMFCommandWrapper(new DestroyElementPapyrusCommand(new DestroyElementRequest(table, false))));
+ }
+ return command.isEmpty() ? UnexecutableCommand.INSTANCE : command;
+ }
+ return UnexecutableCommand.INSTANCE;
+ }
+}
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DuplicateTableHandler.java b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DuplicateTableHandler.java
new file mode 100644
index 00000000000..2c1d11697b0
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DuplicateTableHandler.java
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.table.modelexplorer.handlers;
+
+import java.util.List;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.command.UnexecutableCommand;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance;
+import org.eclipse.papyrus.infra.table.modelexplorer.messages.Messages;
+
+/**
+ * This handler provides the duplicate action for the tables
+ *
+ *
+ *
+ */
+public class DuplicateTableHandler extends AbstractTableModelExplorerHandler {
+
+ /**
+ *
+ * @see org.eclipse.papyrus.views.modelexplorer.handler.AbstractCommandHandler#getCommand()
+ *
+ * @return
+ */
+ @Override
+ protected Command getCommand() {
+ TransactionalEditingDomain editingDomain = getEditingDomain();
+ final IPageManager pageManager = getPageManager();
+ List<PapyrusTableInstance> tables = getSelectedTables();
+
+ if(editingDomain != null && pageManager != null && !tables.isEmpty()) {
+ CompoundCommand command = new CompoundCommand();
+ for(PapyrusTableInstance table : tables) {
+
+ // Clone the current table
+ final PapyrusTableInstance newTable = EcoreUtil.copy(table);
+
+ // Give a new name
+ newTable.setName(Messages.DuplicateTableHandler_CopyOf + newTable.getName());
+
+ //we duplicate parameters and rename the new table!
+
+
+ Command addGmfDiagramCmd = new AddCommand(editingDomain, table.eResource().getContents(), newTable);
+ // EMFCommandOperation operation = new EMFCommandOperation(editingDomain, addGmfDiagramCmd);
+
+ Command sashOpenCmd = new RecordingCommand(editingDomain, "Open duplicated table") {
+
+ @Override
+ protected void doExecute() {
+ pageManager.openPage(newTable);
+ }
+ };
+ //
+ // // TODO : synchronize with Cedric
+ // command.append(operation.getCommand());
+ command.append(addGmfDiagramCmd);
+ command.append(sashOpenCmd);
+ }
+ return command.isEmpty() ? UnexecutableCommand.INSTANCE : command;
+ }
+ return UnexecutableCommand.INSTANCE;
+ }
+}
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/RenameTableHandler.java b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/RenameTableHandler.java
new file mode 100644
index 00000000000..3c007165413
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/RenameTableHandler.java
@@ -0,0 +1,84 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.table.modelexplorer.handlers;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.UnexecutableCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance;
+import org.eclipse.papyrus.infra.table.modelexplorer.messages.Messages;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * This handler provides the method to rename a Table
+ *
+ *
+ *
+ */
+public class RenameTableHandler extends AbstractTableModelExplorerHandler {
+
+
+ /**
+ *
+ * @see org.eclipse.papyrus.views.modelexplorer.handler.AbstractCommandHandler#getCommand()
+ *
+ * @return
+ */
+ @Override
+ protected Command getCommand() {
+ TransactionalEditingDomain editingDomain = getEditingDomain();
+ List<PapyrusTableInstance> tables = getSelectedTables();
+ if(editingDomain != null && tables.size() == 1) {
+
+ final PapyrusTableInstance table = tables.get(0);
+ final String currentName = table.getName();
+
+ if(currentName != null) {
+
+ AbstractTransactionalCommand cmd = new AbstractTransactionalCommand(editingDomain, "RenameTableCommand", null) { //$NON-NLS-1$
+
+ @Override
+ protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) {
+ InputDialog dialog = new InputDialog(Display.getCurrent().getActiveShell(), Messages.RenameTableHandler_RenameAnExistingTable_Title, Messages.RenameTableHandler_NewNameMessage, currentName, null);
+ if(dialog.open() == Window.OK) {
+ final String name = dialog.getValue();
+ if(name != null && name.length() > 0) {
+ table.setName(name);
+ }
+ return CommandResult.newOKCommandResult();
+ } else {
+ return CommandResult.newCancelledCommandResult();
+ }
+ }
+ };
+ return new GMFtoEMFCommandWrapper(cmd);
+ }
+
+ }
+ return UnexecutableCommand.INSTANCE;
+ }
+
+
+
+
+}
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/messages/Messages.java b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/messages/Messages.java
new file mode 100644
index 00000000000..7fe4c99c629
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/messages/Messages.java
@@ -0,0 +1,34 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.table.modelexplorer.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+
+ private static final String BUNDLE_NAME = "org.eclipse.papyrus.infra.table.modelexplorer.messages.messages"; //$NON-NLS-1$
+
+ public static String DuplicateTableHandler_CopyOf;
+
+ public static String RenameTableHandler_NewNameMessage;
+
+ public static String RenameTableHandler_RenameAnExistingTable_Title;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/messages/messages.properties b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/messages/messages.properties
new file mode 100644
index 00000000000..c5ff485ad7f
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/messages/messages.properties
@@ -0,0 +1,3 @@
+DuplicateTableHandler_CopyOf=Copy of
+RenameTableHandler_NewNameMessage=New name
+RenameTableHandler_RenameAnExistingTable_Title=Rename an existing table
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/providers/TablePropertyTester.java b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/providers/TablePropertyTester.java
new file mode 100644
index 00000000000..495e63ae231
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/providers/TablePropertyTester.java
@@ -0,0 +1,85 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.table.modelexplorer.providers;
+
+import java.util.Iterator;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance;
+
+/**
+ * This class provides test called by the plugin.xml in order to know if handlers should be active or not.
+ *
+ * Sometimes these test can be done directly in the plugin.xml in the activeWhen (with instanceof, adapt, ...),
+ * but in this case, Eclipse doesn't refresh correctly the status of the command in the menu Edit or in other menu.
+ *
+ *
+ * FIXME : i think this class is not yet used
+ */
+public class TablePropertyTester extends PropertyTester {
+
+
+ /** property to test if the selected elements is a table */
+ public static final String IS_TABLE = "isTable"; //$NON-NLS-1$
+
+
+ /**
+ *
+ * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
+ *
+ * @param receiver
+ * @param property
+ * @param args
+ * @param expectedValue
+ * @return
+ */
+ public boolean test(final Object receiver, final String property, final Object[] args, final Object expectedValue) {
+ if(IS_TABLE.equals(property) && receiver instanceof IStructuredSelection) {
+ boolean answer = isTable((IStructuredSelection)receiver);
+ return new Boolean(answer).equals(expectedValue);
+ }
+ return false;
+ }
+
+
+
+ /**
+ * Tests the selection in order to know if it contains only {@link TableInstance}
+ *
+ * @param selection
+ * @return
+ * <code>true</code> if the selection is composed by {@link TableInstance}
+ */
+ private boolean isTable(final IStructuredSelection selection) {
+ if(!selection.isEmpty()) {
+ Iterator<?> iter = selection.iterator();
+ while(iter.hasNext()) {
+ /**
+ * Set to use the IAdaptable mechanism
+ * Used for example for facet elements
+ */
+ final Object next = iter.next();
+ EObject table = EMFHelper.getEObject(next);
+ if(!(table instanceof PapyrusTableInstance)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetContainedTables.java b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetContainedTables.java
new file mode 100644
index 00000000000..3a902c9dd57
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetContainedTables.java
@@ -0,0 +1,65 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.table.modelexplorer.queries;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.facet.infra.query.core.exception.ModelQueryExecutionException;
+import org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery;
+import org.eclipse.emf.facet.infra.query.core.java.ParameterValueList;
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance;
+import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils;
+import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQuery;
+
+/** Get the collection of all contained tables */
+//FIXME this query is declared using Element in the querySet -> change into EObject when the EMF-Facet bug will be corrected 365744
+public class GetContainedTables extends AbstractEditorContainerQuery implements IJavaModelQuery<EObject, Collection<PapyrusTableInstance>> {
+
+ /**
+ * {@inheritDoc}
+ */
+ public Collection<PapyrusTableInstance> evaluate(final EObject context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
+ List<PapyrusTableInstance> result = new ArrayList<PapyrusTableInstance>();
+ Iterator<EObject> diRoots = NavigatorUtils.getDiRoots(context);
+ Iterator<EObject> notationRoots = NavigatorUtils.getNotationRoots(context);
+ if(diRoots == null && notationRoots == null) {
+ return result;
+ }
+
+ findTablesInIterator(diRoots, result, context);
+ findTablesInIterator(notationRoots, result, context);
+
+ return result;
+ }
+
+ private void findTablesInIterator(Iterator<EObject> iterator, Collection<PapyrusTableInstance> result, EObject context) {
+ while(iterator.hasNext()) {
+ EObject root = iterator.next();
+ if(root instanceof PapyrusTableInstance) {
+ PapyrusTableInstance tableInstance = (PapyrusTableInstance)root;
+ if(tableInstance.getTable() != null) {
+ if(EcoreUtil.equals(tableInstance.getTable().getContext(), context)) {
+ result.add(tableInstance);
+ }
+ }
+ }
+ }
+ }
+
+}
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetTableIcon.java b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetTableIcon.java
new file mode 100644
index 00000000000..241afbf5cad
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetTableIcon.java
@@ -0,0 +1,33 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.table.modelexplorer.queries;
+
+import org.eclipse.emf.facet.infra.query.core.exception.ModelQueryExecutionException;
+import org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery;
+import org.eclipse.emf.facet.infra.query.core.java.ParameterValueList;
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance;
+import org.eclipse.papyrus.views.modelexplorer.queries.AbstractGetEditorIconQuery;
+
+/** Return the path to the icon of the corresponding table */
+public class GetTableIcon extends AbstractGetEditorIconQuery implements IJavaModelQuery<PapyrusTableInstance, String> {
+
+ /**
+ * {@inheritDoc}
+ */
+ public String evaluate(final PapyrusTableInstance context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
+
+ System.out.println("/org.eclipse.papyrus.infra.table.modelexplorer/icons/table.png");
+ return "/org.eclipse.papyrus.infra.table.modelexplorer/icons/table.png";// + getEditorRegistry(context).getEditorURLIcon(context); //$NON-NLS-1$
+ }
+}
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetTableName.java b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetTableName.java
new file mode 100644
index 00000000000..a1da86b8526
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetTableName.java
@@ -0,0 +1,31 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.table.modelexplorer.queries;
+
+import org.eclipse.emf.facet.infra.query.core.exception.ModelQueryExecutionException;
+import org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery;
+import org.eclipse.emf.facet.infra.query.core.java.ParameterValueList;
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance;
+
+/** Return the name for the table */
+public class GetTableName implements IJavaModelQuery<PapyrusTableInstance, String> {
+
+ /**
+ * {@inheritDoc}
+ */
+ public String evaluate(final PapyrusTableInstance context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
+ return context.getName();
+ }
+}
diff --git a/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/IsTableContainer.java b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/IsTableContainer.java
new file mode 100644
index 00000000000..5c7883c5908
--- /dev/null
+++ b/extraplugins/tablemigration/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/IsTableContainer.java
@@ -0,0 +1,63 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.table.modelexplorer.queries;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.facet.infra.query.core.exception.ModelQueryExecutionException;
+import org.eclipse.emf.facet.infra.query.core.java.IJavaModelQuery;
+import org.eclipse.emf.facet.infra.query.core.java.ParameterValueList;
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance;
+import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils;
+import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQuery;
+
+/** Returns true if the element contains a Table */
+//FIXME this query is declared using Element in the querySet -> change into EObject when the EMF-Facet bug will be corrected 365744
+public class IsTableContainer extends AbstractEditorContainerQuery implements IJavaModelQuery<EObject, Boolean> {
+
+ /**
+ * {@inheritDoc}
+ */
+ public Boolean evaluate(final EObject context, ParameterValueList parameterValues) throws ModelQueryExecutionException {
+ Iterator<EObject> diRoots = NavigatorUtils.getDiRoots(context);
+ if(evaluate(context, diRoots)) {
+ return true;
+ }
+
+ Iterator<EObject> notationRoots = NavigatorUtils.getNotationRoots(context);
+ return evaluate(context, notationRoots);
+ }
+
+ private Boolean evaluate(EObject context, Iterator<EObject> searchIn) {
+ if(searchIn == null) {
+ return false;
+ }
+
+ while(searchIn.hasNext()) {
+ EObject root = searchIn.next();
+ if(root instanceof PapyrusTableInstance) {
+ PapyrusTableInstance tableInstance = (PapyrusTableInstance)root;
+ if(tableInstance.getTable() != null) {
+ if(EcoreUtil.equals(tableInstance.getTable().getContext(), context)) {
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+}

Back to the top