Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2012-08-24 16:20:49 +0000
committervlorenzo2012-08-24 16:20:49 +0000
commit36dfeaf97dfe648547f0e323c86dc6f7e1007a4f (patch)
tree22f0aeb69637a3298b08ce0e79e337852a123546 /sandbox
parentfb2538476f3ea1b43720f7adc4525dd4fb457022 (diff)
downloadorg.eclipse.papyrus-36dfeaf97dfe648547f0e323c86dc6f7e1007a4f.tar.gz
org.eclipse.papyrus-36dfeaf97dfe648547f0e323c86dc6f7e1007a4f.tar.xz
org.eclipse.papyrus-36dfeaf97dfe648547f0e323c86dc6f7e1007a4f.zip
Share the nested editor table
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/.classpath7
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/.project28
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/META-INF/MANIFEST.MF20
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/build.properties5
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/icons/TableOfEditors.gifbin0 -> 138 bytes
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/icons/TableOfEditors.pngbin0 -> 194 bytes
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/plugin.xml100
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/resources/nested_editor_table.papyrustableconfiguration9
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/resources/nestededitor.efacet22
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/Activator.java56
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/editor/NestedEditorTableEditor.java39
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/factory/NestedEditorTableEditorFactory.java40
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/handler/CreateNestedEditorTableEditorHandler.java46
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/handler/CreateNestedEditorTableEditorHandlerWithoutDialog.java34
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/AbstractNestedEditorQuery.java45
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetAllNestedEditorsQuery.java22
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetEditorContextQuery.java47
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetEditorNameQuery.java69
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetOpenEditorStatusQuery.java17
-rw-r--r--sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/IsAllowedInNestedEditortableQuery.java20
21 files changed, 633 insertions, 0 deletions
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/.classpath b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/.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.efacet.nestededitor/.project b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/.project
new file mode 100644
index 00000000000..51b61d58706
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.table.efacet.nestededitor</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.efacet.nestededitor/.settings/org.eclipse.jdt.core.prefs b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..44217f8c068
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.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.efacet.nestededitor/META-INF/MANIFEST.MF b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..c33edaeca9b
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/META-INF/MANIFEST.MF
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Table Of Nested Editors (Incubation)
+Bundle-SymbolicName: org.eclipse.papyrus.infra.table.efacet.nestededitor;singleton:=true
+Bundle-Version: 0.9.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.infra.table.efacet.nestededitor.Activator
+Bundle-Vendor: Eclipse Modeling Project
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.infra.table.efacet.common;bundle-version="0.9.0",
+ org.eclipse.papyrus.infra.core.log;bundle-version="0.9.0",
+ org.eclipse.papyrus.infra.table.efacet.metamodel;bundle-version="0.9.0",
+ org.eclipse.papyrus.infra.core,
+ org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel,
+ org.eclipse.emf.facet.util.emf.core,
+ org.eclipse.emf.facet.query.java.core,
+ org.eclipse.papyrus.infra.emf,
+ org.eclipse.papyrus.infra.tools;bundle-version="0.9.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/build.properties b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/build.properties
new file mode 100644
index 00000000000..6f20375d6c7
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/icons/TableOfEditors.gif b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/icons/TableOfEditors.gif
new file mode 100644
index 00000000000..20416f02be0
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/icons/TableOfEditors.gif
Binary files differ
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/icons/TableOfEditors.png b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/icons/TableOfEditors.png
new file mode 100644
index 00000000000..3eb64f31e36
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/icons/TableOfEditors.png
Binary files differ
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/plugin.xml b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/plugin.xml
new file mode 100644
index 00000000000..c2d84fc7a1b
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/plugin.xml
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?eclipse version="3.4"?>
+
+<plugin>
+ <extension point="org.eclipse.papyrus.infra.core.papyrusDiagram">
+ <editorDiagram factoryClass="org.eclipse.papyrus.infra.table.efacet.nestededitor.factory.NestedEditorTableEditorFactory" icon="icons/TableOfEditors.gif">
+ </editorDiagram>
+ </extension>
+ <extension point="org.eclipse.ui.commands">
+ <command categoryId="org.eclipse.papyrus.editor.category" description="Create a new Nested Editor Table Editor " id="org.eclipse.papyrus.infra.table.efacet.nestededitor.creation" name="Create a new Nested Editor Table Editor ">
+ </command>
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ description="Create a new Nested Editor Table Editor Without Dialog"
+ id="org.eclipse.papyrus.infra.table.efacet.nestededitor.creation.withoutdialog"
+ name="Create a new Nested Editor Table Editor Without Dialog">
+ </command>
+ </extension>
+ <extension point="org.eclipse.ui.handlers">
+ <handler class="org.eclipse.papyrus.infra.table.efacet.nestededitor.handler.CreateNestedEditorTableEditorHandler" commandId="org.eclipse.papyrus.infra.table.efacet.nestededitor.creation">
+ <activeWhen>
+ <or>
+ <with variable="activeEditorId">
+ <equals value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ </or>
+ </activeWhen>
+ </handler>
+ <handler
+ class="org.eclipse.papyrus.infra.table.efacet.nestededitor.handler.CreateNestedEditorTableEditorHandlerWithoutDialog"
+ commandId="org.eclipse.papyrus.infra.table.efacet.nestededitor.creation.withoutdialog">
+ <activeWhen>
+ <or>
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ </or>
+ </activeWhen>
+ </handler>
+ </extension>
+ <extension id="create.table.menus" name="Create Table Menus" point="org.eclipse.ui.menus">
+ <menuContribution allPopups="false" locationURI="popup:org.eclipse.papyrus.views.modelexplorer.popupmenu.table.efacet.creation">
+ <command commandId="org.eclipse.papyrus.infra.table.efacet.nestededitor.creation" icon="icons/TableOfEditors.gif" label="Nested Editor Table" mnemonic="&amp;G" style="push" tooltip="Create a new Nested Editor Table">
+ <visibleWhen>
+ <with variable="activeEditorId">
+ <equals value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution allPopups="false" locationURI="menu:org.eclipse.papyrus.ui.menu.efacet.table.creation">
+ <command
+ commandId="org.eclipse.papyrus.infra.table.efacet.nestededitor.creation"
+ icon="icons/TableOfEditors.gif"
+ label="Nested Editor Table"
+ mnemonic="&amp;G"
+ style="push"
+ tooltip="Create a new Nested Editor Table">
+ <visibleWhen>
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution allPopups="false" locationURI="toolbar:org.eclipse.papyrus.toolbar.table.efacet.creation">
+ <command
+ commandId="org.eclipse.papyrus.infra.table.efacet.nestededitor.creation"
+ icon="icons/TableOfEditors.gif"
+ label="Nested Editor Table"
+ mnemonic="&amp;G"
+ style="push"
+ tooltip="Create a new Nested Editor Table">
+ <visibleWhen>
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.emf.facet.util.emf.core.modeldeclaration">
+ <modeldeclaration
+ file="resources/nestededitor.efacet">
+ </modeldeclaration>
+ </extension>
+
+</plugin>
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/resources/nested_editor_table.papyrustableconfiguration b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/resources/nested_editor_table.papyrustableconfiguration
new file mode 100644
index 00000000000..209ec0719ff
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/resources/nested_editor_table.papyrustableconfiguration
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration:PapyrusTableConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:efacet="http://www.eclipse.org/emf/facet/efacet/0.2.incubation/efacet" xmlns:javaQuery="http://www.eclipse.org/emf/facet/query/java/0.2.incubation/javaquery" xmlns:org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration="http://www.eclipse.org/Papyrus/PapyrusTableConfiguration/0.9.0/papyrustableconfiguration" fillingMode="QUERIES">
+ <fillingQueries xsi:type="javaQuery:JavaQuery" href="nestededitor.efacet#//NestedEditor/allNestedEditor/@query"/>
+ <tableConfiguration>
+ <defaultColumns xsi:type="efacet:FacetAttribute" href="nestededitor.efacet#//NestedEditor/name"/>
+ <defaultColumns xsi:type="efacet:FacetReference" href="nestededitor.efacet#//NestedEditor/context"/>
+ <defaultColumns xsi:type="efacet:FacetAttribute" href="nestededitor.efacet#//NestedEditor/isOpened"/>
+ </tableConfiguration>
+</org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration:PapyrusTableConfiguration>
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/resources/nestededitor.efacet b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/resources/nestededitor.efacet
new file mode 100644
index 00000000000..7c76769d9a0
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/resources/nestededitor.efacet
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="ASCII"?>
+<efacet: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:efacet="http://www.eclipse.org/emf/facet/efacet/0.2.incubation/efacet" xmlns:javaQuery="http://www.eclipse.org/emf/facet/query/java/0.2.incubation/javaquery" name="nestededitor">
+ <eClassifiers xsi:type="efacet:Facet" name="NestedEditor">
+ <extendedMetaclass href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ <facetElements xsi:type="efacet:FacetAttribute" name="name" changeable="true" derived="true" documentation="">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <query xsi:type="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.infra.table.efacet.nestededitor.query.GetEditorNameQuery"/>
+ </facetElements>
+ <facetElements xsi:type="efacet:FacetReference" name="context" changeable="false" derived="true" documentation="">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ <query xsi:type="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.infra.table.efacet.nestededitor.query.GetEditorContextQuery"/>
+ </facetElements>
+ <facetElements xsi:type="efacet:FacetAttribute" name="isOpened" changeable="false" derived="true" documentation="">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <query xsi:type="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.infra.table.efacet.nestededitor.query.GetOpenEditorStatusQuery"/>
+ </facetElements>
+ <facetElements xsi:type="efacet:FacetReference" name="allNestedEditor" upperBound="-1" changeable="false" derived="true" documentation="">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ <query xsi:type="javaQuery:JavaQuery" implementationClassName="org.eclipse.papyrus.infra.table.efacet.nestededitor.query.GetAllNestedEditorsQuery"/>
+ </facetElements>
+ </eClassifiers>
+</efacet:FacetSet>
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/Activator.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/Activator.java
new file mode 100644
index 00000000000..afbc92c7b9a
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/Activator.java
@@ -0,0 +1,56 @@
+package org.eclipse.papyrus.infra.table.efacet.nestededitor;
+
+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.efacet.nestededitor"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ public static LogHelper log;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ log = new LogHelper(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/editor/NestedEditorTableEditor.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/editor/NestedEditorTableEditor.java
new file mode 100644
index 00000000000..1044e542f44
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/editor/NestedEditorTableEditor.java
@@ -0,0 +1,39 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.table.efacet.nestededitor.editor;
+
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.table.efacet.common.editor.AbstractSynchronizedTableEditor;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
+
+
+public class NestedEditorTableEditor extends AbstractSynchronizedTableEditor {
+
+ /** the type of the editor */
+ public static final String EDITOR_TYPE = "PapyrusNestedEditorTable"; //$NON-NLS-1$
+
+ /** the default name for this table */
+ public static final String DEFAULT_NAME = "NestedEditorTable"; //$NON-NLS-1$
+
+ /**
+ * @param servicesRegistry
+ * @param rawModel
+ *
+ */
+ public NestedEditorTableEditor(final ServicesRegistry servicesRegistry, final PapyrusTable rawModel) {
+ super(servicesRegistry, rawModel);
+ }
+
+
+}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/factory/NestedEditorTableEditorFactory.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/factory/NestedEditorTableEditorFactory.java
new file mode 100644
index 00000000000..98cee421dfa
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/factory/NestedEditorTableEditorFactory.java
@@ -0,0 +1,40 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+
+package org.eclipse.papyrus.infra.table.efacet.nestededitor.factory;
+
+import org.eclipse.papyrus.infra.table.efacet.common.factory.AbstractTableEditorFactory;
+import org.eclipse.papyrus.infra.table.efacet.nestededitor.editor.NestedEditorTableEditor;
+
+
+/**
+ *
+ *
+ */
+public class NestedEditorTableEditorFactory extends AbstractTableEditorFactory {
+
+
+ /**
+ * Constructor.
+ *
+ * @param diagramClass
+ * @param expectedType
+ */
+ public NestedEditorTableEditorFactory() {
+ super(NestedEditorTableEditor.class, NestedEditorTableEditor.EDITOR_TYPE);
+ }
+
+
+}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/handler/CreateNestedEditorTableEditorHandler.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/handler/CreateNestedEditorTableEditorHandler.java
new file mode 100644
index 00000000000..a69b9c6d916
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/handler/CreateNestedEditorTableEditorHandler.java
@@ -0,0 +1,46 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.table.efacet.nestededitor.handler;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.papyrus.infra.table.efacet.common.handlers.AbstractCreateTableEditorHandler;
+import org.eclipse.papyrus.infra.table.efacet.nestededitor.Activator;
+import org.eclipse.papyrus.infra.table.efacet.nestededitor.editor.NestedEditorTableEditor;
+
+public class CreateNestedEditorTableEditorHandler extends AbstractCreateTableEditorHandler {
+
+ /**
+ *
+ * Constructor.
+ *
+ */
+ public CreateNestedEditorTableEditorHandler() {
+ super(NestedEditorTableEditor.EDITOR_TYPE, NestedEditorTableEditor.DEFAULT_NAME);
+ }
+
+
+ /**
+ *
+ * @see org.eclipse.papyrus.infra.table.efacet.common.handlers.AbstractCreateTableEditorHandler#getPapyrusTableConfigurationURI()
+ *
+ * @return
+ */
+ @Override
+ protected URI getPapyrusTableConfigurationURI() {
+ final String symbolicName = Activator.getDefault().getBundle().getSymbolicName();
+ final URI uri = URI.createPlatformPluginURI(symbolicName + "/resources/nested_editor_table.papyrustableconfiguration", true); //$NON-NLS-1$
+ return uri;
+ }
+
+}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/handler/CreateNestedEditorTableEditorHandlerWithoutDialog.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/handler/CreateNestedEditorTableEditorHandlerWithoutDialog.java
new file mode 100644
index 00000000000..17074b19535
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/handler/CreateNestedEditorTableEditorHandlerWithoutDialog.java
@@ -0,0 +1,34 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.table.efacet.nestededitor.handler;
+
+
+
+public class CreateNestedEditorTableEditorHandlerWithoutDialog extends CreateNestedEditorTableEditorHandler {
+
+ /**
+ *
+ * Constructor.
+ *
+ */
+ public CreateNestedEditorTableEditorHandlerWithoutDialog() {
+ super();
+ }
+
+
+ @Override
+ protected boolean shouldOpenNameDialog() {
+ return false;
+ }
+}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/AbstractNestedEditorQuery.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/AbstractNestedEditorQuery.java
new file mode 100644
index 00000000000..2351ba3e2bb
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/AbstractNestedEditorQuery.java
@@ -0,0 +1,45 @@
+package org.eclipse.papyrus.infra.table.efacet.nestededitor.query;
+
+import java.util.Collections;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.facet.query.java.core.IJavaQuery2;
+import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageMngr;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
+import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForResource;
+import org.eclipse.papyrus.infra.table.efacet.nestededitor.Activator;
+
+
+public abstract class AbstractNestedEditorQuery<T2> implements IJavaQuery2<EObject, T2> {
+
+ protected ServicesRegistry getServiceRegistry(final EObject object) {
+ ServicesRegistry serviceRegistry = null;
+ final Resource res = object.eResource();
+ if(res != null) {
+ try {
+ serviceRegistry = ServiceUtilsForResource.getInstance().getServiceRegistry(res);
+ } catch (ServiceException e) {
+ Activator.log.error("Service Registry not found!", e);
+ }
+ }
+ return serviceRegistry;
+ }
+
+ protected IPageMngr getPageMngr(final EObject object) {
+ IPageMngr pageManager = null;
+ final ServicesRegistry serviceRegistry = getServiceRegistry(object);
+
+ if(serviceRegistry != null) {
+ try {
+ pageManager = ServiceUtils.getInstance().getIPageMngr(serviceRegistry);
+ } catch (ServiceException e) {
+ Activator.log.error("PageManager not found", e);
+ }
+ }
+ return pageManager;
+ }
+
+}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetAllNestedEditorsQuery.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetAllNestedEditorsQuery.java
new file mode 100644
index 00000000000..1077a7ddf5e
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetAllNestedEditorsQuery.java
@@ -0,0 +1,22 @@
+package org.eclipse.papyrus.infra.table.efacet.nestededitor.query;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.facet.efacet.core.IFacetManager;
+import org.eclipse.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.emf.facet.query.java.core.IParameterValueList2;
+import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageMngr;
+
+public class GetAllNestedEditorsQuery extends AbstractNestedEditorQuery<Object> {
+
+ public List<Object> evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
+ IPageMngr pageMngr = getPageMngr(source);
+ if(pageMngr != null) {
+ return pageMngr.allPages();
+ }
+ return Collections.emptyList();
+ }
+
+}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetEditorContextQuery.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetEditorContextQuery.java
new file mode 100644
index 00000000000..a24c6d60e19
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetEditorContextQuery.java
@@ -0,0 +1,47 @@
+package org.eclipse.papyrus.infra.table.efacet.nestededitor.query;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.facet.efacet.core.IFacetManager;
+import org.eclipse.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.emf.facet.query.java.core.IParameterValueList2;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
+
+
+public class GetEditorContextQuery extends AbstractNestedEditorQuery<EObject> {
+
+ private static List<String> possibleContextFieldName = null;
+
+ public EObject evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
+ EObject context = null;
+ if(source instanceof PapyrusTable) {
+ context = ((PapyrusTable)source).getTable().getContext();
+ } else {
+ if(possibleContextFieldName == null) {
+ initContextFieldName();
+ }
+ Iterator<String> iter = possibleContextFieldName.iterator();
+
+ while(iter.hasNext() && context == null) {
+ final String currentName = iter.next();
+ final EStructuralFeature feature = source.eClass().getEStructuralFeature(currentName);
+ if(feature != null) {
+ context = (EObject)source.eGet(feature);
+ }
+
+ }
+ }
+ return context;
+ }
+
+ private static final void initContextFieldName() {
+ possibleContextFieldName = new ArrayList<String>();
+ possibleContextFieldName.add("context");
+ possibleContextFieldName.add("element");
+ }
+
+}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetEditorNameQuery.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetEditorNameQuery.java
new file mode 100644
index 00000000000..e9d6d0a34a8
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetEditorNameQuery.java
@@ -0,0 +1,69 @@
+package org.eclipse.papyrus.infra.table.efacet.nestededitor.query;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.facet.efacet.core.IFacetManager;
+import org.eclipse.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.emf.facet.query.java.core.IParameterValueList2;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
+import org.eclipse.papyrus.infra.table.efacet.nestededitor.Activator;
+
+
+public class GetEditorNameQuery extends AbstractNestedEditorQuery<String> {
+
+ private static List<String> possibleNameFieldName = null;
+
+ public String evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
+
+
+
+ String editorName = null;
+ if(source instanceof PapyrusTable) {
+ editorName = ((PapyrusTable)source).getName();
+ } else {
+ if(possibleNameFieldName == null) {
+ initContextFieldName();
+ }
+ final Iterator<String> iter = possibleNameFieldName.iterator();
+ Field contextField = null;
+ while(iter.hasNext() && contextField == null) {
+ final String currentName = iter.next();
+ try {
+ contextField = source.getClass().getDeclaredField(currentName);
+ } catch (SecurityException e) {
+ Activator.log.error(e);
+ } catch (NoSuchFieldException e) {
+ Activator.log.error(e);
+ }
+ }
+ if(contextField != null) {
+ boolean oldAccessibilityValue = contextField.isAccessible();
+ contextField.setAccessible(true);
+ Object tmp = null;
+ try {
+ tmp = contextField.get(source);
+ } catch (IllegalArgumentException e) {
+ Activator.log.error(e);
+ } catch (IllegalAccessException e) {
+ Activator.log.error(e);
+ }
+ if(tmp instanceof String) {
+ editorName = (String)tmp;
+ }
+ contextField.setAccessible(oldAccessibilityValue);
+ }
+ }
+ return editorName;
+ }
+
+
+ private static final void initContextFieldName() {
+ possibleNameFieldName = new ArrayList<String>();
+ possibleNameFieldName.add("name");
+ }
+
+}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetOpenEditorStatusQuery.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetOpenEditorStatusQuery.java
new file mode 100644
index 00000000000..d577fe0c137
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/GetOpenEditorStatusQuery.java
@@ -0,0 +1,17 @@
+package org.eclipse.papyrus.infra.table.efacet.nestededitor.query;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.facet.efacet.core.IFacetManager;
+import org.eclipse.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.emf.facet.query.java.core.IParameterValueList2;
+import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageMngr;
+
+
+public class GetOpenEditorStatusQuery extends AbstractNestedEditorQuery<Boolean> {
+
+ public Boolean evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
+ IPageMngr pageMManager = getPageMngr(source);
+ return pageMManager.isOpen(source);
+ }
+
+}
diff --git a/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/IsAllowedInNestedEditortableQuery.java b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/IsAllowedInNestedEditortableQuery.java
new file mode 100644
index 00000000000..dd41950599a
--- /dev/null
+++ b/sandbox/org.eclipse.papyrus.infra.table.efacet.nestededitor/src/org/eclipse/papyrus/infra/table/efacet/nestededitor/query/IsAllowedInNestedEditortableQuery.java
@@ -0,0 +1,20 @@
+package org.eclipse.papyrus.infra.table.efacet.nestededitor.query;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.facet.efacet.core.IFacetManager;
+import org.eclipse.emf.facet.efacet.core.exception.DerivedTypedElementException;
+import org.eclipse.emf.facet.query.java.core.IParameterValueList2;
+import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageMngr;
+
+//TOD0 currently this class is not used, we should complete the tableconfiguration (can be presented in the table)
+public class IsAllowedInNestedEditortableQuery extends AbstractNestedEditorQuery<Boolean> {
+
+ public Boolean evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
+ final IPageMngr pageManager = getPageMngr(source);
+ if(pageManager != null) {
+ return pageManager.allPages().contains(source);
+ }
+ return false;
+ }
+
+}

Back to the top