Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2012-05-15 14:37:52 +0000
committervlorenzo2012-05-15 14:37:52 +0000
commitca86e81cda13a010c9dbb9d177525001e65dcf91 (patch)
tree71a5d7fdb4c8682d046ecba1cda576a55efa86a0 /sandbox
parent00f6ed254129839c3f93ae04e64a48f7862a6cb8 (diff)
downloadorg.eclipse.papyrus-ca86e81cda13a010c9dbb9d177525001e65dcf91.tar.gz
org.eclipse.papyrus-ca86e81cda13a010c9dbb9d177525001e65dcf91.tar.xz
org.eclipse.papyrus-ca86e81cda13a010c9dbb9d177525001e65dcf91.zip
Save the new version of the project oep.infra.table.modelexplorer
->the modelexplorer manages the new tables
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/.classpath7
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/.project28
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/META-INF/MANIFEST.MF30
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/about.html28
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/build.properties12
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/documentation.pdoc4
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/plugin.properties3
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/plugin.xml138
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableCustomization.uiCustom33
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableFacet.facetSet20
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableFacetCustomization.uiCustom31
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableInstanceCustomization.uiCustom31
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableQuery.querySet40
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/Activator.java121
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/AbstractPapyrusTableModelExplorerHandler.java59
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/AbstractTableModelExplorerHandler.java66
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DeletePapyrusTableHandler.java72
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DeleteTableHandler.java75
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DuplicatePapyrusTableHandler.java82
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DuplicateTableHandler.java84
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/RenamePapyrusTableHandler.java84
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/RenameTableHandler.java86
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/messages/Messages.java34
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/messages/messages.properties3
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/providers/PapyrusTablePropertyTester.java87
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/providers/TablePropertyTester.java87
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetContainedPapyrusTables.java83
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetContainedTables.java87
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetPapyrusTableIcon.java32
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetPapyrusTableName.java32
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetTableIcon.java38
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetTableName.java35
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/IsPapyrusTableContainer.java48
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/IsTableContainer.java48
36 files changed, 1759 insertions, 0 deletions
diff --git a/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/.classpath b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/sandbox/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/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/.project b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/.project
new file mode 100644
index 00000000000..db2442f94ec
--- /dev/null
+++ b/sandbox/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/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/.settings/org.eclipse.core.resources.prefs b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 00000000000..c82fec208fa
--- /dev/null
+++ b/sandbox/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/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/.settings/org.eclipse.jdt.core.prefs b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..eef3e01dddb
--- /dev/null
+++ b/sandbox/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/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/META-INF/MANIFEST.MF b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..acfac37c220
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/META-INF/MANIFEST.MF
@@ -0,0 +1,30 @@
+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="0.9.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="0.9.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",
+ com.google.guava;bundle-version="1.0.0",
+ org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.4.0",
+ org.eclipse.papyrus.infra.table.metamodel;bundle-version="0.9.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: 0.9.0.qualifier
+Bundle-Name: %pluginName
+Bundle-Localization: plugin
+Bundle-ManifestVersion: 2
+Bundle-Activator: org.eclipse.papyrus.infra.table.modelexplorer.Activator
+Bundle-SymbolicName: org.eclipse.papyrus.infra.table.modelexplorer;singleton:=true
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+
diff --git a/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/about.html b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/about.html
new file mode 100644
index 00000000000..82d49bf5f81
--- /dev/null
+++ b/sandbox/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/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/build.properties b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/build.properties
new file mode 100644
index 00000000000..8f5a4c96094
--- /dev/null
+++ b/sandbox/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/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/documentation.pdoc b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/documentation.pdoc
new file mode 100644
index 00000000000..e7a7257ea7e
--- /dev/null
+++ b/sandbox/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/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/plugin.properties b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/plugin.properties
new file mode 100644
index 00000000000..218c6567b7f
--- /dev/null
+++ b/sandbox/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/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/plugin.xml b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/plugin.xml
new file mode 100644
index 00000000000..8e1f221427d
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/plugin.xml
@@ -0,0 +1,138 @@
+<?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.DeleteTableHandler" commandId="org.eclipse.ui.edit.delete">
+ <activeWhen>
+ <or>
+ <with variable="selection">
+ <and>
+ <test forcePluginActivation="true" property="org.eclipse.papyrus.table.modelexplorer.tester.isTable" value="true">
+ </test>
+ </and>
+ </with>
+ </or>
+ </activeWhen>
+ </handler>
+ <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>
+ <handler
+ class="org.eclipse.papyrus.infra.table.modelexplorer.handlers.DeletePapyrusTableHandler"
+ commandId="org.eclipse.ui.edit.delete">
+ <activeWhen>
+ <or>
+ <with
+ variable="selection">
+ <and>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.papyrus.table.modelexplorer.tester2.isTable"
+ value="true">
+ </test>
+ </and>
+ </with>
+ </or>
+ </activeWhen>
+ </handler>
+ <handler
+ class="org.eclipse.papyrus.infra.table.modelexplorer.handlers.DuplicatePapyrusTableHandler"
+ commandId="org.eclipse.papyrus.views.modelexplorer.duplicate.command">
+ <activeWhen>
+ <and>
+ <with
+ variable="selection">
+ <and>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.papyrus.table.modelexplorer.tester2.isTable"
+ value="true">
+ </test>
+ </and>
+ </with>
+ </and>
+ </activeWhen>
+ </handler>
+ <handler
+ class="org.eclipse.papyrus.infra.table.modelexplorer.handlers.RenamePapyrusTableHandler"
+ commandId="org.eclipse.ui.edit.rename">
+ <activeWhen>
+ <or>
+ <with
+ variable="selection">
+ <and>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.papyrus.table.modelexplorer.tester2.isTable"
+ 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>
+ <propertyTester
+ class="org.eclipse.papyrus.infra.table.modelexplorer.providers.PapyrusTablePropertyTester"
+ id="org.eclipse.papyrus.table.modelexplorer.tester2"
+ namespace="org.eclipse.papyrus.table.modelexplorer.tester2"
+ 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>
+ <extension
+ point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
+ <browserCustomization
+ file="resources/PapyrusTableCustomization.uiCustom"
+ loadByDefault="true">
+ </browserCustomization>
+ </extension>
+</plugin>
diff --git a/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableCustomization.uiCustom b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableCustomization.uiCustom
new file mode 100644
index 00000000000..8aff7b461f9
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableCustomization.uiCustom
@@ -0,0 +1,33 @@
+<?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/PapyrusTable/0.9.0/papyrustable">
+ <types metaclassName="papyrustable.PapyrusTable">
+ <customizedFeatures customizedFeature="label">
+ <defaultValue xsi:type="uicustom:DerivedFeatureValue">
+ <valueCalculator xsi:type="query:JavaModelQuery" href="emffacet:/query/PapyrusTableQuery#GetPapyrusTableName"/>
+ </defaultValue>
+ </customizedFeatures>
+ <customizedFeatures customizedFeature="icon">
+ <defaultValue xsi:type="uicustom:DerivedFeatureValue">
+ <valueCalculator xsi:type="query:JavaModelQuery" href="emffacet:/query/PapyrusTableQuery#GetPapyrusTableIcon"/>
+ </defaultValue>
+ </customizedFeatures>
+ <customizedFeatures customizedFeature="hideMetaclassName">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="true"/>
+ </customizedFeatures>
+ <references referenceName="table">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="queries">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+</uicustom:MetamodelView>
diff --git a/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableFacet.facetSet b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableFacet.facetSet
new file mode 100644
index 00000000000..ed6c48cb863
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableFacet.facetSet
@@ -0,0 +1,20 @@
+<?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>
+ <eClassifiers xsi:type="facet:Facet" name="FacetPapyrusTableContainer" 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/PapyrusTable/0.9.0/papyrustable#//PapyrusTable"/>
+ <valueQuery xsi:type="query:JavaModelQuery" href="emffacet:/query/PapyrusTableQuery#GetContainedPapyrusTables"/>
+ </eStructuralFeatures>
+ <conditionQuery xsi:type="query:JavaModelQuery" href="emffacet:/query/PapyrusTableQuery#IsPapyrusTableContainer"/>
+ </eClassifiers>
+ <extendedPackage href="http://www.eclipse.org/uml2/4.0.0/UML#/"/>
+</facet:FacetSet>
diff --git a/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableFacetCustomization.uiCustom b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableFacetCustomization.uiCustom
new file mode 100644
index 00000000000..9547b428a38
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableFacetCustomization.uiCustom
@@ -0,0 +1,31 @@
+<?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>
+ <types metaclassName="PapyrusTableFacet.FacetPapyrusTableContainer">
+ <references referenceName="tables">
+ <customizedFeatures>
+ <valueCases>
+ <value xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ <condition xsi:type="query:JavaModelQuery" href="emffacet:/query/PapyrusTableQuery#IsPapyrusTableContainer"/>
+ </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/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableInstanceCustomization.uiCustom b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableInstanceCustomization.uiCustom
new file mode 100644
index 00000000000..6f012ca143a
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableInstanceCustomization.uiCustom
@@ -0,0 +1,31 @@
+<?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>
+ <customizedFeatures customizedFeature="struckthrough">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="true"/>
+ </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/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableQuery.querySet b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableQuery.querySet
new file mode 100644
index 00000000000..d5a9e5db1d0
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/resources/PapyrusTableQuery.querySet
@@ -0,0 +1,40 @@
+<?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/Papyrus/PapyrusTable/0.9.0/papyrustable#/"/>
+ <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>
+ <queries xsi:type="query:JavaModelQuery" name="IsPapyrusTableContainer" description="Returns true if the element contains a Table" implementationClassName="org.eclipse.papyrus.infra.table.modelexplorer.queries.IsPapyrusTableContainer">
+ <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="GetContainedPapyrusTables" description="Get the collection of all contained tables" upperBound="-1" implementationClassName="org.eclipse.papyrus.infra.table.modelexplorer.queries.GetContainedPapyrusTables">
+ <returnType xsi:type="ecore:EClass" href="http://www.eclipse.org/Papyrus/PapyrusTable/0.9.0/papyrustable#//PapyrusTable"/>
+ <scope href="http://www.eclipse.org/uml2/4.0.0/UML#//Element"/>
+ </queries>
+ <queries xsi:type="query:JavaModelQuery" name="GetPapyrusTableIcon" description="Return the path to the icon of the corresponding table" implementationClassName="org.eclipse.papyrus.infra.table.modelexplorer.queries.GetPapyrusTableIcon">
+ <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//String"/>
+ <scope href="http://www.eclipse.org/Papyrus/PapyrusTable/0.9.0/papyrustable#//PapyrusTable"/>
+ </queries>
+ <queries xsi:type="query:JavaModelQuery" name="GetPapyrusTableName" description="Return the name for the table" implementationClassName="org.eclipse.papyrus.infra.table.modelexplorer.queries.GetPapyrusTableName">
+ <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//String"/>
+ <scope href="http://www.eclipse.org/Papyrus/PapyrusTable/0.9.0/papyrustable#//PapyrusTable"/>
+ </queries>
+</query:ModelQuerySet>
diff --git a/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/Activator.java b/sandbox/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/sandbox/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/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/AbstractPapyrusTableModelExplorerHandler.java b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/AbstractPapyrusTableModelExplorerHandler.java
new file mode 100644
index 00000000000..78cc7b4b285
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/AbstractPapyrusTableModelExplorerHandler.java
@@ -0,0 +1,59 @@
+/*****************************************************************************
+ * 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.metamodel.papyrustable.PapyrusTable;
+import org.eclipse.papyrus.views.modelexplorer.handler.AbstractCommandHandler;
+import org.eclipse.ui.PlatformUI;
+
+public abstract class AbstractPapyrusTableModelExplorerHandler extends AbstractCommandHandler {
+
+ /**
+ * Returns the list of selected tables
+ *
+ * @return the list of selected tables
+ */
+ protected List<PapyrusTable> getSelectedTables() {
+ List<PapyrusTable> tables = new ArrayList<PapyrusTable>();
+ 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 PapyrusTable) {
+ tables.add((PapyrusTable)table);
+ }
+ }
+ }
+ }
+ return tables;
+ }
+
+}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/AbstractTableModelExplorerHandler.java b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/AbstractTableModelExplorerHandler.java
new file mode 100644
index 00000000000..60684acc9ac
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/AbstractTableModelExplorerHandler.java
@@ -0,0 +1,66 @@
+/*****************************************************************************
+ * 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;
+
+/**
+ * @deprecated Papyrus changes its table metamodel. This class is used to managed the old table metamodel.
+ * for details see : 371616: [Table Editor] Tabular Editor should be rewritten to use the new EMF-Facet Metamodels
+ *
+ */
+@Deprecated
+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/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DeletePapyrusTableHandler.java b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DeletePapyrusTableHandler.java
new file mode 100644
index 00000000000..b066f3a0963
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DeletePapyrusTableHandler.java
@@ -0,0 +1,72 @@
+/*****************************************************************************
+ * 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.IPageMngr;
+import org.eclipse.papyrus.infra.table.metamodel.papyrustable.PapyrusTable;
+
+/**
+ * Handler for the delete Table action
+ *
+ *
+ *
+ */
+public class DeletePapyrusTableHandler extends AbstractPapyrusTableModelExplorerHandler {
+
+
+ /**
+ *
+ * @see org.eclipse.papyrus.views.modelexplorer.handler.AbstractCommandHandler#getCommand()
+ *
+ * @return
+ */
+ @Override
+ protected Command getCommand() {
+ TransactionalEditingDomain editingDomain = getEditingDomain();
+ final IPageMngr pageMngr = getPageManager();
+
+ List<PapyrusTable> tables = getSelectedTables();
+
+ if(editingDomain != null && pageMngr != null && !tables.isEmpty()) {
+ CompoundCommand command = new CompoundCommand();
+
+ for(final PapyrusTable table : tables) {
+ Command sashRemoveComd = new RecordingCommand(editingDomain) {
+
+ @Override
+ protected void doExecute() {
+ if(pageMngr.isOpen(table)) {
+ pageMngr.closePage(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, false))));
+ }
+ return command.isEmpty() ? UnexecutableCommand.INSTANCE : command;
+ }
+ return UnexecutableCommand.INSTANCE;
+ }
+}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DeleteTableHandler.java b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DeleteTableHandler.java
new file mode 100644
index 00000000000..a644200de5a
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DeleteTableHandler.java
@@ -0,0 +1,75 @@
+/*****************************************************************************
+ * 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.IPageMngr;
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance;
+
+
+/**
+ * Handler for the delete Table action
+ *
+ * @deprecated Papyrus changes its table metamodel. This class is used to managed the old table metamodel.
+ * for details see : 371616: [Table Editor] Tabular Editor should be rewritten to use the new EMF-Facet Metamodels
+ *
+ */
+@Deprecated
+public class DeleteTableHandler extends AbstractTableModelExplorerHandler {
+
+
+ /**
+ *
+ * @see org.eclipse.papyrus.views.modelexplorer.handler.AbstractCommandHandler#getCommand()
+ *
+ * @return
+ */
+ @Override
+ protected Command getCommand() {
+ TransactionalEditingDomain editingDomain = getEditingDomain();
+ final IPageMngr 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() {
+ if(pageMngr.isOpen(table)) {
+ pageMngr.closePage(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, false))));
+ }
+ return command.isEmpty() ? UnexecutableCommand.INSTANCE : command;
+ }
+ return UnexecutableCommand.INSTANCE;
+ }
+}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DuplicatePapyrusTableHandler.java b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DuplicatePapyrusTableHandler.java
new file mode 100644
index 00000000000..080c2892e89
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DuplicatePapyrusTableHandler.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.IPageMngr;
+import org.eclipse.papyrus.infra.table.metamodel.papyrustable.PapyrusTable;
+import org.eclipse.papyrus.infra.table.modelexplorer.messages.Messages;
+
+/**
+ * This handler provides the duplicate action for the tables
+ *
+ *
+ *
+ */
+public class DuplicatePapyrusTableHandler extends AbstractPapyrusTableModelExplorerHandler {
+
+ /**
+ *
+ * @see org.eclipse.papyrus.views.modelexplorer.handler.AbstractCommandHandler#getCommand()
+ *
+ * @return
+ */
+ @Override
+ protected Command getCommand() {
+ TransactionalEditingDomain editingDomain = getEditingDomain();
+ final IPageMngr pageManager = getPageManager();
+ List<PapyrusTable> tables = getSelectedTables();
+
+ if(editingDomain != null && pageManager != null && !tables.isEmpty()) {
+ CompoundCommand command = new CompoundCommand();
+ for(PapyrusTable table : tables) {
+
+ // Clone the current table
+ final PapyrusTable 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) {
+
+ @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/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DuplicateTableHandler.java b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DuplicateTableHandler.java
new file mode 100644
index 00000000000..4ceb296af8a
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/DuplicateTableHandler.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.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.IPageMngr;
+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
+ * @deprecated Papyrus changes its table metamodel. This class is used to managed the old table metamodel.
+ * for details see : 371616: [Table Editor] Tabular Editor should be rewritten to use the new EMF-Facet Metamodels
+ *
+ *
+ */
+@Deprecated
+public class DuplicateTableHandler extends AbstractTableModelExplorerHandler {
+
+ /**
+ *
+ * @see org.eclipse.papyrus.views.modelexplorer.handler.AbstractCommandHandler#getCommand()
+ *
+ * @return
+ */
+ @Override
+ protected Command getCommand() {
+ TransactionalEditingDomain editingDomain = getEditingDomain();
+ final IPageMngr 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) {
+
+ @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/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/RenamePapyrusTableHandler.java b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/RenamePapyrusTableHandler.java
new file mode 100644
index 00000000000..e6a34876f79
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/RenamePapyrusTableHandler.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.metamodel.papyrustable.PapyrusTable;
+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 RenamePapyrusTableHandler extends AbstractPapyrusTableModelExplorerHandler {
+
+
+ /**
+ *
+ * @see org.eclipse.papyrus.views.modelexplorer.handler.AbstractCommandHandler#getCommand()
+ *
+ * @return
+ */
+ @Override
+ protected Command getCommand() {
+ TransactionalEditingDomain editingDomain = getEditingDomain();
+ List<PapyrusTable> tables = getSelectedTables();
+ if(editingDomain != null && tables.size() == 1) {
+
+ final PapyrusTable 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/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/RenameTableHandler.java b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/RenameTableHandler.java
new file mode 100644
index 00000000000..8c8756d4c69
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/handlers/RenameTableHandler.java
@@ -0,0 +1,86 @@
+/*****************************************************************************
+ * 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
+ *
+ * @deprecated Papyrus changes its table metamodel. This class is used to managed the old table metamodel.
+ * for details see : 371616: [Table Editor] Tabular Editor should be rewritten to use the new EMF-Facet Metamodels
+ *
+ */
+@Deprecated
+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/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/messages/Messages.java b/sandbox/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/sandbox/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/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/messages/messages.properties b/sandbox/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/sandbox/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/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/providers/PapyrusTablePropertyTester.java b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/providers/PapyrusTablePropertyTester.java
new file mode 100644
index 00000000000..be635976ccd
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/providers/PapyrusTablePropertyTester.java
@@ -0,0 +1,87 @@
+/*****************************************************************************
+ * 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.emf.facet.widgets.table.metamodel.v0_2_0.table.Table;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance;
+import org.eclipse.papyrus.infra.table.metamodel.papyrustable.PapyrusTable;
+import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils;
+
+/**
+ * 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 PapyrusTablePropertyTester 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 Table}
+ *
+ * @param selection
+ * @return
+ * <code>true</code> if the selection is composed by {@link Table}
+ */
+ 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 = NavigatorUtils.getElement(next, EObject.class);
+ if(!(table instanceof PapyrusTable)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/providers/TablePropertyTester.java b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/providers/TablePropertyTester.java
new file mode 100644
index 00000000000..e4119f15e0d
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/providers/TablePropertyTester.java
@@ -0,0 +1,87 @@
+/*****************************************************************************
+ * 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.table.instance.papyrustableinstance.PapyrusTableInstance;
+import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils;
+
+/**
+ * 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.
+ *
+ * @deprecated Papyrus changes its table metamodel. This class is used to managed the old table metamodel.
+ * for details see : 371616: [Table Editor] Tabular Editor should be rewritten to use the new EMF-Facet Metamodels
+ * FIXME : i think this class is not yet used
+ */
+@Deprecated
+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 = NavigatorUtils.getElement(next, EObject.class);
+ if(!(table instanceof PapyrusTableInstance)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetContainedPapyrusTables.java b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetContainedPapyrusTables.java
new file mode 100644
index 00000000000..7acd17935fd
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetContainedPapyrusTables.java
@@ -0,0 +1,83 @@
+/*****************************************************************************
+ * 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.Collection;
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EStructuralFeature.Setting;
+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.emf.facet.widgets.nattable.instance.tableinstance.TableInstance;
+import org.eclipse.emf.facet.widgets.nattable.instance.tableinstance.TableinstancePackage;
+import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.Table;
+import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.TablePackage;
+import org.eclipse.papyrus.infra.core.utils.PapyrusEcoreUtils;
+import org.eclipse.papyrus.infra.table.metamodel.papyrustable.PapyrusTable;
+import org.eclipse.papyrus.infra.table.metamodel.papyrustable.PapyrustablePackage;
+import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQuery;
+
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Sets;
+
+/** 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 GetContainedPapyrusTables extends AbstractEditorContainerQuery implements IJavaModelQuery<EObject, Collection<PapyrusTable>> {
+
+ /**
+ * {@inheritDoc}
+ */
+ public Collection<PapyrusTable> evaluate(final EObject context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
+ Predicate<EStructuralFeature.Setting> p = new Predicate<EStructuralFeature.Setting>() {
+
+ public boolean apply(EStructuralFeature.Setting setting) {
+ return setting.getEObject() instanceof Table && setting.getEStructuralFeature() == TablePackage.Literals.TABLE__CONTEXT;
+ }
+ };
+ Function<EStructuralFeature.Setting, PapyrusTable> f = new Function<EStructuralFeature.Setting, PapyrusTable>() {
+
+ public PapyrusTable apply(EStructuralFeature.Setting setting) {
+ Collection<Setting> references = PapyrusEcoreUtils.getUsages(setting.getEObject());
+ Predicate<Setting> p2 = new Predicate<EStructuralFeature.Setting>() {
+
+ public boolean apply(Setting setting) {
+ return setting.getEObject() instanceof PapyrusTable && PapyrustablePackage.Literals.PAPYRUS_TABLE__TABLE == setting.getEStructuralFeature();
+ }
+ };
+ Iterator<Setting> iterator = Iterables.filter(references, p2).iterator();
+ if(iterator.hasNext()) {
+ return (PapyrusTable)iterator.next().getEObject();
+ }
+ return null;
+ }
+
+ };
+
+ Iterable<PapyrusTable> transform = Iterables.transform(Iterables.filter(PapyrusEcoreUtils.getUsages(context), p), f);
+ transform = Iterables.filter(transform, new Predicate<PapyrusTable>() {
+
+ public boolean apply(PapyrusTable table) {
+ return table != null;
+ }
+ });
+ return Sets.newHashSet(transform);
+ }
+
+}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetContainedTables.java b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetContainedTables.java
new file mode 100644
index 00000000000..b9f5d7ed764
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetContainedTables.java
@@ -0,0 +1,87 @@
+/*****************************************************************************
+ * 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.Collection;
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EStructuralFeature.Setting;
+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.emf.facet.widgets.nattable.instance.tableinstance.TableInstance;
+import org.eclipse.emf.facet.widgets.nattable.instance.tableinstance.TableinstancePackage;
+import org.eclipse.papyrus.infra.core.utils.PapyrusEcoreUtils;
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrusTableInstance;
+import org.eclipse.papyrus.infra.table.instance.papyrustableinstance.PapyrustableinstancePackage;
+import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQuery;
+
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Sets;
+
+/**
+ * Get the collection of all contained tables
+ *
+ * @deprecated Papyrus changes its table metamodel. This class is used to managed the old table metamodel.
+ * for details see : 371616: [Table Editor] Tabular Editor should be rewritten to use the new EMF-Facet Metamodels
+ * */
+@Deprecated
+//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 {
+ Predicate<EStructuralFeature.Setting> p = new Predicate<EStructuralFeature.Setting>() {
+
+ public boolean apply(EStructuralFeature.Setting setting) {
+ return setting.getEObject() instanceof TableInstance && setting.getEStructuralFeature() == TableinstancePackage.Literals.TABLE_INSTANCE__CONTEXT;
+ }
+ };
+ Function<EStructuralFeature.Setting, PapyrusTableInstance> f = new Function<EStructuralFeature.Setting, PapyrusTableInstance>() {
+
+ public PapyrusTableInstance apply(EStructuralFeature.Setting setting) {
+ Collection<Setting> references = PapyrusEcoreUtils.getUsages(setting.getEObject());
+ Predicate<Setting> p2 = new Predicate<EStructuralFeature.Setting>() {
+
+ public boolean apply(Setting setting) {
+ return setting.getEObject() instanceof PapyrusTableInstance && PapyrustableinstancePackage.Literals.PAPYRUS_TABLE_INSTANCE__TABLE == setting.getEStructuralFeature();
+ }
+ };
+ Iterator<Setting> iterator = Iterables.filter(references, p2).iterator();
+ if(iterator.hasNext()) {
+ return (PapyrusTableInstance)iterator.next().getEObject();
+ }
+ return null;
+ }
+
+ };
+
+ Iterable<PapyrusTableInstance> transform = Iterables.transform(Iterables.filter(PapyrusEcoreUtils.getUsages(context), p), f);
+ transform = Iterables.filter(transform, new Predicate<PapyrusTableInstance>() {
+
+ public boolean apply(PapyrusTableInstance table) {
+ return table != null;
+ }
+ });
+ return Sets.newHashSet(transform);
+ }
+
+}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetPapyrusTableIcon.java b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetPapyrusTableIcon.java
new file mode 100644
index 00000000000..acace028157
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetPapyrusTableIcon.java
@@ -0,0 +1,32 @@
+/*****************************************************************************
+ * 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.core.editorsfactory.IPageIconsRegistryExtended;
+import org.eclipse.papyrus.infra.table.metamodel.papyrustable.PapyrusTable;
+import org.eclipse.papyrus.views.modelexplorer.queries.AbstractGetEditorIconQuery;
+
+/** Return the path to the icon of the corresponding table */
+public class GetPapyrusTableIcon extends AbstractGetEditorIconQuery implements IJavaModelQuery<PapyrusTable, String> {
+
+ /**
+ * {@inheritDoc}
+ */
+ public String evaluate(final PapyrusTable context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
+ return "/" + ((IPageIconsRegistryExtended)getEditorRegistry()).getEditorURLIcon(context); //$NON-NLS-1$
+ }
+}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetPapyrusTableName.java b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetPapyrusTableName.java
new file mode 100644
index 00000000000..e4c92a9ea0d
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetPapyrusTableName.java
@@ -0,0 +1,32 @@
+/*****************************************************************************
+ * 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.metamodel.papyrustable.PapyrusTable;
+
+
+/** Return the name for the table */
+public class GetPapyrusTableName implements IJavaModelQuery<PapyrusTable, String> {
+
+ /**
+ * {@inheritDoc}
+ */
+ public String evaluate(final PapyrusTable context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
+ return context.getName();
+ }
+}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetTableIcon.java b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetTableIcon.java
new file mode 100644
index 00000000000..93778825bd8
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetTableIcon.java
@@ -0,0 +1,38 @@
+/*****************************************************************************
+ * 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.core.editorsfactory.IPageIconsRegistryExtended;
+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
+ *
+ * @deprecated Papyrus changes its table metamodel. This class is used to managed the old table metamodel.
+ * for details see : 371616: [Table Editor] Tabular Editor should be rewritten to use the new EMF-Facet Metamodels
+ */
+@Deprecated
+public class GetTableIcon extends AbstractGetEditorIconQuery implements IJavaModelQuery<PapyrusTableInstance, String> {
+
+ /**
+ * {@inheritDoc}
+ */
+ public String evaluate(final PapyrusTableInstance context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
+ return "/" + ((IPageIconsRegistryExtended)getEditorRegistry()).getEditorURLIcon(context); //$NON-NLS-1$
+ }
+}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetTableName.java b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetTableName.java
new file mode 100644
index 00000000000..1ce8bc03c2b
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/GetTableName.java
@@ -0,0 +1,35 @@
+/*****************************************************************************
+ * 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
+ * @deprecated Papyrus changes its table metamodel. This class is used to managed the old table metamodel.
+ * for details see : 371616: [Table Editor] Tabular Editor should be rewritten to use the new EMF-Facet Metamodels
+ */
+@Deprecated
+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/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/IsPapyrusTableContainer.java b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/IsPapyrusTableContainer.java
new file mode 100644
index 00000000000..3009ea20f15
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/IsPapyrusTableContainer.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * 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.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature.Setting;
+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.emf.facet.widgets.nattable.instance.tableinstance.TableInstance;
+import org.eclipse.emf.facet.widgets.nattable.instance.tableinstance.TableinstancePackage;
+import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.Table;
+import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.TablePackage;
+import org.eclipse.papyrus.infra.table.metamodel.papyrustable.PapyrusTable;
+import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils;
+import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQuery;
+
+import com.google.common.base.Predicate;
+
+/** 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 IsPapyrusTableContainer extends AbstractEditorContainerQuery implements IJavaModelQuery<EObject, Boolean> {
+
+ /**
+ * {@inheritDoc}
+ */
+ public Boolean evaluate(EObject context, ParameterValueList parameterValues) throws ModelQueryExecutionException {
+ Predicate<Setting> p = new Predicate<Setting>() {
+
+ public boolean apply(Setting arg0) {
+ return arg0.getEObject() instanceof Table && arg0.getEStructuralFeature() == TablePackage.Literals.TABLE__CONTEXT;
+ }
+ };
+ boolean answer = NavigatorUtils.find(context, p);
+ return NavigatorUtils.find(context, p);
+ }
+}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/IsTableContainer.java b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/IsTableContainer.java
new file mode 100644
index 00000000000..75a8ca58c20
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.modelexplorer/src/org/eclipse/papyrus/infra/table/modelexplorer/queries/IsTableContainer.java
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ * 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.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature.Setting;
+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.emf.facet.widgets.nattable.instance.tableinstance.TableInstance;
+import org.eclipse.emf.facet.widgets.nattable.instance.tableinstance.TableinstancePackage;
+import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils;
+import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQuery;
+
+import com.google.common.base.Predicate;
+
+/** Returns true if the element contains a Table
+ * @deprecated Papyrus changes its table metamodel. This class is used to managed the old table metamodel.
+ * for details see : 371616: [Table Editor] Tabular Editor should be rewritten to use the new EMF-Facet Metamodels
+ */
+@Deprecated
+//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(EObject context, ParameterValueList parameterValues) throws ModelQueryExecutionException {
+ Predicate<Setting> p = new Predicate<Setting>() {
+
+ public boolean apply(Setting arg0) {
+ return arg0.getEObject() instanceof TableInstance && arg0.getEStructuralFeature() == TableinstancePackage.Literals.TABLE_INSTANCE__CONTEXT;
+ }
+ };
+ return NavigatorUtils.find(context, p);
+ }
+}

Back to the top