Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2013-02-04 12:29:11 +0000
committervlorenzo2013-02-04 12:29:11 +0000
commit4353e429f56734d7c81f81a525b7db04dec79967 (patch)
treed5fc9f687e20f103357e05be8dba70f8676f1b75
parent1446987d7d09f6f19853421f6a247821257192ec (diff)
downloadorg.eclipse.papyrus-4353e429f56734d7c81f81a525b7db04dec79967.tar.gz
org.eclipse.papyrus-4353e429f56734d7c81f81a525b7db04dec79967.tar.xz
org.eclipse.papyrus-4353e429f56734d7c81f81a525b7db04dec79967.zip
399839: [Table 2][ModelExplorer][Enhancement] The ModelExplorer must support the new Papyrus Table
https://bugs.eclipse.org/bugs/show_bug.cgi?id=399839
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/.classpath7
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/.project34
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/META-INF/MANIFEST.MF34
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/OSGI-INF/l10n/bundle.properties3
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/about.html28
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/build.properties10
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.pdoc4
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.xml52
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTables.uiCustom32
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.facetSet12
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.querySet17
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.uiCustom17
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/Activator.java43
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/handlers/AbstractTableCommandHandler.java59
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/handlers/DeleteTableHandler.java71
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/handlers/RenameTableHandler.java74
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/messages/Messages.java32
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/messages/messages.properties3
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/providers/TablePropertyTester.java106
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetContainedTables.java47
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetTableIcon.java26
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/IsTableContainer.java39
22 files changed, 750 insertions, 0 deletions
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/.classpath b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/.classpath
new file mode 100644
index 00000000000..45f024e850e
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/.project b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/.project
new file mode 100644
index 00000000000..3dda2906d00
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.nattable.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>
+ <buildCommand>
+ <name>org.eclipse.emf.facet.common.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.emf.facet.common.ProjectNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/META-INF/MANIFEST.MF b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..ffbb0d978da
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/META-INF/MANIFEST.MF
@@ -0,0 +1,34 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.papyrus.infra.nattable.modelexplorer;singleton:=true
+Bundle-Version: 0.10.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.infra.nattable.modelexplorer.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ com.google.guava,
+ org.eclipse.emf.facet.util.core,
+ org.eclipse.papyrus.views.modelexplorer;bundle-version="0.10.0",
+ org.eclipse.emf.facet.infra.query.core,
+ org.eclipse.gmf.runtime.notation,
+ com.google.guava,
+ org.eclipse.papyrus.infra.core,
+ org.eclipse.papyrus.infra.nattable.model,
+ org.eclipse.emf.transaction,
+ org.eclipse.gmf.runtime.common.core,
+ org.eclipse.gmf.runtime.emf.commands.core,
+ org.eclipse.papyrus.infra.widgets,
+ org.eclipse.papyrus.uml.diagram.common,
+ org.eclipse.swt,
+ org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="0.10.0",
+ org.eclipse.gmf.runtime.emf.type.core,
+ org.eclipse.core.expressions
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Bundle-ClassPath: .,bin
+Bundle-Vendor: %Bundle-Vendor
+Export-Package: org.eclipse.papyrus.infra.nattable.modelexplorer,
+ org.eclipse.papyrus.infra.nattable.modelexplorer.handlers,
+ org.eclipse.papyrus.infra.nattable.modelexplorer.messages,
+ org.eclipse.papyrus.infra.nattable.modelexplorer.providers,
+ org.eclipse.papyrus.infra.nattable.modelexplorer.queries
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/OSGI-INF/l10n/bundle.properties b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000000..6d67e6f3dba
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.papyrus.infra.nattable.modelexplorer
+Bundle-Vendor = Eclipse Modeling Project
+Bundle-Name = Modelexplorer for Tables (Incubation) \ No newline at end of file
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/about.html b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/about.html
new file mode 100644
index 00000000000..82d49bf5f81
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.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/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/build.properties b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/build.properties
new file mode 100644
index 00000000000..af08ccbab2b
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/build.properties
@@ -0,0 +1,10 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ about.html,\
+ resources/,\
+ plugin.pdoc,\
+ OSGI-INF/
+src.includes = about.html
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.pdoc b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.pdoc
new file mode 100644
index 00000000000..081f9a207f6
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.pdoc
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<doc:Documentation xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:doc="http://www.eclipse.org/papyrus/documentation/plugin/documentation" description="This plugin provides : &#xD;&#xA;&#x9;- the facets and the customization to display the Papyrus Nattables in the ModelExplorer">
+ <referent firstName="Juan" lastName="Cadavid" eMail="juan.cadavid@cea.fr" currentCompany="CEA LIST"/>
+</doc:Documentation>
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.xml b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.xml
new file mode 100644
index 00000000000..1c731a1e75c
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/plugin.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension point="org.eclipse.emf.facet.infra.query.registration">
+ <modelqueryset file="resources/PapyrusTablesFacet.querySet">
+ </modelqueryset>
+ </extension>
+ <extension point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
+ <browserCustomization file="resources/PapyrusTables.uiCustom" loadByDefault="true"/>
+ </extension>
+ <extension point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
+ <browserCustomization file="resources/PapyrusTablesFacet.uiCustom" loadByDefault="true"/>
+ </extension>
+ <extension point="org.eclipse.emf.facet.infra.facet.registration">
+ <facetset file="resources/PapyrusTablesFacet.facetSet">
+ </facetset>
+ </extension>
+ <extension point="org.eclipse.ui.handlers">
+ <handler class="org.eclipse.papyrus.infra.nattable.modelexplorer.handlers.RenameTableHandler" commandId="org.eclipse.ui.edit.rename">
+ <activeWhen>
+ <with variable="selection">
+ <and>
+ <count value="1">
+ </count>
+ <test forcePluginActivation="true" property="org.eclipse.papyrus.infra.nattable.modelexplorer.tablepropertytester.isTable" value="true">
+ </test>
+ </and>
+ </with>
+ </activeWhen>
+ </handler>
+ <handler class="org.eclipse.papyrus.infra.nattable.modelexplorer.handlers.DeleteTableHandler" commandId="org.eclipse.ui.edit.delete">
+ <activeWhen>
+
+ <with variable="selection">
+ <test forcePluginActivation="true" property="org.eclipse.papyrus.infra.nattable.modelexplorer.tablepropertytester.isTable" value="true">
+ </test>
+ </with>
+
+ </activeWhen>
+ </handler>
+ </extension>
+ <extension
+ point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.eclipse.papyrus.infra.nattable.modelexplorer.providers.TablePropertyTester"
+ id="org.eclipse.papyrus.infra.nattable.modelexplorer.tablepropertytester"
+ namespace="org.eclipse.papyrus.infra.nattable.modelexplorer.tablepropertytester"
+ properties="isTable"
+ type="org.eclipse.jface.viewers.IStructuredSelection">
+ </propertyTester>
+ </extension>
+</plugin>
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTables.uiCustom b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTables.uiCustom
new file mode 100644
index 00000000000..1b84e55f80d
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTables.uiCustom
@@ -0,0 +1,32 @@
+<?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:uicustom="http://www.eclipse.org/EmfFacet/infra/browser/custom/0.8"
+ metamodelURI="http://www.eclipse.org/papyrus/nattable/model">
+ <types metaclassName="nattable.Table">
+ <references referenceName="context">
+ <customizedFeatures customizedFeature="visible">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue"
+ value="false" />
+ </customizedFeatures>
+ </references>
+ <references referenceName="editorConfiguration">
+ <customizedFeatures customizedFeature="visible">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue"
+ value="false" />
+ </customizedFeatures>
+ </references>
+ <references referenceName="verticalContentProvider">
+ <customizedFeatures customizedFeature="visible">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue"
+ value="false" />
+ </customizedFeatures>
+ </references>
+ <references referenceName="horizontalContentProvider">
+ <customizedFeatures customizedFeature="visible">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue"
+ value="false" />
+ </customizedFeatures>
+ </references>
+ </types>
+</uicustom:MetamodelView>
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.facetSet b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.facetSet
new file mode 100644
index 00000000000..bbca3816dbc
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.facetSet
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="ASCII"?>
+<facet:FacetSet xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:facet="http://www.eclipse.org/EmfFacet/infra/facet/0.8.incubation" xmlns:query="http://www.eclipse.org/EmfFacet/infra/query/0.8.incubation" name="PapyrusTablesFacet" nsURI="http://org.eclipse.org/papyrus/tables/modelExplorer/Facet" nsPrefix="PapyrusTablesFacet">
+ <eClassifiers xsi:type="facet:Facet" name="TableContainer" abstract="true">
+ <eSuperTypes href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ <eStructuralFeatures xsi:type="facet:FacetReference" name="tables" upperBound="-1" volatile="true" unsettable="true">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/nattable/model#//Table"/>
+ <valueQuery xsi:type="query:JavaModelQuery" href="emffacet:/query/PapyrusTablesFacet#GetContainedTables"></valueQuery>
+ </eStructuralFeatures>
+ <conditionQuery xsi:type="query:JavaModelQuery" href="emffacet:/query/PapyrusTablesFacet#IsTableContainer"/>
+ </eClassifiers>
+ <extendedPackage href="http://www.eclipse.org/emf/2002/Ecore#/"/>
+</facet:FacetSet>
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.querySet b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.querySet
new file mode 100644
index 00000000000..048ac5a3931
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.querySet
@@ -0,0 +1,17 @@
+<?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="PapyrusTablesFacet" description="A set of queries to manage the tables in the ModelExplorer">
+ <associatedMetamodels href="http://www.eclipse.org/emf/2002/Ecore#/"/>
+ <associatedMetamodels href="http://www.eclipse.org/papyrus/nattable/model#/"/>
+ <queries xsi:type="query:JavaModelQuery" name="IsTableContainer" description="Return true if the element contains tables" implementationClassName="org.eclipse.papyrus.infra.nattable.modelexplorer.queries.IsTableContainer">
+ <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <scope href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ </queries>
+ <queries xsi:type="query:JavaModelQuery" name="GetContainedTables" description="Get the collection of all contained tables" upperBound="-1" implementationClassName="org.eclipse.papyrus.infra.nattable.modelexplorer.queries.GetContainedTables">
+ <returnType xsi:type="ecore:EClass" href="http://www.eclipse.org/papyrus/nattable/model#//Table"/>
+ <scope href="http://www.eclipse.org/emf/2002/Ecore#//EObject"></scope>
+ </queries>
+ <queries xsi:type="query:JavaModelQuery" name="GetTableIcon" description="Return the path to the icon of the corresponding table" implementationClassName="org.eclipse.papyrus.infra.nattable.modelexplorer.queries.GetTableIcon">
+ <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <scope href="http://www.eclipse.org/papyrus/nattable/model#//Table"/>
+ </queries>
+</query:ModelQuerySet>
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.uiCustom b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.uiCustom
new file mode 100644
index 00000000000..4149fcb9fe5
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/resources/PapyrusTablesFacet.uiCustom
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="ASCII"?>
+<uicustom:MetamodelView xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:query="http://www.eclipse.org/EmfFacet/infra/query/0.8.incubation" xmlns:uicustom="http://www.eclipse.org/EmfFacet/infra/browser/custom/0.8" metamodelURI="http://org.eclipse.org/papyrus/tables/modelExplorer/Facet">
+ <types metaclassName="PapyrusTablesFacet.TableContainer">
+ <references referenceName="tables">
+ <customizedFeatures>
+ <valueCases>
+ <value xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ <condition xsi:type="query:JavaModelQuery" href="emffacet:/query/PapyrusTablesFacet#IsTableContainer"/>
+ </valueCases>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ <customizedFeatures customizedFeature="collapseLink">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="true"/>
+ </customizedFeatures>
+ </references>
+ </types>
+</uicustom:MetamodelView>
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/Activator.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/Activator.java
new file mode 100644
index 00000000000..f2bd7e85f34
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/Activator.java
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Juan Cadavid (CEA LIST) juan.cadavid@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.modelexplorer;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+/** The activator class controls the plug-in life cycle */
+public class Activator extends Plugin {
+
+ // The shared instance
+ private static Activator plugin;
+
+ @Override
+ public void start(final BundleContext context) throws Exception {
+ super.start(context);
+ Activator.plugin = this;
+ }
+
+ @Override
+ public void stop(final BundleContext context) throws Exception {
+ Activator.plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return Activator.plugin;
+ }
+}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/handlers/AbstractTableCommandHandler.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/handlers/AbstractTableCommandHandler.java
new file mode 100644
index 00000000000..62f0c61e6ef
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/handlers/AbstractTableCommandHandler.java
@@ -0,0 +1,59 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Juan Cadavid (CEA LIST) juan.cadavid@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.modelexplorer.handlers;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils;
+import org.eclipse.papyrus.views.modelexplorer.handler.AbstractCommandHandler;
+import org.eclipse.ui.PlatformUI;
+
+public abstract class AbstractTableCommandHandler extends AbstractCommandHandler {
+
+ /**
+ * Returns the list of selected tables
+ *
+ * @return the list of selected tables
+ */
+ protected List<Table> getSelectedTables() {
+ List<Table> tables = new ArrayList<Table>();
+ 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();
+ /**
+ * Get the table object. This getElement is used in order to
+ * use IAdaptable mechanisme For example for Facet Elements
+ */
+ EObject table = NavigatorUtils.getElement(current, EObject.class);
+ if(table instanceof Table) {
+ tables.add((Table)table);
+ }
+ }
+ }
+
+ return tables;
+ }
+}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/handlers/DeleteTableHandler.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/handlers/DeleteTableHandler.java
new file mode 100644
index 00000000000..6c5cdae1de3
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/handlers/DeleteTableHandler.java
@@ -0,0 +1,71 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Juan Cadavid (CEA LIST) juan.cadavid@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.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.nattable.model.nattable.Table;
+
+/**
+ * Handler for the delete Table action
+ *
+ *
+ *
+ */
+public class DeleteTableHandler extends AbstractTableCommandHandler {
+
+
+ /**
+ *
+ * @see org.eclipse.papyrus.views.modelexplorer.handler.AbstractCommandHandler#getCommand()
+ *
+ * @return
+ */
+ @Override
+ protected Command getCommand() {
+ TransactionalEditingDomain editingDomain = getEditingDomain();
+ final IPageMngr pageMngr = getPageManager();
+
+ List<Table> tables = getSelectedTables();
+
+ if(editingDomain != null && pageMngr != null && !tables.isEmpty()) {
+ CompoundCommand command = new CompoundCommand();
+
+ for(final Table table : tables) {
+ Command sashRemoveComd = new RecordingCommand(editingDomain) {
+
+ @Override
+ protected void doExecute() {
+ if(pageMngr.isOpen(table)) {
+ pageMngr.closePage(table);
+ }
+ pageMngr.removePage(table);
+ }
+ };
+ // the destroy element command is a good way to destroy the cross reference
+ command.append(sashRemoveComd);
+ command.append(new GMFtoEMFCommandWrapper(new DestroyElementPapyrusCommand(new DestroyElementRequest(table, false))));
+ }
+ return command.isEmpty() ? UnexecutableCommand.INSTANCE : command;
+ }
+ return UnexecutableCommand.INSTANCE;
+ }
+}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/handlers/RenameTableHandler.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/handlers/RenameTableHandler.java
new file mode 100644
index 00000000000..a304751d89e
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/handlers/RenameTableHandler.java
@@ -0,0 +1,74 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Juan Cadavid (CEA LIST) juan.cadavid@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.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.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.infra.nattable.modelexplorer.messages.Messages;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * This handler provides the method to rename a Table
+ *
+ *
+ *
+ */
+public class RenameTableHandler extends AbstractTableCommandHandler {
+
+ /**
+ *
+ * @see org.eclipse.papyrus.views.modelexplorer.handler.AbstractCommandHandler#getCommand()
+ *
+ * @return
+ */
+ @Override
+ protected Command getCommand() {
+ TransactionalEditingDomain editingDomain = getEditingDomain();
+ List<Table> tables = getSelectedTables();
+ if(editingDomain != null && tables.size() == 1) {
+
+ final Table 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(IProgressMonitor monitor, IAdaptable info) {
+ InputDialog dialog = new InputDialog(Display.getCurrent().getActiveShell(), Messages.RenameTableHandler_RenameAnExistingTable, Messages.RenameTableHandler_NewName, 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 org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper(cmd);
+ }
+ }
+ return UnexecutableCommand.INSTANCE;
+ }
+}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/messages/Messages.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/messages/Messages.java
new file mode 100644
index 00000000000..29554ead78a
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/messages/Messages.java
@@ -0,0 +1,32 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Juan Cadavid (CEA LIST) juan.cadavid@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.modelexplorer.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+
+ private static final String BUNDLE_NAME = "org.eclipse.papyrus.infra.nattable.modelexplorer.messages.messages"; //$NON-NLS-1$
+
+ public static String DuplicateTableHandler_CopyOf;
+
+ public static String RenameTableHandler_NewName;
+
+ public static String RenameTableHandler_RenameAnExistingTable;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/messages/messages.properties b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/messages/messages.properties
new file mode 100644
index 00000000000..4cd13849a21
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/messages/messages.properties
@@ -0,0 +1,3 @@
+DuplicateTableHandler_CopyOf=Copy Of {0}
+RenameTableHandler_NewName=New name:
+RenameTableHandler_RenameAnExistingTable=Rename an existing table
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/providers/TablePropertyTester.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/providers/TablePropertyTester.java
new file mode 100644
index 00000000000..ae248acd1d5
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/providers/TablePropertyTester.java
@@ -0,0 +1,106 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Juan Cadavid (CEA LIST) juan.cadavid@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.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.nattable.model.nattable.Table;
+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 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()) {
+ // if(!(iter.next() instanceof Table)) {
+ // return false;
+ // }
+ // }
+ // return true;
+ // }
+ // 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}
+ *
+ * FIXME : this method should be in an upper plugin like oep.infra.gmfdiag.common
+ * FIXME : why use this one and not the other method isTable (see upper in this class)
+ */
+ private boolean isTable(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 object = NavigatorUtils.getElement(next, EObject.class);
+ if(!(object instanceof Table)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetContainedTables.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetContainedTables.java
new file mode 100644
index 00000000000..ee0b8b81bb3
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetContainedTables.java
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Juan Cadavid (CEA LIST) juan.cadavid@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.modelexplorer.queries;
+
+import java.util.Collection;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+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.nattable.model.nattable.Table;
+import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils;
+import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQuery;
+
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+
+/** Get the collection of all contained tables */
+public class GetContainedTables extends AbstractEditorContainerQuery implements IJavaModelQuery<EObject, Collection<org.eclipse.papyrus.infra.nattable.model.nattable.Table>> {
+
+ public Collection<org.eclipse.papyrus.infra.nattable.model.nattable.Table> evaluate(final EObject context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
+ Predicate<EStructuralFeature.Setting> p = new Predicate<EStructuralFeature.Setting>() {
+
+ public boolean apply(EStructuralFeature.Setting arg0) {
+ return arg0.getEObject() instanceof Table;
+ }
+ };
+ Function<EStructuralFeature.Setting, Table> f = new Function<EStructuralFeature.Setting, Table>() {
+
+ public Table apply(EStructuralFeature.Setting arg0) {
+ return (Table)arg0.getEObject();
+ }
+
+ };
+ return NavigatorUtils.findFilterAndApply(context, p, f);
+ }
+}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetTableIcon.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetTableIcon.java
new file mode 100644
index 00000000000..39db14e7927
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetTableIcon.java
@@ -0,0 +1,26 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Juan Cadavid (CEA LIST) juan.cadavid@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.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.nattable.model.nattable.Table;
+import org.eclipse.papyrus.views.modelexplorer.queries.AbstractGetEditorIconQuery;
+
+/** Return the path to the icon of the corresponding Table */
+public class GetTableIcon extends AbstractGetEditorIconQuery implements IJavaModelQuery<Table, String> {
+
+ public String evaluate(final Table context, final ParameterValueList parameterValues) throws ModelQueryExecutionException {
+ return "/" + getEditorRegistry(context).getEditorURLIcon(context); //$NON-NLS-1$
+ }
+}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/IsTableContainer.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/IsTableContainer.java
new file mode 100644
index 00000000000..868621252eb
--- /dev/null
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/IsTableContainer.java
@@ -0,0 +1,39 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Juan Cadavid (CEA LIST) juan.cadavid@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.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.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils;
+import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQuery;
+
+import com.google.common.base.Predicate;
+
+public class IsTableContainer extends AbstractEditorContainerQuery implements IJavaModelQuery<EObject, Boolean> {
+
+ /**
+ * Return true if the element is a Diagram Container
+ */
+ 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;
+ }
+ };
+ return NavigatorUtils.find(context, p);
+ }
+}

Back to the top