diff options
author | vlorenzo | 2012-08-03 08:45:20 +0000 |
---|---|---|
committer | vlorenzo | 2012-08-03 08:45:20 +0000 |
commit | c7805d263f81911fec2cbbd80c8d6d82d29d6ac1 (patch) | |
tree | 0073565fd8c1f0f68e248eddb6cef56b2026e696 /incoming | |
parent | 35e67f10099fcbe4b4fec189b92765500360dc9f (diff) | |
download | org.eclipse.papyrus-c7805d263f81911fec2cbbd80c8d6d82d29d6ac1.tar.gz org.eclipse.papyrus-c7805d263f81911fec2cbbd80c8d6d82d29d6ac1.tar.xz org.eclipse.papyrus-c7805d263f81911fec2cbbd80c8d6d82d29d6ac1.zip |
Share the new projects for the new tables in Papyrus
Diffstat (limited to 'incoming')
135 files changed, 11980 insertions, 0 deletions
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/.classpath b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/.classpath new file mode 100644 index 00000000000..2d1a4302f04 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/.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/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/.project b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/.project new file mode 100644 index 00000000000..4ab84b621e1 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/.project @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.emf.efacet</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.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/.settings/org.eclipse.jdt.core.prefs b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..44217f8c068 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/.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/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/META-INF/MANIFEST.MF b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..5117a630035 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-SymbolicName: org.eclipse.papyrus.infra.emf.efacet;singleton:=true +Bundle-Version: 0.9.0.qualifier +Bundle-Activator: org.eclipse.papyrus.infra.emf.efacet.Activator +Bundle-Vendor: %Bundle-Vendor +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.emf.facet.util.emf.core, + org.eclipse.emf.facet.query.java.core, + org.eclipse.emf.ecore;bundle-version="2.8.0" +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Bundle-ActivationPolicy: lazy diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/OSGI-INF/l10n/bundle.properties b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/OSGI-INF/l10n/bundle.properties new file mode 100644 index 00000000000..d40af2f2bce --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/OSGI-INF/l10n/bundle.properties @@ -0,0 +1,3 @@ +#Properties file for org.eclipse.papyrus.infra.emf.efacet
+Bundle-Vendor = Eclipse Modeling Project
+Bundle-Name = Facets and Customization for EMF (Incubation)
\ No newline at end of file diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/about.html b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/about.html new file mode 100644 index 00000000000..82d49bf5f81 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/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 ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). 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, "Program" 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 ("Redistributor") 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/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/build.properties b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/build.properties new file mode 100644 index 00000000000..814b8d6bb15 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/build.properties @@ -0,0 +1,11 @@ +source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ build.properties,\
+ resources/,\
+ plugin.xml,\
+ about.html,\
+ plugin.pdoc,\
+ OSGI-INF/l10n/bundle.properties
+src.includes = about.html
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/plugin.pdoc b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/plugin.pdoc new file mode 100644 index 00000000000..92c84384166 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/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 EMF customization : 
	- a custom to hide the eAnnotation feature
	- a facet "self" to display the object itself">
+ <referent firstName="vincent" lastName="lorenzo" eMail="vincent.lorenzo@cea.fr" currentCompany="CEA-LIST"/>
+</doc:Documentation>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/plugin.xml b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/plugin.xml new file mode 100644 index 00000000000..935d9afb021 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/plugin.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.emf.facet.util.emf.core.modeldeclaration">
+ <modeldeclaration
+ file="resources/emf_hidden_features.custom">
+ </modeldeclaration>
+ <modeldeclaration
+ file="resources/papyrus_emf_facets.efacet">
+ </modeldeclaration>
+ </extension>
+
+</plugin>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/resources/emf_hidden_features.custom b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/resources/emf_hidden_features.custom new file mode 100644 index 00000000000..e99e520bc96 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/resources/emf_hidden_features.custom @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<custom:Customization xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:custom="http://www.eclipse.org/emf/facet/custom/0.2.incubation/custom" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:efacet="http://www.eclipse.org/emf/facet/efacet/0.2.incubation/efacet" xmlns:query="http://www.eclipse.org/emf/facet/efacet/0.2.incubation/efacet/query" name="emf_hidden_features">
+ <eClassifiers xsi:type="custom:EClassCustomization" conformanceTypedElement="//@eClassifiers.0/isConforming">
+ <extendedMetaclass href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
+ <facetElements xsi:type="efacet:FacetAttribute" name="isConforming" derived="true">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ <query xsi:type="query:IsOneOfQuery">
+ <expectedEObjects href="http://www.eclipse.org/emf/2002/Ecore#//EModelElement/eAnnotations"/>
+ </query>
+ </facetElements>
+ <facetOperations name="isVisible" lowerBound="1">
+ <eType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
+ <eParameters name="eStructuralFeature">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement"/>
+ </eParameters>
+ <query xsi:type="custom:ETypedElementSwitchQuery">
+ <cases>
+ <value xsi:type="query:FalseLiteralQuery"/>
+ </cases>
+ </query>
+ <override xsi:type="efacet:FacetOperation" href="platform:/plugin/org.eclipse.emf.facet.custom.ui/resources/customproperties.efacet#//CustomizedEObject/isVisible"/>
+ </facetOperations>
+ </eClassifiers>
+</custom:Customization>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/resources/papyrus_emf_facets.efacet b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/resources/papyrus_emf_facets.efacet new file mode 100644 index 00000000000..100b206701a --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/resources/papyrus_emf_facets.efacet @@ -0,0 +1,9 @@ +<?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" name="papyrus emf facetset">
+ <eClassifiers xsi:type="efacet:Facet" name="papyrus_emf_facets">
+ <extendedMetaclass href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ <facetElements xsi:type="efacet:FacetReference" name="self" changeable="false" derived="true" documentation="This facet provides the element itself to display it in a table.">
+ <eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ </facetElements>
+ </eClassifiers>
+</efacet:FacetSet>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/src/org/eclipse/papyrus/infra/emf/efacet/Activator.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/src/org/eclipse/papyrus/infra/emf/efacet/Activator.java new file mode 100644 index 00000000000..7360e3ae846 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/src/org/eclipse/papyrus/infra/emf/efacet/Activator.java @@ -0,0 +1,50 @@ +package org.eclipse.papyrus.infra.emf.efacet;
+
+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.emf.efacet"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = 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/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/src/org/eclipse/papyrus/infra/emf/efacet/queries/SelfQuery.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/src/org/eclipse/papyrus/infra/emf/efacet/queries/SelfQuery.java new file mode 100644 index 00000000000..449c804312a --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.emf.efacet/src/org/eclipse/papyrus/infra/emf/efacet/queries/SelfQuery.java @@ -0,0 +1,30 @@ +/*****************************************************************************
+ * 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) - Bug 372243 - Facet extending EObject to provide eClass(), eContainer(), etc.
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.emf.efacet.queries;
+
+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.IJavaQuery2;
+import org.eclipse.emf.facet.query.java.core.IParameterValueList2;
+
+public class SelfQuery implements IJavaQuery2<EObject, EObject> {
+
+ public EObject evaluate(final EObject source,
+ final IParameterValueList2 parameterValues,
+ final IFacetManager facetManager)
+ throws DerivedTypedElementException {
+ return source;
+ }
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/.classpath b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/.classpath new file mode 100644 index 00000000000..51a56a9b454 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/.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 excluding="org/eclipse/papyrus/infra/table/efacet/common/modelresource/EMFFacetTableModelResource.java" kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/.project b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/.project new file mode 100644 index 00000000000..1c89b79096c --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.table.efacet.common</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/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/.settings/org.eclipse.jdt.core.prefs b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..44217f8c068 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/.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/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/META-INF/MANIFEST.MF b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..9305fb9e9f7 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/META-INF/MANIFEST.MF @@ -0,0 +1,28 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Common Plugin for the efacet table editor (Incubation) +Bundle-SymbolicName: org.eclipse.papyrus.infra.table.efacet.common;singleton:=true +Bundle-Version: 0.9.0.qualifier +Bundle-Activator: org.eclipse.papyrus.infra.table.efacet.common.Activator +Bundle-Vendor: Eclipse Modeling Project +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.emf.edit, + org.eclipse.emf.transaction, + org.eclipse.papyrus.infra.core, + 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.emf.facet.widgets.table.ui, + org.eclipse.emf.workspace, + org.eclipse.core.databinding, + org.eclipse.emf.facet.widgets.nattable, + org.eclipse.papyrus.infra.widgets, + org.eclipse.uml2.uml, + org.eclipse.emf.facet.widgets.nattable.instance, + org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel;bundle-version="0.9.0", + org.eclipse.papyrus.infra.table.efacet.metamodel.edit;bundle-version="1.0.0" +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Bundle-ActivationPolicy: lazy +Export-Package: org.eclipse.papyrus.infra.table.efacet.common.editor, + org.eclipse.papyrus.infra.table.efacet.common.factory, + org.eclipse.papyrus.infra.table.efacet.common.handlers diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/build.properties b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/build.properties new file mode 100644 index 00000000000..6f20375d6c7 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/build.properties @@ -0,0 +1,5 @@ +source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/icons/table.gif b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/icons/table.gif Binary files differnew file mode 100644 index 00000000000..4c9048708b0 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/icons/table.gif diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/icons/table.png b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/icons/table.png Binary files differnew file mode 100644 index 00000000000..2a979527f4a --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/icons/table.png diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/plugin.xml b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/plugin.xml new file mode 100644 index 00000000000..a9ad19f2f90 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/plugin.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.papyrus.infra.core.model">
+ <model
+ classname="org.eclipse.papyrus.infra.table.efacet.common.modelresource.PapyrusTableModelResource"
+ description="Model Resource for Papyrus Table EFacet ">
+ </model>
+ </extension>
+<extension id="papyrus.table.menuspapyrus.table.menu" name="Papyrus Table Menus" point="org.eclipse.ui.menus">
+ <menuContribution allPopups="false" locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup?after=org.eclipse.papyrus.views.modelexplorer.popupmenu.creatediagram">
+ <menu icon="icons/table.gif" id="org.eclipse.papyrus.views.modelexplorer.popupmenu.table.efacet.creation" label="New EFacet Table" mnemonic="&T" tooltip="The table menu">
+ </menu>
+ </menuContribution>
+ <menuContribution allPopups="false" locationURI="menu:org.eclipse.papyrus.ui.menu?after=org.eclipse.papyrus.uml.diagram.ui.menu.diagrams">
+ <menu icon="icons/table.gif" id="org.eclipse.papyrus.ui.menu.efacet.table.creation" label="EFacet Tables" mnemonic="&T" tooltip="The table menu">
+ </menu>
+ </menuContribution>
+ <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?endof=org.eclipse.papyrus.uml.diagram.ui.toolbar">
+ <toolbar id="org.eclipse.papyrus.toolbar.table.efacet.creation" label="Papyrus EFacet Table Toolbar">
+ </toolbar>
+ </menuContribution>
+ </extension>
+
+</plugin>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/Activator.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/Activator.java new file mode 100644 index 00000000000..fd6dfd2f990 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/Activator.java @@ -0,0 +1,58 @@ +package org.eclipse.papyrus.infra.table.efacet.common;
+
+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.common"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ public static LogHelper log;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(final BundleContext context) throws Exception {
+ super.start(context);
+ this.log = new LogHelper(this);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(final BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/editor/AbstractTableEditor.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/editor/AbstractTableEditor.java new file mode 100644 index 00000000000..f25e2b1871a --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/editor/AbstractTableEditor.java @@ -0,0 +1,259 @@ +package org.eclipse.papyrus.infra.table.efacet.common.editor;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.transaction.TriggerListener;
+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.table.efacet.common.input.PapyrusTableEditorInput;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.PartInitException;
+
+public abstract class AbstractTableEditor extends NatTableEditor2 {
+
+ /** the service registry */
+ protected ServicesRegistry servicesRegistry;
+
+ /** the table instance */
+ protected PapyrusTable rawModel;
+
+ /** listener on the model for synchronized table */
+ private TriggerListener modelTriggerListener;
+
+ /** listener on the table for synchronized table : listen the properties "isSynchronized" and "fillingQueries" */
+ private TriggerListener tableTriggerListener;
+
+ /**
+ * the part name synchronizer
+ */
+ // private final PartNameSynchronizer synchronizer;
+
+
+ public AbstractTableEditor(final ServicesRegistry servicesRegistry, final PapyrusTable rawModel) {
+ this.servicesRegistry = servicesRegistry;
+ this.rawModel = rawModel;
+ //TODO
+ // this.synchronizer = new PartNameSynchronizer(rawModel);
+ }
+
+
+
+ /**
+ *
+ * @see org.eclipse.emf.facet.widgets.nattable.workbench.editor.NatTableEditor#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
+ *
+ * @param site
+ * @param input
+ * @throws PartInitException
+ */
+ @Override
+ public void init(final IEditorSite site, final IEditorInput input) throws PartInitException {
+ final PapyrusTableEditorInput tableEditorInput = new PapyrusTableEditorInput(this.rawModel, getEditingDomain());
+ // initHiddenColumn(this.rawModel);
+ setSite(site);
+ setInput(tableEditorInput);
+ setPartName(this.rawModel.getName());
+ // addListeners();
+ super.init(site, tableEditorInput);
+ }
+
+ // /**
+ // * add listeners on the context of the table and on the table itself
+ // */
+ // protected void addListeners() {
+ // EditingDomain editingDomain = getEditingDomain();
+ // Assert.isTrue(editingDomain instanceof TransactionalEditingDomain);
+ // this.modelTriggerListener = new ModelTriggerListener(this.rawModel, (INatTableWidgetProvider)getAdapter(INatTableWidgetProvider.class));
+ // ((TransactionalEditingDomain)editingDomain).addResourceSetListener(this.modelTriggerListener);
+ // this.tableTriggerListener = new TableTriggerListener(this.rawModel, (INatTableWidgetProvider)getAdapter(INatTableWidgetProvider.class));
+ // ((TransactionalEditingDomain)editingDomain).addResourceSetListener(this.tableTriggerListener);
+ // }
+
+ // /**
+ // *
+ // * @see org.eclipse.papyrus.infra.table.common.internal.NatTableEditor#dispose()
+ // *
+ // * {@inheritDoc}
+ // */
+ // @Override
+ // public void dispose() {
+ // ((TransactionalEditingDomain)getEditingDomain()).removeResourceSetListener(this.modelTriggerListener);
+ // ((TransactionalEditingDomain)getEditingDomain()).removeResourceSetListener(this.tableTriggerListener);
+ // super.dispose();
+ // }
+
+ // /**
+ // *
+ // * @param rawModel2
+ // */
+ // private void initHiddenColumn(final PapyrusTableInstance rawModel2) {
+ // for(Column current : rawModel2.getTable().getColumns()) {
+ // if(current instanceof DefaultLabelColumn || current instanceof MetaClassColumn || current instanceof EContainerColumn){
+ // String name = NatTableWidgetInternalUtils.getColumnName(current);
+ // if(getInitialHiddenColumns().contains(name)) {
+ // current.setIsHidden(true);
+ // }
+ // }
+ // }
+ // }
+
+ // /**
+ // *
+ // * @return
+ // * a list of the names of the columns to hide by default
+ // */
+ // protected List<String> getInitialHiddenColumns() {
+ // return Collections.emptyList();
+ // }
+
+ /**
+ *
+ * @see org.eclipse.emf.facet.widgets.nattable.workbench.editor.NatTableEditor#getEditingDomain()
+ *
+ * @return
+ */
+ @Override
+ public EditingDomain getEditingDomain() {
+ try {
+ return ServiceUtils.getInstance().getTransactionalEditingDomain(this.servicesRegistry);
+ } catch (final ServiceException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+
+ // /**
+ // * This method execute the filling queries
+ // */
+ // @Deprecated
+ // protected void executeQueries() {
+ // if(this.rawModel.isIsSynchronized()) {
+ // TableInstance table = this.rawModel.getTable();
+ // EObject context = table.getContext();
+ // List<EObject> elementsToAdd = new ArrayList<EObject>();
+ // for(ModelQuery query : this.rawModel.getFillingQueries()) {
+ // ModelQuerySetCatalog catalog = ModelQuerySetCatalog.getSingleton();
+ // AbstractModelQuery impl = null;
+ // try {
+ // impl = catalog.getModelQueryImpl(query);
+ // } catch (ModelQueryException e) {
+ // e.printStackTrace();
+ // }
+ // if(impl != null) {
+ // ModelQueryResult result = impl.evaluate(context);
+ // Object value = result.getValue();
+ // if(value instanceof Collection<?>) {
+ // for(Object currentObject : (Collection<?>)value) {
+ // if(currentObject instanceof EObject && !table.getElements().contains(currentObject)) {
+ // elementsToAdd.add((EObject)currentObject);
+ // }
+ // }
+ //
+ // } else {
+ // //nothing to do for the moment
+ // }
+ // }
+ // }
+ // if(!elementsToAdd.isEmpty()) {
+ // // this.natTableWidget.addRows(elementsToAdd);
+ // if(this.natTableWidget instanceof IPapyrusNatTableWidget) {
+ // ((IPapyrusNatTableWidget)this.natTableWidget).addRowsOutOfCommandStack(elementsToAdd);
+ // }
+ // }
+ // }
+ //
+ // }
+
+ // /**
+ // * A class taking in charge the synchronization of the partName and the diagram name.
+ // * When diagram name change, the other is automatically updated.
+ // *
+ // * @author vincent lorenzo
+ // * adapted class from UmlGmfDiagramEditor
+ // */
+ // public class PartNameSynchronizer {
+ //
+ // /** the papyrus table */
+ // private PapyrusTable papyrusTable;
+ //
+ // /**
+ // * Listener on diagram name change.
+ // */
+ // private final Adapter tableNameListener = new Adapter() {
+ //
+ // /**
+ // *
+ // * @see org.eclipse.emf.common.notify.Adapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
+ // *
+ // * @param notification
+ // */
+ // public void notifyChanged(final Notification notification) {
+ // if(notification.getFeatureID(PapyrusTable.class) == PapyrustableinstancePackage.PAPYRUS_TABLE_INSTANCE__NAME && notification.getNotifier() == PartNameSynchronizer.this.papyrusTable) {
+ // setPartName(PartNameSynchronizer.this.papyrusTable.getName());
+ // }
+ // }
+ //
+ // /**
+ // *
+ // * @see org.eclipse.emf.common.notify.Adapter#getTarget()
+ // *
+ // * @return
+ // */
+ // public Notifier getTarget() {
+ // return null;
+ // }
+ //
+ // /**
+ // *
+ // * @see org.eclipse.emf.common.notify.Adapter#setTarget(org.eclipse.emf.common.notify.Notifier)
+ // *
+ // * @param newTarget
+ // */
+ // public void setTarget(final Notifier newTarget) {
+ // }
+ //
+ // /**
+ // *
+ // * @see org.eclipse.emf.common.notify.Adapter#isAdapterForType(java.lang.Object)
+ // *
+ // * @param type
+ // * @return
+ // */
+ // public boolean isAdapterForType(final Object type) {
+ // return false;
+ // }
+ //
+ // };
+ //
+ // /**
+ // *
+ // * Constructor.
+ // *
+ // * @param diagram
+ // */
+ // public PartNameSynchronizer(final PapyrusTable papyrusTable) {
+ // setTable(papyrusTable);
+ // }
+ //
+ // /**
+ // * Change the associated diagram.
+ // *
+ // * @param papyrusTable
+ // */
+ // public void setTable(final PapyrusTable papyrusTable) {
+ // // Remove from old diagram, if any
+ // if(this.papyrusTable != null) {
+ // papyrusTable.eAdapters().remove(this.tableNameListener);
+ // }
+ // // Set new table
+ // this.papyrusTable = papyrusTable;
+ // // Set editor name
+ // setPartName(papyrusTable.getName());
+ // // Listen to name change
+ // papyrusTable.eAdapters().add(this.tableNameListener);
+ // }
+ // }
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/editor/NatTableEditor2.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/editor/NatTableEditor2.java new file mode 100644 index 00000000000..eea53f040f3 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/editor/NatTableEditor2.java @@ -0,0 +1,472 @@ +/*******************************************************************************
+ * Copyright (c) 2010, 2011 Mia-Software.
+ * 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:
+ * Nicolas Bros (Mia-Software) - Bug 331203 - table model editor - initial API and implementation
+ * Nicolas Guyomar (Mia-Software) - Bug 331442 - To be able to add and remove lines (model elements) from the table
+ * Nicolas Bros (Mia-Software) - Bug 332226 - To be able to create or delete model element from the table
+ * Nicolas Guyomar (Mia-Software) - Bug 332226 - To be able to create or delete model element from the table
+ * Nicolas Bros (Mia-Software) - Bug 331900 - customizable NatTable
+ * Nicolas Guyomar (Mia-Software) - Bug 332924 - To be able to save the table
+ * Nicolas Guyomar (Mia-Software) - Bug 332998 - To be able to add a column and fill it with the result of a query
+ * Gregoire Dupe (Mia-Software) - Bug 332998 - To be able to add a column and fill it with the result of a query
+ * Nicolas Guyomar (Mia-Software) - Bug 333015 - To be able to hide columns
+ * Nicolas Guyomar (Mia-Software) - Bug 333029 - To be able to save the size of the lines and the columns
+ * Nicolas Guyomar (Mia-Software) - Bug 335154 - Sort Column By Type : Cannot modify resource set without a write transaction
+ * Nicolas Guyomar (Mia-Software) - Bug 335020 - Nattable widget should use the Eclipse framework
+ *******************************************************************************/
+package org.eclipse.papyrus.infra.table.efacet.common.editor;
+
+import java.util.EventObject;
+import java.util.HashMap;
+
+import org.eclipse.core.databinding.conversion.IConverter;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.command.BasicCommandStack;
+import org.eclipse.emf.common.command.CommandStackListener;
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.Table;
+import org.eclipse.emf.facet.widgets.table.ui.internal.exported.ITableWidget;
+import org.eclipse.emf.facet.widgets.table.ui.internal.exported.ITableWidgetFactory;
+import org.eclipse.emf.facet.widgets.table.ui.internal.exported.ITableWidgetProvider;
+import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.papyrus.infra.table.efacet.common.input.PapyrusTableEditorInput;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
+import org.eclipse.papyrus.infra.widgets.editors.StringLabel;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.EditorPart;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+//TODO : remove the dependency on UML
+/**
+ * Comes from org.eclipse.emf.facet.widget.nattable.workbench.
+ *
+ * This class should not be used by others plugins TODO Should be deleted or
+ * merge with an other classe
+ */
+public class NatTableEditor2 extends EditorPart implements ISelectionProvider, IEditingDomainProvider {// , IWorkbenchPartProvider { //TODO this
+
+ // interface should be useful...
+
+ public static final String ID = "org.eclipse.emf.facet.widgets.nattable.workbench.editor.NatTableEditor"; //$NON-NLS-1$
+
+ private PapyrusTableEditorInput tableEditorInput;
+
+ protected ITableWidget natTableWidget;
+
+ private EditingDomain editingDomain;
+
+ private MenuManager menuMgr;
+
+ private StringLabel contextLabel;
+
+ private final CommandStackListener commandListener = new CommandStackListener() {
+
+ public void commandStackChanged(final EventObject event) {
+ Display.getCurrent().asyncExec(new Runnable() {
+
+ public void run() {
+ firePropertyChange(PROP_DIRTY);
+ }
+ });
+ }
+ };
+
+ /**
+ * we listen the context to refresh it in the table if the context change
+ */
+ private final Adapter contextListener = new AdapterImpl() {
+
+ /**
+ *
+ * @see org.eclipse.emf.common.notify.impl.AdapterImpl#notifyChanged(org.eclipse.emf.common.notify.Notification)
+ *
+ * @param notification
+ */
+ @Override
+ public void notifyChanged(final Notification notification) {
+ NatTableEditor2.this.contextLabel.refreshValue();
+ super.notifyChanged(notification);
+ }
+ };
+
+ @SuppressWarnings("rawtypes")
+ // We cannot change the method signature because of the override
+ @Override
+ public Object getAdapter(final Class adapter) {
+ if(adapter == ITableWidgetProvider.class) {
+ return new ITableWidgetProvider() {
+
+ public ITableWidget getTableWidget() {
+ return NatTableEditor2.this.natTableWidget;
+ }
+ };
+ }
+ return null;
+ }
+
+ @Override
+ public void init(final IEditorSite site, final IEditorInput input) throws PartInitException {
+ if(input instanceof PapyrusTableEditorInput) {
+ this.tableEditorInput = (PapyrusTableEditorInput)input;
+ this.editingDomain = this.tableEditorInput.getEditingDomain();
+ initializeEditingDomain();
+ setSite(site);
+ setInput(this.tableEditorInput);
+ setPartName(this.tableEditorInput.getName());
+ } else if(input instanceof FileEditorInput) {
+ initializeEditingDomain();
+ final FileEditorInput fileEditorInput = (FileEditorInput)input;
+ final URI uri = URI.createPlatformResourceURI(fileEditorInput.getFile().getFullPath().toString(), false);
+ if(uri != null) {
+ Resource resource = null;
+ if(getEditingDomain() != null) {
+ resource = getEditingDomain().loadResource(uri.toString());
+ } else {
+ final ResourceSet rSet = new ResourceSetImpl();
+ resource = rSet.createResource(uri);
+ }
+ PapyrusTable tableInstance = null;
+ for(final EObject eObject : resource.getContents()) {
+ if(eObject instanceof PapyrusTable) {
+ tableInstance = (PapyrusTable)eObject;
+ // One instance of tableInstance per .table file
+ break;
+ }
+ }
+ this.tableEditorInput = new PapyrusTableEditorInput(tableInstance, getEditingDomain());
+ setSite(site);
+ setInput(this.tableEditorInput);
+ setPartName(fileEditorInput.getName());
+ }
+
+ } else {
+ throw new PartInitException("Input should be of type TableEditorInput or a .table file"); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ *
+ * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+ *
+ * @param parent
+ */
+ @Override
+ public void createPartControl(final Composite parent) {
+ this.menuMgr = new MenuManager("#PopUp", NatTableEditor2.ID); //$NON-NLS-1$
+ this.menuMgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
+ this.menuMgr.setRemoveAllWhenShown(true);
+
+ final Composite editorComposite = createCompositeCompositeWthTableBorder(parent);
+ // createFirstLine(editorComposite);
+ // createDescription(editorComposite);
+
+ // the composite owning the table
+ final Composite tableComposite = new Composite(editorComposite, SWT.NONE);
+ final GridLayout tableCompositeGridLayout = new GridLayout(1, true);
+ tableComposite.setLayout(tableCompositeGridLayout);
+
+ final GridData compositeTableGridLayout = new GridData();
+ compositeTableGridLayout.grabExcessHorizontalSpace = true;
+ compositeTableGridLayout.grabExcessVerticalSpace = true;
+ compositeTableGridLayout.horizontalAlignment = SWT.FILL;
+ compositeTableGridLayout.verticalAlignment = SWT.FILL;
+ tableComposite.setLayoutData(compositeTableGridLayout);
+
+ this.natTableWidget = createNattableWidget(tableComposite, this, this.tableEditorInput.getPapyrusTable().getTable(), this.menuMgr);
+
+ getSite().setSelectionProvider(this);
+ getSite().registerContextMenu(this.menuMgr, this.natTableWidget);
+ }
+
+ private ITableWidget createNattableWidget(final Composite tableComposite, final NatTableEditor2 natTableEditor, final Table table, final MenuManager menuMgr2) {
+ // the nattable widget itself
+ // old instanciation
+ // this.natTableWidget =
+ // INatTableWidgetFactory.INSTANCE.createNatTableWidget(tableComposite,
+ // this, this.tableEditorInput.getPapyrusTableInstance().getTable(),
+ // this.menuMgr);
+ this.natTableWidget = ITableWidgetFactory.INSTANCE.createTableWidget(tableComposite, this, table, this.menuMgr);
+ // new PapyrusNatTableWidget(tableComposite, natTableEditor, table,
+ // this.menuMgr);
+ final GridData tableGridData = new GridData();
+ tableGridData.grabExcessHorizontalSpace = true;
+ tableGridData.grabExcessVerticalSpace = true;
+ tableGridData.horizontalAlignment = SWT.FILL;
+ tableGridData.verticalAlignment = SWT.FILL;
+ this.natTableWidget.getComposite().setLayoutData(tableGridData);
+
+ return this.natTableWidget;
+ }
+
+ private Composite createCompositeCompositeWthTableBorder(final Composite parent) {
+ final Composite editorComposite = new Composite(parent, SWT.BORDER);
+ final GridLayout editorGridLayout = new GridLayout(1, true);
+ editorGridLayout.marginHeight = 0;
+ editorGridLayout.marginWidth = 0;
+
+ final GridData data = new GridData();
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = SWT.FILL;
+ editorComposite.setLayoutData(data);
+ editorComposite.setLayout(editorGridLayout);
+ return editorComposite;
+ }
+
+ // /**
+ // *
+ // * @param parent
+ // * the parent composite
+ // */
+ // protected void createFirstLine(final Composite parent) {
+ //
+ // final Table table = this.tableEditorInput.getPapyrusTable().getTable();
+ // Composite firstLineComposite = new Composite(parent, SWT.NONE);
+ // final GridLayout smallGridLayout = new GridLayout(2, true);
+ // smallGridLayout.marginHeight = 0;
+ // smallGridLayout.marginWidth = 0;
+ // smallGridLayout.marginLeft = 0;
+ // smallGridLayout.marginRight = 0;
+ //
+ // firstLineComposite.setLayout(smallGridLayout);
+ // GridData lineData = new GridData();
+ // lineData.horizontalSpan = 1;
+ // lineData.horizontalAlignment = SWT.FILL;
+ // firstLineComposite.setLayoutData(lineData);
+ //
+ // //we display the context of the table
+ // this.contextLabel = new StringLabel(firstLineComposite, SWT.LEFT);
+ // this.contextLabel.setLabel(Messages.NatTableEditor_TableContextLabel);
+ // this.contextLabel.setToolTipText(Messages.NatTableEditor_TableContextTollTip);
+ //
+ // //we observe the feature context of the table (and not the name of the
+ // context, because the context is not a NamedElement, but an EObject
+ // final IObservableValue contextObservable = new
+ // EObjectObservableValue(table,
+ // TableinstancePackage.eINSTANCE.getTableInstance_Context());
+ // table.getContext().eAdapters().add(this.contextListener);
+ // /*
+ // * we should set the converted before the observable!
+ // */
+ // this.contextLabel.setConverters(null, new ContextLabelConverter());
+ // this.contextLabel.setLabelProvider(new UMLLabelProvider());
+ // this.contextLabel.setModelObservable(contextObservable);
+ //
+ // //set the layout for contextLabel
+ // GridData contextGridData = new GridData();
+ // contextGridData.grabExcessHorizontalSpace = true;
+ // contextGridData.horizontalAlignment = SWT.FILL;
+ // contextGridData.horizontalSpan = 1;
+ // this.contextLabel.setLayoutData(contextGridData);
+ //
+ // BooleanRadio checkbox = new BooleanRadio(firstLineComposite, SWT.NONE,
+ // "IsSynchronized :");
+ // checkbox.setToolTipText("Indicates if the table is synchronized with queries");
+ // final IObservableValue isSynchronizedObservable = new
+ // EMFObservableValue(this.tableEditorInput.getPapyrusTable(),
+ // PapyrustableinstancePackage.eINSTANCE.getPapyrusTableInstance_IsSynchronized(),
+ // getEditingDomain());
+ // checkbox.setModelObservable(isSynchronizedObservable);
+ //
+ // GridData checkboxGridData = new GridData();
+ // checkboxGridData.grabExcessHorizontalSpace = true;
+ // checkboxGridData.horizontalAlignment = SWT.FILL;
+ // checkbox.setLayoutData(checkboxGridData);
+ //
+ // }
+
+ // protected void createDescription(final Composite parent) {
+ // final TableInstance table =
+ // this.tableEditorInput.getPapyrusTableInstance().getTable();
+ // EClass tableEClass = table.eClass();
+ //
+ // //we display the description of the table
+ // final StringEditor descriptionEditor = new StringEditor(parent,
+ // SWT.MULTI);
+ // descriptionEditor.setLabel(Messages.NatTableEditor_TaleDescriptionLabel);
+ // descriptionEditor.setToolTipText(Messages.NatTableEditor_TableDescriptionToolTip);
+ //
+ //
+ // EStructuralFeature myFeature =
+ // tableEClass.getEStructuralFeature(TableinstancePackage.TABLE_INSTANCE__DESCRIPTION);
+ // EMFObservableValue observable = new EMFObservableValue(table, myFeature,
+ // getEditingDomain());
+ // descriptionEditor.setModelObservable(observable);
+ //
+ // //set the layout for the description editor
+ // GridData descriptionGridData = new GridData();
+ // descriptionGridData.grabExcessHorizontalSpace = true;
+ // descriptionGridData.horizontalAlignment = SWT.FILL;
+ // descriptionEditor.setLayoutData(descriptionGridData);
+ // }
+
+ @Override
+ public void dispose() {
+ if(this.natTableWidget.getTable().getContext() != null) {// can be null
+ // when we
+ // are
+ // destroying
+ // the
+ // context
+ // (and the
+ // table!)
+ this.natTableWidget.getTable().getContext().eAdapters().remove(this.contextListener);
+ }
+ super.dispose();
+ }
+
+ @Override
+ public void setFocus() {
+ this.natTableWidget.getComposite().setFocus();
+ }
+
+ @Override
+ public boolean isDirty() {
+ return ((BasicCommandStack)this.editingDomain.getCommandStack()).isSaveNeeded();
+ }
+
+ @Override
+ public boolean isSaveAsAllowed() {
+ return true;
+ }
+
+ @Override
+ public void doSave(final IProgressMonitor monitor) {
+ this.natTableWidget.save();
+ firePropertyChange(PROP_DIRTY);
+ }
+
+ @Override
+ public void doSaveAs() {
+ this.natTableWidget.saveAs();
+ firePropertyChange(PROP_DIRTY);
+ }
+
+ public void addSelectionChangedListener(final ISelectionChangedListener listener) {
+ this.natTableWidget.addSelectionChangedListener(listener);
+ }
+
+ public ISelection getSelection() {
+ /*
+ * if nattable has the focus : we retun the nattable selection if not,
+ * we return the papyrus table instance
+ */
+ // TODO
+ // Control[] children = ((Composite)this.natTableWidget).getChildren();
+ // if(children.length != 0) {
+ // boolean focus = children[0].isFocusControl();
+ // if(focus) {
+ // return this.natTableWidget.getSelection();
+ // }
+ // }
+ int i = 0;
+ i++;
+ final ISelection tableSelection = this.natTableWidget.getSelection();
+ if(tableSelection.isEmpty()) {
+ return new StructuredSelection(this.tableEditorInput.getPapyrusTable());
+ }
+ return tableSelection;
+ }
+
+ public EditingDomain getEditingDomain() {
+ return this.editingDomain;
+ }
+
+ public void removeSelectionChangedListener(final ISelectionChangedListener listener) {
+ this.natTableWidget.removeSelectionChangedListener(listener);
+ }
+
+ public void setSelection(final ISelection selection) {
+ this.natTableWidget.setSelection(selection);
+ }
+
+ /**
+ * This sets up the editing domain for the model editor
+ */
+ protected void initializeEditingDomain() {
+ if(this.editingDomain == null) {
+ final ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ final BasicCommandStack commandStack = new BasicCommandStack();
+ this.editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
+ }
+ this.editingDomain.getCommandStack().removeCommandStackListener(this.commandListener);
+ this.editingDomain.getCommandStack().addCommandStackListener(this.commandListener);
+ }
+
+ public IWorkbenchPart getPart() {
+ return this;
+ }
+
+ /**
+ * This ocnverter is used by the LabelEditor (used to display the context)
+ *
+ *
+ *
+ */
+ private class ContextLabelConverter implements IConverter {
+
+ /**
+ *
+ * @see org.eclipse.core.databinding.conversion.IConverter#getToType()
+ *
+ * @return
+ */
+ public Object getToType() {
+ return String.class;
+ }
+
+ /**
+ *
+ * @see org.eclipse.core.databinding.conversion.IConverter#getFromType()
+ *
+ * @return
+ */
+ public Object getFromType() {
+ return Object.class;
+ }
+
+ /**
+ *
+ * @see org.eclipse.core.databinding.conversion.IConverter#convert(java.lang.Object)
+ *
+ * @param fromObject
+ * @return
+ */
+ public Object convert(final Object fromObject) {
+ if(fromObject instanceof EObject) {
+ return UMLUtil.getQualifiedText((EObject)fromObject);
+ }
+ return ""; //$NON-NLS-1$
+ }
+ }
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/factory/AbstractTableEditorFactory.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/factory/AbstractTableEditorFactory.java new file mode 100644 index 00000000000..381d1d313a4 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/factory/AbstractTableEditorFactory.java @@ -0,0 +1,187 @@ +package org.eclipse.papyrus.infra.table.efacet.common.factory;
+
+import java.lang.reflect.Constructor;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.papyrus.infra.core.editor.BackboneException;
+import org.eclipse.papyrus.infra.core.extension.diagrameditor.AbstractEditorFactory;
+import org.eclipse.papyrus.infra.core.multidiagram.actionbarcontributor.ActionBarContributorRegistry;
+import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel;
+import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.table.efacet.common.Activator;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.EditorActionBarContributor;
+
+public class AbstractTableEditorFactory extends AbstractEditorFactory {
+
+ public AbstractTableEditorFactory(final Class<?> diagramClass, final String expectedType) {
+ super(diagramClass, expectedType);
+ }
+
+ /**
+ * Create the IPageModel that is used by the SashWindows to manage the
+ * editor.
+ *
+ * @see org.eclipse.papyrus.infra.core.editorsfactory.IEditorFactory#createIPageModel(java.lang.Object)
+ *
+ * @param pageIdentifier
+ * The model pushed in the sashmodel by the creation command
+ * @return A model implementing the IPageModel
+ */
+ public IPageModel createIPageModel(final Object pageIdentifier) {
+ return new TableEditorModel(pageIdentifier, getServiceRegistry());
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.core.editorsfactory.IEditorFactory#isPageModelFactoryFor(java.lang.Object)
+ *
+ * @param pageIdentifier
+ * @return
+ */
+ public boolean isPageModelFactoryFor(final Object pageIdentifier) {
+ if(pageIdentifier instanceof PapyrusTable) {
+ return getExpectedType().equals(((PapyrusTable)pageIdentifier).getType());
+ }
+ return false;
+ }
+
+ /**
+ * IEditorModel used internally by the SashContainer. This model know how to
+ * handle IEditor creation.
+ *
+ * @author cedric dumoulin
+ *
+ */
+ class TableEditorModel implements IEditorModel {
+
+ /**
+ * The servicesRegistry provided at creation.
+ */
+ private final ServicesRegistry servicesRegistry;
+
+ /**
+ * The created editor.
+ */
+ private IEditorPart editor;
+
+ /**
+ * The raw model stored in the SashProvider.
+ */
+ private final PapyrusTable rawModel;
+
+ /**
+ *
+ * Constructor.
+ */
+ public TableEditorModel(final Object pageIdentifier, final ServicesRegistry servicesRegistry) {
+ this.rawModel = (PapyrusTable)pageIdentifier;
+ this.servicesRegistry = servicesRegistry;
+ }
+
+ /**
+ * Create the IEditor for the diagram.
+ *
+ * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel#createIEditorPart()
+ * @return
+ * @throws PartInitException
+ *
+ */
+ public IEditorPart createIEditorPart() throws PartInitException {
+ try {
+
+ final Constructor<?> c = getDiagramClass().getConstructor(ServicesRegistry.class, PapyrusTable.class);
+ final IEditorPart newEditor = (IEditorPart)c.newInstance(this.servicesRegistry, this.rawModel);
+ // IEditorPart newEditor = new
+ // DefaultNattableEditor(getServiceRegistry(), rawModel);
+ this.editor = newEditor;
+ return this.editor;
+
+ } catch (final Exception e) {
+ // Lets propagate. This is an implementation problem that should
+ // be solved by
+ // programmer.
+ throw new PartInitException("Can't create TextEditor", e); //$NON-NLS-1$
+ }
+
+ }
+
+ /**
+ * Get the action bar requested by the Editor.
+ *
+ * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel#getActionBarContributor()
+ * @return
+ *
+ */
+ public EditorActionBarContributor getActionBarContributor() {
+
+ final String actionBarId = AbstractTableEditorFactory.this.editorDescriptor.getActionBarContributorId();
+
+ // Do nothing if no EditorActionBarContributor is specify.
+ if(actionBarId == null || actionBarId.length() == 0) {
+ return null;
+ }
+
+ // Try to get it.
+
+ // Get ServiceRegistry
+ // ServicesRegistry serviceRegistry = getServicesRegistry();
+ ActionBarContributorRegistry registry;
+ try {
+ registry = this.servicesRegistry.getService(ActionBarContributorRegistry.class);
+ } catch (final ServiceException e) {
+ Activator.log.error(e);
+ return null;
+ }
+
+ try {
+ return registry.getActionBarContributor(actionBarId);
+ } catch (final BackboneException e) {
+ Activator.log.error(e);
+ return null;
+ }
+ }
+
+ /**
+ * Get the underlying RawModel. Return the Diagram.
+ *
+ * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel#getRawModel()
+ * @return
+ *
+ */
+ public Object getRawModel() {
+ return this.rawModel;
+ }
+
+ /**
+ * Get the icon to be shown by Tabs
+ *
+ * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel#getTabIcon()
+ * @return
+ *
+ */
+ public Image getTabIcon() {
+ final ImageDescriptor imageDescriptor = getEditorDescriptor().getIcon();
+ if(imageDescriptor == null) {
+ return null;
+ }
+
+ return imageDescriptor.createImage();
+ }
+
+ /**
+ * Get the title of the Diagram.
+ *
+ * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel#getTabTitle()
+ * @return
+ *
+ */
+ public String getTabTitle() {
+ return this.rawModel.getName();
+ }
+ }
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/AbstractCreateTableEditorHandler.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/AbstractCreateTableEditorHandler.java new file mode 100644 index 00000000000..6761edf2011 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/handlers/AbstractCreateTableEditorHandler.java @@ -0,0 +1,421 @@ +package org.eclipse.papyrus.infra.table.efacet.common.handlers;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.Table;
+import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.tableconfiguration.TableConfiguration;
+import org.eclipse.emf.facet.widgets.table.ui.internal.exported.TableWidgetUtils;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.workspace.AbstractEMFOperation;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.commands.CheckedOperationHistory;
+import org.eclipse.papyrus.infra.core.editor.BackboneException;
+import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.infra.core.resource.AbstractBaseModel;
+import org.eclipse.papyrus.infra.core.resource.IModel;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.resource.NotFoundException;
+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.EditorUtils;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers;
+import org.eclipse.papyrus.infra.table.efacet.common.Activator;
+import org.eclipse.papyrus.infra.table.efacet.common.modelresource.PapyrusTableModelResource;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustableFactory;
+import org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PlatformUI;
+
+public abstract class AbstractCreateTableEditorHandler extends AbstractHandler {
+
+ /** the default name for the table */
+ private final String defaultName;
+
+ /** the name for the table */
+ private String name;
+
+ /** the editor type */
+ private final String editorType;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param editorType
+ * the type of the editor
+ * @param defaultName
+ * the default name for this editor
+ */
+ public AbstractCreateTableEditorHandler(final String editorType, final String defaultName) {
+ Assert.isNotNull(editorType != null);
+ this.editorType = editorType;
+ this.defaultName = defaultName;
+ }
+
+ /**
+ * Should be overridden in order to restrict creation
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
+ *
+ * @return
+ */
+ @Override
+ public boolean isEnabled() {
+ final EObject context = getTableContext();
+ return context instanceof EObject;
+ }
+
+ /**
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ *
+ * @param event
+ * @return
+ * @throws ExecutionException
+ */
+ public Object execute(final ExecutionEvent event) throws ExecutionException {
+ try {
+
+ runAsTransaction();
+ } catch (final ServiceException e) {
+ throw new ExecutionException("Can't create TableEditor", e); //$NON-NLS-1$
+ }
+ return null;
+ }
+
+ /**
+ * Run the command as a transaction.
+ * Create a Transaction and delegate the command to {@link #doExecute(ServicesRegistry)}.
+ *
+ * @throws ServiceException
+ *
+ */
+ public void runAsTransaction() throws ServiceException {
+ //default Value
+ this.name = this.defaultName;
+ final InputDialog dialog = new InputDialog(Display.getCurrent().getActiveShell(), "Create new table", "myLabel", "myName", null);//TODO improve it
+ if(dialog.open() == Dialog.OK) {
+ //get the name and the description for the table
+ this.name = dialog.getValue();
+
+ final ServicesRegistry serviceRegistry = ServiceUtilsForActionHandlers.getInstance().getServiceRegistry();
+ final TransactionalEditingDomain domain = ServiceUtils.getInstance().getTransactionalEditingDomain(serviceRegistry);
+
+ //Create the transactional command
+ final AbstractEMFOperation command = new AbstractEMFOperation(domain, "Create Table Editor") { //$NON-NLS-1$ //TODO add the type of the table in the command name
+
+ @Override
+ protected IStatus doExecute(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+ try {
+ AbstractCreateTableEditorHandler.this.doExecute(serviceRegistry);
+ } catch (final ServiceException e) {
+ Activator.log.error(e);
+ return Status.CANCEL_STATUS;
+ } catch (final NotFoundException e) {
+ Activator.log.error(e);
+ return Status.CANCEL_STATUS;
+ }
+ return Status.OK_STATUS;
+ }
+ };
+
+ // Execute the command
+ try {
+ CheckedOperationHistory.getInstance().execute(command, new NullProgressMonitor(), null); //TODO : best way?
+ } catch (final ExecutionException e) {
+ Activator.log.error("Can't create Table Editor", e); //$NON-NLS-1$
+ }
+ }
+ }
+
+ /**
+ * Do the execution of the command.
+ *
+ * @param serviceRegistry
+ * @throws ServiceException
+ * @throws NotFoundException
+ */
+ public void doExecute(final ServicesRegistry serviceRegistry) throws ServiceException, NotFoundException {
+
+ final Object editorModel = createEditorModel(serviceRegistry);
+ // Get the mngr allowing to add/open new editor.
+ final IPageMngr pageMngr = ServiceUtils.getInstance().getIPageMngr(serviceRegistry);
+ // add the new editor model to the sash.
+ pageMngr.openPage(editorModel);
+
+ }
+
+ /**
+ * Create a model identifying the editor. This model will be saved with the sash
+ *
+ * @return
+ * @throws ServiceException
+ * @throws NotFoundException
+ * The model where to save the TableInstance is not found.
+ */
+ protected Object createEditorModel(final ServicesRegistry serviceRegistry) throws ServiceException, NotFoundException {
+ final PapyrusTable papyrusTable = PapyrustableFactory.eINSTANCE.createPapyrusTable();
+ papyrusTable.setName(this.name);
+ papyrusTable.setType(this.editorType);
+ final PapyrusTableModelResource papyrusModel = (PapyrusTableModelResource)ServiceUtils.getInstance().getModelSet(serviceRegistry).getModelChecked(PapyrusTableModelResource.MODEL_ID);
+ papyrusModel.addPapyrusTable(papyrusTable);
+
+ final PapyrusTableConfiguration configuration = getPapyrusTableConfiguration();
+ if(configuration != null) {
+ papyrusTable.setFillingMode(configuration.getFillingMode());
+ papyrusTable.setFeature(configuration.getListenFeature());
+ papyrusTable.getQueries().addAll(configuration.getFillingQueries());
+ }
+ //TODO
+ // setFillingQueries(papyrusTable); //should be done before the TableInstance creation
+ // setSynchronization(papyrusTable); //should be done before the TableInstance creation
+ final EObject context = getTableContext();
+ Assert.isNotNull(context);
+ // List<EObject> elements = getInitialElement(papyrusTable, context);
+
+ //TODO initialize these elements if necessary...
+ final List<EObject> elements = new ArrayList<EObject>();
+ // elements.add(getTableContext());
+ final String description = null;
+ TableConfiguration tableConfiguration = null;
+ if(configuration != null) {
+ tableConfiguration = configuration.getTableConfiguration();
+ }
+ final Object parameter = null;
+ final Table table = TableWidgetUtils.createTableInstance(elements, description, tableConfiguration, context, parameter);
+ // TableInstance2 tableInstance = NatTableWidgetUtils.createTableInstance(elements, defaultDescription, getTableConfiguration2(), getTableContext(), null);
+ // tableInstance.setDescription(description);
+
+ // Save the model in the associated resource
+ // EMFFacetTableModelResource model = (EMFFacetTableModelResource)ServiceUtils.getInstance().getModelSet(serviceRegistry).getModelChecked(EMFFacetTableModelResource.MODEL_ID);
+ // model.addTableInstance(table);
+ papyrusTable.setTable(table);
+
+ // tableInstance.setContext(context);
+
+ // setHiddenColumns(papyrusTable);
+ // adapter factory used by EMF objects
+ final AdapterFactory factory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ /** label provider for EMF objects */
+ final ILabelProvider labelProvider = new AdapterFactoryLabelProvider(factory);
+ System.out.println(labelProvider.getText(papyrusTable));;
+ return papyrusTable;
+ }
+
+ // /**
+ // *
+ // * @param papyrusTable
+ // * the papyrus table
+ // * @param context
+ // * @return the list of the initial element for the table
+ // */
+ // private List<EObject> getInitialElement(PapyrusTableInstance papyrusTable, EObject context) {
+ // if(papyrusTable.isIsSynchronized() && !papyrusTable.getFillingQueries().isEmpty()) {
+ // List<EObject> elements = new ArrayList<EObject>();
+ //
+ // for(ModelQuery query : papyrusTable.getFillingQueries()) {
+ // ModelQuerySetCatalog catalog = ModelQuerySetCatalog.getSingleton();
+ // AbstractModelQuery impl = null;
+ // try {
+ // impl = catalog.getModelQueryImpl(query);
+ // } catch (ModelQueryException e) {
+ // Activator.getDefault().log.error(e);
+ // }
+ // if(impl != null) {
+ // ModelQueryResult result = impl.evaluate(context);
+ // Object value = result.getValue();
+ // if(value instanceof Collection<?>) {
+ // // the build the list of the elements to add in the
+ // // table
+ // for(Object currentObject : (Collection<?>)value) {
+ // if(currentObject instanceof EObject) {
+ // elements.add((EObject)currentObject);
+ // }
+ // }
+ //
+ // }
+ // }
+ // }
+ // return elements;
+ // }
+ // return Collections.emptyList();
+ // }
+ //
+ // /**
+ // * Allows to hide the columns created by default
+ // *
+ // * @param papyrusTable
+ // */
+ // private void setHiddenColumns(final PapyrusTableInstance papyrusTable) {
+ // List<String> hiddenColumnsName = getHiddenColumnName();
+ // if(!hiddenColumnsName.isEmpty()) {
+ // for(Column column : papyrusTable.getTable().getColumns()) {
+ // String name = NatTableWidgetInternalUtils.getColumnName(column);
+ // if(hiddenColumnsName.contains(name)) {
+ // column.setIsHidden(true);
+ // }
+ // }
+ // }
+ // }
+
+ // /**
+ // * Returns the list of the columns to hide. Currently, the name can be :
+ // * <ul>
+ // * <li>[Label]</li>
+ // * <li>[Metaclass]</li>
+ // * <li>/eContainer</li>
+ // * </ul>
+ // *
+ // * @return
+ // * the list of the columns to hide
+ // */
+ // protected List<String> getHiddenColumnName() {
+ // return Collections.emptyList();
+ // }
+ //
+ // /**
+ // * Returns the table configuration for the table
+ // *
+ // * {@link Deprecated} // use getTableConfiguration2
+ // *
+ // * @return
+ // * the table configuration of the table
+ // * FIXME should be removed in Papyrus 0.9.0
+ // *
+ // */
+ // @Deprecated
+ // protected TableConfiguration getTableConfiguration() {
+ // return getTableConfiguration2();
+ // }
+ //
+ // /**
+ // * Returns the table configuration for the table
+ // *
+ // * @return
+ // * the table configuration of the table
+ // *
+ // */
+ // protected TableConfiguration2 getTableConfiguration2() {
+ // return null;
+ // }
+ //
+
+ /**
+ *
+ * @return
+ * the configuration to use for the table
+ */
+ protected abstract PapyrusTableConfiguration getPapyrusTableConfiguration();
+
+ /**
+ * Get the current MultiDiagramEditor.
+ *
+ * @return
+ * @throws BackboneException
+ */
+ protected IMultiDiagramEditor getMultiDiagramEditor() throws BackboneException {
+ return EditorUtils.getMultiDiagramEditorChecked();
+ }
+
+ /**
+ * Returns the context used to create the table
+ *
+ * @return
+ * the context used to create the table or <code>null</code> if not found
+ * @throws ServiceException
+ */
+ protected EObject getTableContext() {
+ final List<EObject> selection = getSelection();
+
+ if(!selection.isEmpty()) {
+ return selection.get(0);
+ }
+
+ //we shouldn't try to find a valid context when the selection is not valid!
+ ModelSet modelSet = null;
+ ServicesRegistry serviceRegistry;
+ try {
+ serviceRegistry = ServiceUtilsForActionHandlers.getInstance().getServiceRegistry();
+ modelSet = ServiceUtils.getInstance().getModelSet(serviceRegistry);
+ } catch (final NullPointerException npe) {
+ //
+ } catch (final ServiceException exception) {
+
+ }
+
+
+ if(modelSet != null) {
+ final IModel model = modelSet.getModel(org.eclipse.papyrus.infra.core.resource.uml.UmlModel.MODEL_ID);
+
+ if(model instanceof AbstractBaseModel) {
+ return getRootElement(((AbstractBaseModel)model).getResource());
+ }
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @return
+ */
+ protected List<EObject> getSelection() {
+ final List<EObject> selectedElements = new ArrayList<EObject>();
+ final ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
+ if(selection instanceof IStructuredSelection) {
+
+ final IStructuredSelection structuredSelection = (IStructuredSelection)selection;
+
+ final Iterator<?> it = structuredSelection.iterator();
+ while(it.hasNext()) {
+ final Object object = it.next();
+ if(object instanceof IAdaptable) {
+ final EObject currentEObject = (EObject)((IAdaptable)object).getAdapter(EObject.class);
+
+ if(currentEObject != null) {
+ selectedElements.add(currentEObject);
+ }
+ }
+
+ }
+ }
+ return selectedElements;
+ }
+
+ /**
+ * Get the root element associated with canvas.
+ */
+ protected EObject getRootElement(final Resource modelResource) {
+ EObject rootElement = null;
+ if(modelResource != null && modelResource.getContents() != null && modelResource.getContents().size() > 0) {
+ final Object root = modelResource.getContents().get(0);
+ if(root instanceof EObject) {
+ rootElement = (EObject)root;
+ }
+ }
+ return rootElement;
+ }
+
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/input/PapyrusTableEditorInput.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/input/PapyrusTableEditorInput.java new file mode 100644 index 00000000000..95ee61a5aba --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/input/PapyrusTableEditorInput.java @@ -0,0 +1,77 @@ +/*******************************************************************************
+ * Copyright (c) 2009, 2010 Mia-Software.
+ * 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:
+ * Nicolas Bros (Mia-Software) - Bug 331203 - table model editor - initial API and implementation
+ * Nicolas Guyomar (Mia-Software) - Bug 332924 - To be able to save the table
+ * Nicolas Guyomar (Mia-Software) - Bug 333029 - To be able to save the size of the lines and the columns
+ *******************************************************************************/
+package org.eclipse.papyrus.infra.table.efacet.common.input;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+
+/**
+ * Comes from org.eclipse.emf.facet.widget.nattable.workbench.
+ *
+ * This class should not be used by others plugins
+ */
+public class PapyrusTableEditorInput implements IEditorInput {
+
+ /** The input for the Table widget */
+ private final PapyrusTable papyrusTable;
+
+ /** A textual description of what is shown in the editor */
+ private final String description;
+
+ private final EditingDomain editingDomain;
+
+ public PapyrusTableEditorInput(final PapyrusTable papyrusTable, final EditingDomain editingDomain) {
+ this.papyrusTable = papyrusTable;
+ this.description = papyrusTable.getTable().getDescription();
+ this.editingDomain = editingDomain;
+ }
+
+ public PapyrusTable getPapyrusTable() {
+ return this.papyrusTable;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public boolean exists() {
+ return false;
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return null;
+ }
+
+ public String getName() {
+ return "PapyrusTable Model"; //$NON-NLS-1$
+ }
+
+ public IPersistableElement getPersistable() {
+ return null;
+ }
+
+ public String getToolTipText() {
+ return "PapyrusTable Model"; //$NON-NLS-1$
+ }
+
+ public Object getAdapter(@SuppressWarnings("rawtypes") final Class adapter) {
+ return null;
+ }
+
+ public EditingDomain getEditingDomain() {
+ return this.editingDomain;
+ }
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/modelresource/EMFFacetTableModelResource.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/modelresource/EMFFacetTableModelResource.java new file mode 100644 index 00000000000..51802ebbb1a --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/modelresource/EMFFacetTableModelResource.java @@ -0,0 +1,126 @@ +/*****************************************************************************
+ * Copyright (c) 2011 LIFL & 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:
+ * Cedric Dumoulin (LIFL) cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.table.efacet.common.modelresource;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.facet.widgets.nattable.instance.tableinstance.TableInstance;
+import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.Table;
+import org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource;
+import org.eclipse.papyrus.infra.core.resource.IModel;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+
+
+
+/**
+ * A model used to save data from the {@link DefaultNattableEditor}
+ *
+ * @author cedric dumoulin
+ *
+ */
+public class EMFFacetTableModelResource extends /* AbstractBaseModel */AbstractModelWithSharedResource<TableInstance> implements IModel {
+
+ /*
+ * To save in a new file :
+ * the class should extends AbstractBaseModel and NOTATION_FILE_EXTENSION = "nattable" for example
+ */
+
+
+ /**
+ * File extension used for notation.
+ */
+ // public static final String NOTATION_FILE_EXTENSION = "nattable"; //$NON-NLS-1$
+
+ public static final String NOTATION_FILE_EXTENSION = "notation"; //$NON-NLS-1$
+
+ /**
+ * Model ID.
+ */
+ public static final String MODEL_ID = "org.eclipse.papyrus.emf.facet.table.resource.TableModel"; //$NON-NLS-1$
+
+
+ /**
+ *
+ * Constructor.
+ *
+ */
+ public EMFFacetTableModelResource() {
+
+ }
+
+ // Initialize stuff in the model.
+ @Override
+ public void init(final ModelSet modelManager) {
+ super.init(modelManager);
+ // nothing to do now
+ }
+
+ /**
+ * Get the file extension used for this model.
+ *
+ * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getModelFileExtension()
+ *
+ * @return
+ */
+ @Override
+ protected String getModelFileExtension() {
+ return NOTATION_FILE_EXTENSION;
+ }
+
+ /**
+ * Get the identifier used to register this model.
+ *
+ * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getIdentifier()
+ *
+ * @return
+ */
+ @Override
+ public String getIdentifier() {
+ return MODEL_ID;
+ }
+
+
+ /**
+ * Add a new initialized {@link Diagram} to the model.
+ *
+ * @param newDiagram
+ * The diagram to add.
+ */
+ public void addTableInstance(final Table tableInstance) {
+ getResource().getContents().add(tableInstance);
+ }
+
+ /**
+ * Add a new initialized {@link Diagram} to the model.
+ *
+ * @param newDiagram
+ * The diagram to add.
+ */
+ public void removeTableInstance(final Table tableInstance) {
+ getResource().getContents().remove(tableInstance);
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource#isModelRoot(org.eclipse.emf.ecore.EObject)
+ *
+ * @param object
+ * @return
+ */
+ @Override
+ protected boolean isModelRoot(final EObject object) {
+ return false;
+ }
+
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/modelresource/PapyrusTableModelResource.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/modelresource/PapyrusTableModelResource.java new file mode 100644 index 00000000000..01a743d541a --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.common/src/org/eclipse/papyrus/infra/table/efacet/common/modelresource/PapyrusTableModelResource.java @@ -0,0 +1,126 @@ +/*****************************************************************************
+ * Copyright (c) 2011 LIFL & 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:
+ * Cedric Dumoulin (LIFL) cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.table.efacet.common.modelresource;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.Table;
+import org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource;
+import org.eclipse.papyrus.infra.core.resource.IModel;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
+
+
+
+/**
+ * A model used to save data from the {@link DefaultNattableEditor}
+ *
+ * @author cedric dumoulin
+ *
+ */
+public class PapyrusTableModelResource extends AbstractModelWithSharedResource<Table> implements IModel {
+
+ /*
+ * To save in a new file :
+ * the class should extends AbstractBaseModel and NOTATION_FILE_EXTENSION = "nattable" for example
+ */
+
+
+ /**
+ * File extension used for notation.
+ */
+ // public static final String NOTATION_FILE_EXTENSION = "nattable"; //$NON-NLS-1$
+
+ public static final String NOTATION_FILE_EXTENSION = "notation"; //$NON-NLS-1$
+
+ /**
+ * Model ID.
+ */
+ public static final String MODEL_ID = "org.eclipse.papyrus.infra.table.efacet.common.modelresource.PapyrusTableModelResource"; //$NON-NLS-1$
+
+
+ /**
+ *
+ * Constructor.
+ *
+ */
+ public PapyrusTableModelResource() {
+
+ }
+
+ // Initialize stuff in the model.
+ @Override
+ public void init(final ModelSet modelManager) {
+ super.init(modelManager);
+ // nothing to do now
+ }
+
+ /**
+ * Get the file extension used for this model.
+ *
+ * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getModelFileExtension()
+ *
+ * @return
+ */
+ @Override
+ protected String getModelFileExtension() {
+ return NOTATION_FILE_EXTENSION;
+ }
+
+ /**
+ * Get the identifier used to register this model.
+ *
+ * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getIdentifier()
+ *
+ * @return
+ */
+ @Override
+ public String getIdentifier() {
+ return MODEL_ID;
+ }
+
+
+ /**
+ * Add a new initialized {@link PapyrusTable} to the model.
+ *
+ * @param papyrusTable
+ * The tableInstance to add.
+ */
+ public void addPapyrusTable(final PapyrusTable papyrusTable) {
+ getResource().getContents().add(papyrusTable);
+ }
+
+ /**
+ * Add a new initialized {@link PapyrusTable} to the model.
+ *
+ * @param papyrusTable
+ * The tableInstance to add.
+ */
+ public void removePapyrusTable(final PapyrusTable papyrusTable) {
+ getResource().getContents().remove(papyrusTable);
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource#isModelRoot(org.eclipse.emf.ecore.EObject)
+ *
+ * @param object
+ * @return
+ */
+ @Override
+ protected boolean isModelRoot(final EObject object) {
+ return false;
+ }
+
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/.classpath b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/.classpath new file mode 100644 index 00000000000..cedf0d0d0b5 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src-gen"/>
+ <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/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/.project b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/.project new file mode 100644 index 00000000000..57e3fdfb252 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.table.efacet.metamodel.edit</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/META-INF/MANIFEST.MF b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..39ac11b8f10 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/META-INF/MANIFEST.MF @@ -0,0 +1,25 @@ +Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.infra.table.efacet.metamodel.edit;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-ClassPath: .
+Bundle-Activator: org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.provider.PapyrustableEditPlugin$Implementation
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.provider
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.edit;visibility:=reexport,
+ org.eclipse.emf.facet.widgets.celleditors;visibility:=reexport,
+ org.eclipse.emf.facet.widgets.celleditors.edit;visibility:=reexport,
+ org.eclipse.emf.facet.custom.metamodel;visibility:=reexport,
+ org.eclipse.emf.facet.custom.metamodel.edit;visibility:=reexport,
+ org.eclipse.emf.ecore;visibility:=reexport,
+ org.eclipse.emf.ecore.edit;visibility:=reexport,
+ org.eclipse.emf.facet.efacet.metamodel;visibility:=reexport,
+ org.eclipse.emf.facet.efacet.metamodel.edit;visibility:=reexport,
+ org.eclipse.emf.facet.widgets.table.metamodel;visibility:=reexport,
+ org.eclipse.emf.facet.widgets.table.metamodel.edit;visibility:=reexport,
+ org.eclipse.papyrus.infra.table.efacet.metamodel
+Bundle-ActivationPolicy: lazy
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/build.properties b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/build.properties new file mode 100644 index 00000000000..0907e276e95 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/build.properties @@ -0,0 +1,19 @@ +# 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
+
+bin.includes = .,\
+ icons/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties
+jars.compile.order = .
+source.. = src-gen/
+output.. = bin/
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/icons/full/obj16/PapyrusTable.gif b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/icons/full/obj16/PapyrusTable.gif Binary files differnew file mode 100644 index 00000000000..106881e5d9b --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/icons/full/obj16/PapyrusTable.gif diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/plugin.properties b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/plugin.properties new file mode 100644 index 00000000000..68f9143a538 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/plugin.properties @@ -0,0 +1,42 @@ +# 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
+
+pluginName = Papyrustable Edit Support
+providerName = www.example.org
+
+_UI_CreateChild_text = {0}
+_UI_CreateChild_text2 = {1} {0}
+_UI_CreateChild_text3 = {1}
+_UI_CreateChild_tooltip = Create New {0} Under {1} Feature
+_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}.
+_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent.
+
+_UI_PropertyDescriptor_description = The {0} of the {1}
+
+_UI_PapyrusTable_type = Papyrus Table
+_UI_Unknown_type = Object
+
+_UI_Unknown_datatype= Value
+
+_UI_PapyrusTable_name_feature = Name
+_UI_PapyrusTable_type_feature = Type
+_UI_PapyrusTable_table_feature = Table
+_UI_PapyrusTable_fillingMode_feature = Filling Mode
+_UI_PapyrusTable_feature_feature = Feature
+_UI_PapyrusTable_queries_feature = Queries
+_UI_PapyrusTable_usingUser_feature = Using User
+_UI_PapyrusTable_usingContextFeature_feature = Using Context Feature
+_UI_PapyrusTable_usingQueries_feature = Using Queries
+_UI_Unknown_feature = Unspecified
+
+_UI_FillingMode_User_literal = USER
+_UI_FillingMode_Queries_literal = QUERIES
+_UI_FillingMode_ContextFeature_literal = CONTEXT_FEATURE
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/plugin.xml b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/plugin.xml new file mode 100644 index 00000000000..87fc115bb99 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/plugin.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+ 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
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
+ <factory
+ uri="http://www.eclipse.org/Papyrus/PapyrusTable/0.9.0/papyrustable"
+ class="org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.provider.PapyrustableItemProviderAdapterFactory"
+ supportedTypes=
+ "org.eclipse.emf.edit.provider.IEditingDomainItemProvider
+ org.eclipse.emf.edit.provider.IStructuredItemContentProvider
+ org.eclipse.emf.edit.provider.ITreeItemContentProvider
+ org.eclipse.emf.edit.provider.IItemLabelProvider
+ org.eclipse.emf.edit.provider.IItemPropertySource"/>
+ </extension>
+
+</plugin>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/provider/PapyrusTableItemProvider.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/provider/PapyrusTableItemProvider.java new file mode 100644 index 00000000000..a69f3281a94 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/provider/PapyrusTableItemProvider.java @@ -0,0 +1,358 @@ +/**
+ * 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.efacet.metamodel.papyrustable.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.provider.EModelElementItemProvider;
+
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustablePackage;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PapyrusTableItemProvider
+ extends EModelElementItemProvider
+ implements
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrusTableItemProvider(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
+ if (itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addNamePropertyDescriptor(object);
+ addTypePropertyDescriptor(object);
+ addTablePropertyDescriptor(object);
+ addFillingModePropertyDescriptor(object);
+ addFeaturePropertyDescriptor(object);
+ addQueriesPropertyDescriptor(object);
+ addUsingUserPropertyDescriptor(object);
+ addUsingContextFeaturePropertyDescriptor(object);
+ addUsingQueriesPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Name feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusTable_name_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusTable_name_feature", "_UI_PapyrusTable_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ PapyrustablePackage.Literals.PAPYRUS_TABLE__NAME,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Type feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addTypePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusTable_type_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusTable_type_feature", "_UI_PapyrusTable_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ PapyrustablePackage.Literals.PAPYRUS_TABLE__TYPE,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Table feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addTablePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusTable_table_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusTable_table_feature", "_UI_PapyrusTable_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ PapyrustablePackage.Literals.PAPYRUS_TABLE__TABLE,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Filling Mode feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addFillingModePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusTable_fillingMode_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusTable_fillingMode_feature", "_UI_PapyrusTable_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ PapyrustablePackage.Literals.PAPYRUS_TABLE__FILLING_MODE,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Feature feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addFeaturePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusTable_feature_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusTable_feature_feature", "_UI_PapyrusTable_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ PapyrustablePackage.Literals.PAPYRUS_TABLE__FEATURE,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Queries feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addQueriesPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusTable_queries_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusTable_queries_feature", "_UI_PapyrusTable_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ PapyrustablePackage.Literals.PAPYRUS_TABLE__QUERIES,
+ true,
+ false,
+ true,
+ null,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Using User feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addUsingUserPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusTable_usingUser_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusTable_usingUser_feature", "_UI_PapyrusTable_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ PapyrustablePackage.Literals.PAPYRUS_TABLE__USING_USER,
+ false,
+ false,
+ false,
+ ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Using Context Feature feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addUsingContextFeaturePropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusTable_usingContextFeature_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusTable_usingContextFeature_feature", "_UI_PapyrusTable_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ PapyrustablePackage.Literals.PAPYRUS_TABLE__USING_CONTEXT_FEATURE,
+ false,
+ false,
+ false,
+ ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Using Queries feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addUsingQueriesPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusTable_usingQueries_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusTable_usingQueries_feature", "_UI_PapyrusTable_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ PapyrustablePackage.Literals.PAPYRUS_TABLE__USING_QUERIES,
+ false,
+ false,
+ false,
+ ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This returns PapyrusTable.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/PapyrusTable")); //$NON-NLS-1$
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String getText(Object object) {
+ String label = ((PapyrusTable)object).getName();
+ return label == null || label.length() == 0 ?
+ getString("_UI_PapyrusTable_type") : //$NON-NLS-1$
+ getString("_UI_PapyrusTable_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(PapyrusTable.class)) {
+ case PapyrustablePackage.PAPYRUS_TABLE__NAME:
+ case PapyrustablePackage.PAPYRUS_TABLE__TYPE:
+ case PapyrustablePackage.PAPYRUS_TABLE__FILLING_MODE:
+ case PapyrustablePackage.PAPYRUS_TABLE__USING_USER:
+ case PapyrustablePackage.PAPYRUS_TABLE__USING_CONTEXT_FEATURE:
+ case PapyrustablePackage.PAPYRUS_TABLE__USING_QUERIES:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PapyrustableEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/provider/PapyrustableEditPlugin.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/provider/PapyrustableEditPlugin.java new file mode 100644 index 00000000000..b0aa5a1700b --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/provider/PapyrustableEditPlugin.java @@ -0,0 +1,116 @@ +/**
+ * 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.efacet.metamodel.papyrustable.provider;
+
+import org.eclipse.emf.common.EMFPlugin;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.provider.EcoreEditPlugin;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.provider.CustomEditPlugin;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.provider.Efacet2EditPlugin;
+import org.eclipse.emf.facet.widgets.celleditors.edit.CelleditorsEditPlugin;
+
+//import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.provider.Tableinstance02EditPlugin;
+//
+//import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.tableconfiguration.provider.TableConfigurationEditPlugin;
+
+/**
+ * This is the central singleton for the Papyrustable edit plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public final class PapyrustableEditPlugin extends EMFPlugin {
+
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final PapyrustableEditPlugin INSTANCE = new PapyrustableEditPlugin();
+
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static Implementation plugin;
+
+ /**
+ * Create the instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ public PapyrustableEditPlugin() {
+ super(new ResourceLocator[]{ CelleditorsEditPlugin.INSTANCE, CustomEditPlugin.INSTANCE, EcoreEditPlugin.INSTANCE, Efacet2EditPlugin.INSTANCE,/*
+ * TableConfigurationEditPlugin
+ * .
+ * INSTANCE
+ * ,
+ * Tableinstance02EditPlugin
+ * .
+ * INSTANCE
+ * ,
+ */});
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ @Override
+ public ResourceLocator getPluginResourceLocator() {
+ return plugin;
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the singleton instance.
+ * @generated
+ */
+ public static Implementation getPlugin() {
+ return plugin;
+ }
+
+ /**
+ * The actual implementation of the Eclipse <b>Plugin</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static class Implementation extends EclipsePlugin {
+
+ /**
+ * Creates an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Implementation() {
+ super();
+
+ // Remember the static instance.
+ //
+ plugin = this;
+ }
+ }
+
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/provider/PapyrustableItemProviderAdapterFactory.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/provider/PapyrustableItemProviderAdapterFactory.java new file mode 100644 index 00000000000..777ea5ef2c7 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/provider/PapyrustableItemProviderAdapterFactory.java @@ -0,0 +1,209 @@ +/**
+ * 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.efacet.metamodel.papyrustable.provider;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.edit.provider.ChangeNotifier;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IChangeNotifier;
+import org.eclipse.emf.edit.provider.IDisposable;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.util.PapyrustableAdapterFactory;
+
+/**
+ * This is the factory that is used to provide the interfaces needed to support Viewers.
+ * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}.
+ * The adapters also support Eclipse property sheets.
+ * Note that most of the adapters are shared among multiple instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PapyrustableItemProviderAdapterFactory extends PapyrustableAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable {
+ /**
+ * This keeps track of the root adapter factory that delegates to this adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ComposedAdapterFactory parentAdapterFactory;
+
+ /**
+ * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IChangeNotifier changeNotifier = new ChangeNotifier();
+
+ /**
+ * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Object> supportedTypes = new ArrayList<Object>();
+
+ /**
+ * This constructs an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrustableItemProviderAdapterFactory() {
+ supportedTypes.add(IEditingDomainItemProvider.class);
+ supportedTypes.add(IStructuredItemContentProvider.class);
+ supportedTypes.add(ITreeItemContentProvider.class);
+ supportedTypes.add(IItemLabelProvider.class);
+ supportedTypes.add(IItemPropertySource.class);
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrusTableItemProvider papyrusTableItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createPapyrusTableAdapter() {
+ if (papyrusTableItemProvider == null) {
+ papyrusTableItemProvider = new PapyrusTableItemProvider(this);
+ }
+
+ return papyrusTableItemProvider;
+ }
+
+ /**
+ * This returns the root adapter factory that contains this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ComposeableAdapterFactory getRootAdapterFactory() {
+ return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory();
+ }
+
+ /**
+ * This sets the composed adapter factory that contains this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) {
+ this.parentAdapterFactory = parentAdapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object type) {
+ return supportedTypes.contains(type) || super.isFactoryForType(type);
+ }
+
+ /**
+ * This implementation substitutes the factory itself as the key for the adapter.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter adapt(Notifier notifier, Object type) {
+ return super.adapt(notifier, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object adapt(Object object, Object type) {
+ if (isFactoryForType(type)) {
+ Object adapter = super.adapt(object, type);
+ if (!(type instanceof Class<?>) || (((Class<?>)type).isInstance(adapter))) {
+ return adapter;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * This adds a listener.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void addListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.addListener(notifyChangedListener);
+ }
+
+ /**
+ * This removes a listener.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void removeListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.removeListener(notifyChangedListener);
+ }
+
+ /**
+ * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void fireNotifyChanged(Notification notification) {
+ changeNotifier.fireNotifyChanged(notification);
+
+ if (parentAdapterFactory != null) {
+ parentAdapterFactory.fireNotifyChanged(notification);
+ }
+ }
+
+ /**
+ * This disposes all of the item providers created by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void dispose() {
+ if (papyrusTableItemProvider != null) papyrusTableItemProvider.dispose();
+ }
+
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/.classpath b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/.classpath new file mode 100644 index 00000000000..cedf0d0d0b5 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src-gen"/>
+ <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/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/.project b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/.project new file mode 100644 index 00000000000..a30af94362b --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.table.efacet.metamodel</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/META-INF/MANIFEST.MF b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..41dbb6282df --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/META-INF/MANIFEST.MF @@ -0,0 +1,19 @@ +Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.infra.table.efacet.metamodel;singleton:=true
+Bundle-Version: 0.9.0.qualifier
+Bundle-ClassPath: .
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable,
+ org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.impl,
+ org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.util
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.ecore;visibility:=reexport,
+ org.eclipse.emf.facet.widgets.celleditors;visibility:=reexport,
+ org.eclipse.emf.facet.custom.metamodel;visibility:=reexport,
+ org.eclipse.emf.facet.efacet.metamodel;visibility:=reexport,
+ org.eclipse.emf.facet.widgets.table.metamodel;visibility:=reexport
+Bundle-ActivationPolicy: lazy
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/build.properties b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/build.properties new file mode 100644 index 00000000000..645a1ebce90 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/build.properties @@ -0,0 +1,19 @@ +# 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
+#
+
+bin.includes = .,\
+ model/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties
+jars.compile.order = .
+source.. = src-gen/
+output.. = bin/
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/model/papyrustable.ecore b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/model/papyrustable.ecore new file mode 100644 index 00000000000..1159da5e508 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/model/papyrustable.ecore @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="papyrustable" nsURI="http://www.eclipse.org/Papyrus/PapyrusTable/0.9.0/papyrustable"
+ nsPrefix="papyrustable">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="This package contains the model used to store the Papyrus Table."/>
+ </eAnnotations>
+ <eClassifiers xsi:type="ecore:EClass" name="PapyrusTable" eSuperTypes="../../org.eclipse.emf.ecore/model/Ecore.ecore#//EModelElement">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="This element represents the tables used in Papyrus."/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="This field allows to store a name for the Papyrus Table."/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="This field allows to store the type of the Papyrus Table. It is used to know how 
to open it in the papyrus sasheditor."/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="table" eType="ecore:EClass ../../org.eclipse.emf.facet.widgets.table.metamodel/model/table-0.2.0.ecore#//Table"
+ containment="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="This field reference the EMF-Facet table that we use for the papyrus Table.
We choose to reference it (and not to do an inheritance) in order to be sure
to respect their API."/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="fillingMode" eType="#//FillingMode">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="This attribute allows to store how the table should be filled."/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="feature" eType="ecore:EClass ../../org.eclipse.emf.ecore/model/Ecore.ecore#//EStructuralFeature">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="This field references the EStructuralFeature to listen when the table is in Feature Mode."/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="queries" upperBound="-1"
+ eType="ecore:EClass ../../org.eclipse.emf.facet.efacet.metamodel/model/efacet-0.2.0.ecore#//extensible/Query">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="This field references the queries used to fill table when the table is in queries mode."/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="usingUser" ordered="false"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" changeable="false"
+ volatile="true" transient="true" derived="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="This attribute is true when fillingMode==User."/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="usingContextFeature" ordered="false"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" changeable="false"
+ volatile="true" transient="true" derived="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="This attribute is true when fillingMode==Feature."/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="usingQueries" ordered="false"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" changeable="false"
+ volatile="true" derived="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="This attribute is true when fillingMode==Queries."/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EEnum" name="FillingMode">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="This enumeration provides literals representing the ways to fill the table."/>
+ </eAnnotations>
+ <eLiterals name="User" literal="USER">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="This user drops the elements to fill the table."/>
+ </eAnnotations>
+ </eLiterals>
+ <eLiterals name="Queries" value="1" literal="QUERIES">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="We use queries to fill the table."/>
+ </eAnnotations>
+ </eLiterals>
+ <eLiterals name="ContextFeature" value="2" literal="CONTEXT_FEATURE">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="We listen a feature of the context of the table to fill it."/>
+ </eAnnotations>
+ </eLiterals>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/model/papyrustable.genmodel b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/model/papyrustable.genmodel new file mode 100644 index 00000000000..c7baf47b598 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/model/papyrustable.genmodel @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="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"
+ modelDirectory="/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen" editDirectory="/org.eclipse.papyrus.infra.table.efacet.metamodel.edit/src-gen"
+ editorDirectory="/org.eclipse.papyrus.infra.table.efacet.metamodel.editor/src-gen"
+ modelPluginID="org.eclipse.papyrus.infra.table.efacet.metamodel" modelName="Papyrustable"
+ editPluginClass="org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.provider.PapyrustableEditPlugin"
+ editorPluginClass="org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.presentation.PapyrustableEditorPlugin"
+ nonNLSMarkers="true" testSuiteClass="org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.tests.PapyrustableAllTests"
+ importerID="org.eclipse.emf.importer.ecore" complianceLevel="5.0" copyrightFields="false"
+ editPluginID="org.eclipse.papyrus.infra.table.efacet.metamodel.edit" editorPluginID="org.eclipse.papyrus.infra.table.efacet.metamodel.editor"
+ usedGenPackages="platform:/plugin/org.eclipse.emf.facet.widgets.celleditors/model/celleditors.genmodel#//modelCellEditor platform:/plugin/org.eclipse.emf.facet.custom.metamodel/model/custom-0.2.0.genmodel#//custom platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore platform:/plugin/org.eclipse.emf.facet.efacet.metamodel/model/efacet-0.2.0.genmodel#//efacet platform:/plugin/org.eclipse.emf.facet.widgets.table.metamodel/model/tableConfiguration-0.2.0.genmodel#//tableconfiguration platform:/plugin/org.eclipse.emf.facet.widgets.table.metamodel/model/table-0.2.0.genmodel#//table">
+ <foreignModel>papyrustable.ecore</foreignModel>
+ <genPackages prefix="Papyrustable" basePackage="org.eclipse.papyrus.infra.table.efacet.metamodel"
+ disposableProviderFactory="true" ecorePackage="papyrustable.ecore#/">
+ <genEnums typeSafeEnumCompatible="false" ecoreEnum="papyrustable.ecore#//FillingMode">
+ <genEnumLiterals ecoreEnumLiteral="papyrustable.ecore#//FillingMode/User"/>
+ <genEnumLiterals ecoreEnumLiteral="papyrustable.ecore#//FillingMode/Queries"/>
+ <genEnumLiterals ecoreEnumLiteral="papyrustable.ecore#//FillingMode/ContextFeature"/>
+ </genEnums>
+ <genClasses ecoreClass="papyrustable.ecore#//PapyrusTable" labelFeature="#//papyrustable/PapyrusTable/name">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute papyrustable.ecore#//PapyrusTable/name"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute papyrustable.ecore#//PapyrusTable/type"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference papyrustable.ecore#//PapyrusTable/table"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute papyrustable.ecore#//PapyrusTable/fillingMode"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference papyrustable.ecore#//PapyrusTable/feature"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference papyrustable.ecore#//PapyrusTable/queries"/>
+ <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute papyrustable.ecore#//PapyrusTable/usingUser"/>
+ <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute papyrustable.ecore#//PapyrusTable/usingContextFeature"/>
+ <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute papyrustable.ecore#//PapyrusTable/usingQueries"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/plugin.properties b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/plugin.properties new file mode 100644 index 00000000000..4d7a0bc0a1a --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/plugin.properties @@ -0,0 +1,13 @@ +# 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
+#
+
+pluginName = Papyrustableinstance2 Model
+providerName = www.example.org
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/plugin.xml b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/plugin.xml new file mode 100644 index 00000000000..1051ba704ec --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/plugin.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+ 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
+
+-->
+
+<plugin>
+ <extension
+ point="org.eclipse.emf.ecore.generated_package">
+ <package
+ class="org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.impl.PapyrustablePackageImpl"
+ genModel="model/papyrustable.genmodel"
+ uri="http://www.eclipse.org/Papyrus/PapyrusTable/0.9.0/papyrustable">
+ </package>
+ </extension>
+
+
+
+</plugin>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/FillingMode.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/FillingMode.java new file mode 100644 index 00000000000..3272be3c96b --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/FillingMode.java @@ -0,0 +1,245 @@ +/**
+ * 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.efacet.metamodel.papyrustable;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.common.util.Enumerator;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the literals of the enumeration '<em><b>Filling Mode</b></em>',
+ * and utility methods for working with them.
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * This enumeration provides literals representing the ways to fill the table.
+ * <!-- end-model-doc -->
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustablePackage#getFillingMode()
+ * @model
+ * @generated
+ */
+public enum FillingMode implements Enumerator {
+ /**
+ * The '<em><b>User</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #USER_VALUE
+ * @generated
+ * @ordered
+ */
+ USER(0, "User", "USER"), //$NON-NLS-1$ //$NON-NLS-2$
+
+ /**
+ * The '<em><b>Queries</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #QUERIES_VALUE
+ * @generated
+ * @ordered
+ */
+ QUERIES(1, "Queries", "QUERIES"), //$NON-NLS-1$ //$NON-NLS-2$
+
+ /**
+ * The '<em><b>Context Feature</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #CONTEXT_FEATURE_VALUE
+ * @generated
+ * @ordered
+ */
+ CONTEXT_FEATURE(2, "ContextFeature", "CONTEXT_FEATURE"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ /**
+ * The '<em><b>User</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * This user drops the elements to fill the table.
+ * <!-- end-model-doc -->
+ * @see #USER
+ * @model name="User" literal="USER"
+ * @generated
+ * @ordered
+ */
+ public static final int USER_VALUE = 0;
+
+ /**
+ * The '<em><b>Queries</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * We use queries to fill the table.
+ * <!-- end-model-doc -->
+ * @see #QUERIES
+ * @model name="Queries" literal="QUERIES"
+ * @generated
+ * @ordered
+ */
+ public static final int QUERIES_VALUE = 1;
+
+ /**
+ * The '<em><b>Context Feature</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * We listen a feature of the context of the table to fill it.
+ * <!-- end-model-doc -->
+ * @see #CONTEXT_FEATURE
+ * @model name="ContextFeature" literal="CONTEXT_FEATURE"
+ * @generated
+ * @ordered
+ */
+ public static final int CONTEXT_FEATURE_VALUE = 2;
+
+ /**
+ * An array of all the '<em><b>Filling Mode</b></em>' enumerators.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static final FillingMode[] VALUES_ARRAY =
+ new FillingMode[] {
+ USER,
+ QUERIES,
+ CONTEXT_FEATURE,
+ };
+
+ /**
+ * A public read-only list of all the '<em><b>Filling Mode</b></em>' enumerators.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final List<FillingMode> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
+
+ /**
+ * Returns the '<em><b>Filling Mode</b></em>' literal with the specified literal value.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static FillingMode get(String literal) {
+ for (int i = 0; i < VALUES_ARRAY.length; ++i) {
+ FillingMode result = VALUES_ARRAY[i];
+ if (result.toString().equals(literal)) {
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the '<em><b>Filling Mode</b></em>' literal with the specified name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static FillingMode getByName(String name) {
+ for (int i = 0; i < VALUES_ARRAY.length; ++i) {
+ FillingMode result = VALUES_ARRAY[i];
+ if (result.getName().equals(name)) {
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the '<em><b>Filling Mode</b></em>' literal with the specified integer value.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static FillingMode get(int value) {
+ switch (value) {
+ case USER_VALUE: return USER;
+ case QUERIES_VALUE: return QUERIES;
+ case CONTEXT_FEATURE_VALUE: return CONTEXT_FEATURE;
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private final int value;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private final String name;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private final String literal;
+
+ /**
+ * Only this class can construct instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private FillingMode(int value, String name, String literal) {
+ this.value = value;
+ this.name = name;
+ this.literal = literal;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public int getValue() {
+ return value;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getLiteral() {
+ return literal;
+ }
+
+ /**
+ * Returns the literal value of the enumerator, which is its string representation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ return literal;
+ }
+
+} //FillingMode
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/PapyrusTable.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/PapyrusTable.java new file mode 100644 index 00000000000..aa6ceef0a7d --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/PapyrusTable.java @@ -0,0 +1,241 @@ +/**
+ * 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.efacet.metamodel.papyrustable;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+
+import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.Table;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Papyrus Table</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc -->
+ * This element represents the tables used in Papyrus.
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getType <em>Type</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getTable <em>Table</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getFillingMode <em>Filling Mode</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getFeature <em>Feature</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getQueries <em>Queries</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#isUsingUser <em>Using User</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#isUsingContextFeature <em>Using Context Feature</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#isUsingQueries <em>Using Queries</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustablePackage#getPapyrusTable()
+ * @model
+ * @generated
+ */
+public interface PapyrusTable extends EModelElement {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * This field allows to store a name for the Papyrus Table.
+ * <!-- end-model-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustablePackage#getPapyrusTable_Name()
+ * @model
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the '<em><b>Type</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * This field allows to store the type of the Papyrus Table. It is used to know how
+ * to open it in the papyrus sasheditor.
+ * <!-- end-model-doc -->
+ * @return the value of the '<em>Type</em>' attribute.
+ * @see #setType(String)
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustablePackage#getPapyrusTable_Type()
+ * @model
+ * @generated
+ */
+ String getType();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getType <em>Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Type</em>' attribute.
+ * @see #getType()
+ * @generated
+ */
+ void setType(String value);
+
+ /**
+ * Returns the value of the '<em><b>Table</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * This field reference the EMF-Facet table that we use for the papyrus Table.
+ * We choose to reference it (and not to do an inheritance) in order to be sure
+ * to respect their API.
+ * <!-- end-model-doc -->
+ * @return the value of the '<em>Table</em>' containment reference.
+ * @see #setTable(Table)
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustablePackage#getPapyrusTable_Table()
+ * @model containment="true"
+ * @generated
+ */
+ Table getTable();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getTable <em>Table</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Table</em>' containment reference.
+ * @see #getTable()
+ * @generated
+ */
+ void setTable(Table value);
+
+ /**
+ * Returns the value of the '<em><b>Filling Mode</b></em>' attribute.
+ * The literals are from the enumeration {@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.FillingMode}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * This attribute allows to store how the table should be filled.
+ * <!-- end-model-doc -->
+ * @return the value of the '<em>Filling Mode</em>' attribute.
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.FillingMode
+ * @see #setFillingMode(FillingMode)
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustablePackage#getPapyrusTable_FillingMode()
+ * @model
+ * @generated
+ */
+ FillingMode getFillingMode();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getFillingMode <em>Filling Mode</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Filling Mode</em>' attribute.
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.FillingMode
+ * @see #getFillingMode()
+ * @generated
+ */
+ void setFillingMode(FillingMode value);
+
+ /**
+ * Returns the value of the '<em><b>Feature</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * This field references the EStructuralFeature to listen when the table is in Feature Mode.
+ * <!-- end-model-doc -->
+ * @return the value of the '<em>Feature</em>' reference.
+ * @see #setFeature(EStructuralFeature)
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustablePackage#getPapyrusTable_Feature()
+ * @model
+ * @generated
+ */
+ EStructuralFeature getFeature();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getFeature <em>Feature</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Feature</em>' reference.
+ * @see #getFeature()
+ * @generated
+ */
+ void setFeature(EStructuralFeature value);
+
+ /**
+ * Returns the value of the '<em><b>Queries</b></em>' reference list.
+ * The list contents are of type {@link org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * This field references the queries used to fill table when the table is in queries mode.
+ * <!-- end-model-doc -->
+ * @return the value of the '<em>Queries</em>' reference list.
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustablePackage#getPapyrusTable_Queries()
+ * @model
+ * @generated
+ */
+ EList<Query> getQueries();
+
+ /**
+ * Returns the value of the '<em><b>Using User</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * This attribute is true when fillingMode==User.
+ * <!-- end-model-doc -->
+ * @return the value of the '<em>Using User</em>' attribute.
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustablePackage#getPapyrusTable_UsingUser()
+ * @model transient="true" changeable="false" volatile="true" derived="true" ordered="false"
+ * @generated
+ */
+ boolean isUsingUser();
+
+ /**
+ * Returns the value of the '<em><b>Using Context Feature</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * This attribute is true when fillingMode==Feature.
+ * <!-- end-model-doc -->
+ * @return the value of the '<em>Using Context Feature</em>' attribute.
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustablePackage#getPapyrusTable_UsingContextFeature()
+ * @model transient="true" changeable="false" volatile="true" derived="true" ordered="false"
+ * @generated
+ */
+ boolean isUsingContextFeature();
+
+ /**
+ * Returns the value of the '<em><b>Using Queries</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * This attribute is true when fillingMode==Queries.
+ * <!-- end-model-doc -->
+ * @return the value of the '<em>Using Queries</em>' attribute.
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustablePackage#getPapyrusTable_UsingQueries()
+ * @model changeable="false" volatile="true" derived="true" ordered="false"
+ * @generated
+ */
+ boolean isUsingQueries();
+
+} // PapyrusTable
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/PapyrustableFactory.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/PapyrustableFactory.java new file mode 100644 index 00000000000..fe05e7f7a47 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/PapyrustableFactory.java @@ -0,0 +1,52 @@ +/**
+ * 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.efacet.metamodel.papyrustable;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustablePackage
+ * @generated
+ */
+public interface PapyrustableFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ PapyrustableFactory eINSTANCE = org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.impl.PapyrustableFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Papyrus Table</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Papyrus Table</em>'.
+ * @generated
+ */
+ PapyrusTable createPapyrusTable();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ PapyrustablePackage getPapyrustablePackage();
+
+} //PapyrustableFactory
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/PapyrustablePackage.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/PapyrustablePackage.java new file mode 100644 index 00000000000..600dd4dccf5 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/PapyrustablePackage.java @@ -0,0 +1,428 @@ +/**
+ * 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.efacet.metamodel.papyrustable;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EcorePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * This package contains the model used to store the Papyrus Table.
+ * <!-- end-model-doc -->
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustableFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface PapyrustablePackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "papyrustable"; //$NON-NLS-1$
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.eclipse.org/Papyrus/PapyrusTable/0.9.0/papyrustable"; //$NON-NLS-1$
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "papyrustable"; //$NON-NLS-1$
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ PapyrustablePackage eINSTANCE = org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.impl.PapyrustablePackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.impl.PapyrusTableImpl <em>Papyrus Table</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.impl.PapyrusTableImpl
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.impl.PapyrustablePackageImpl#getPapyrusTable()
+ * @generated
+ */
+ int PAPYRUS_TABLE = 0;
+
+ /**
+ * The feature id for the '<em><b>EAnnotations</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE__EANNOTATIONS = EcorePackage.EMODEL_ELEMENT__EANNOTATIONS;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE__NAME = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Type</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE__TYPE = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Table</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE__TABLE = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 2;
+
+ /**
+ * The feature id for the '<em><b>Filling Mode</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE__FILLING_MODE = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 3;
+
+ /**
+ * The feature id for the '<em><b>Feature</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE__FEATURE = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 4;
+
+ /**
+ * The feature id for the '<em><b>Queries</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE__QUERIES = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 5;
+
+ /**
+ * The feature id for the '<em><b>Using User</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE__USING_USER = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 6;
+
+ /**
+ * The feature id for the '<em><b>Using Context Feature</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE__USING_CONTEXT_FEATURE = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 7;
+
+ /**
+ * The feature id for the '<em><b>Using Queries</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE__USING_QUERIES = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 8;
+
+ /**
+ * The number of structural features of the '<em>Papyrus Table</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE_FEATURE_COUNT = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 9;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.FillingMode <em>Filling Mode</em>}' enum.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.FillingMode
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.impl.PapyrustablePackageImpl#getFillingMode()
+ * @generated
+ */
+ int FILLING_MODE = 1;
+
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable <em>Papyrus Table</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Papyrus Table</em>'.
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable
+ * @generated
+ */
+ EClass getPapyrusTable();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getName()
+ * @see #getPapyrusTable()
+ * @generated
+ */
+ EAttribute getPapyrusTable_Name();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getType <em>Type</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Type</em>'.
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getType()
+ * @see #getPapyrusTable()
+ * @generated
+ */
+ EAttribute getPapyrusTable_Type();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getTable <em>Table</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Table</em>'.
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getTable()
+ * @see #getPapyrusTable()
+ * @generated
+ */
+ EReference getPapyrusTable_Table();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getFillingMode <em>Filling Mode</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Filling Mode</em>'.
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getFillingMode()
+ * @see #getPapyrusTable()
+ * @generated
+ */
+ EAttribute getPapyrusTable_FillingMode();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getFeature <em>Feature</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Feature</em>'.
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getFeature()
+ * @see #getPapyrusTable()
+ * @generated
+ */
+ EReference getPapyrusTable_Feature();
+
+ /**
+ * Returns the meta object for the reference list '{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getQueries <em>Queries</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Queries</em>'.
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#getQueries()
+ * @see #getPapyrusTable()
+ * @generated
+ */
+ EReference getPapyrusTable_Queries();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#isUsingUser <em>Using User</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Using User</em>'.
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#isUsingUser()
+ * @see #getPapyrusTable()
+ * @generated
+ */
+ EAttribute getPapyrusTable_UsingUser();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#isUsingContextFeature <em>Using Context Feature</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Using Context Feature</em>'.
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#isUsingContextFeature()
+ * @see #getPapyrusTable()
+ * @generated
+ */
+ EAttribute getPapyrusTable_UsingContextFeature();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#isUsingQueries <em>Using Queries</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Using Queries</em>'.
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable#isUsingQueries()
+ * @see #getPapyrusTable()
+ * @generated
+ */
+ EAttribute getPapyrusTable_UsingQueries();
+
+ /**
+ * Returns the meta object for enum '{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.FillingMode <em>Filling Mode</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for enum '<em>Filling Mode</em>'.
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.FillingMode
+ * @generated
+ */
+ EEnum getFillingMode();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ PapyrustableFactory getPapyrustableFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.impl.PapyrusTableImpl <em>Papyrus Table</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.impl.PapyrusTableImpl
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.impl.PapyrustablePackageImpl#getPapyrusTable()
+ * @generated
+ */
+ EClass PAPYRUS_TABLE = eINSTANCE.getPapyrusTable();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PAPYRUS_TABLE__NAME = eINSTANCE.getPapyrusTable_Name();
+
+ /**
+ * The meta object literal for the '<em><b>Type</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PAPYRUS_TABLE__TYPE = eINSTANCE.getPapyrusTable_Type();
+
+ /**
+ * The meta object literal for the '<em><b>Table</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PAPYRUS_TABLE__TABLE = eINSTANCE.getPapyrusTable_Table();
+
+ /**
+ * The meta object literal for the '<em><b>Filling Mode</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PAPYRUS_TABLE__FILLING_MODE = eINSTANCE.getPapyrusTable_FillingMode();
+
+ /**
+ * The meta object literal for the '<em><b>Feature</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PAPYRUS_TABLE__FEATURE = eINSTANCE.getPapyrusTable_Feature();
+
+ /**
+ * The meta object literal for the '<em><b>Queries</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PAPYRUS_TABLE__QUERIES = eINSTANCE.getPapyrusTable_Queries();
+
+ /**
+ * The meta object literal for the '<em><b>Using User</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PAPYRUS_TABLE__USING_USER = eINSTANCE.getPapyrusTable_UsingUser();
+
+ /**
+ * The meta object literal for the '<em><b>Using Context Feature</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PAPYRUS_TABLE__USING_CONTEXT_FEATURE = eINSTANCE.getPapyrusTable_UsingContextFeature();
+
+ /**
+ * The meta object literal for the '<em><b>Using Queries</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PAPYRUS_TABLE__USING_QUERIES = eINSTANCE.getPapyrusTable_UsingQueries();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.FillingMode <em>Filling Mode</em>}' enum.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.FillingMode
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.impl.PapyrustablePackageImpl#getFillingMode()
+ * @generated
+ */
+ EEnum FILLING_MODE = eINSTANCE.getFillingMode();
+
+ }
+
+} //PapyrustablePackage
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/impl/PapyrusTableImpl.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/impl/PapyrusTableImpl.java new file mode 100644 index 00000000000..1642535b4b5 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/impl/PapyrusTableImpl.java @@ -0,0 +1,594 @@ +/**
+ * 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.efacet.metamodel.papyrustable.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.impl.EModelElementImpl;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.util.EObjectResolvingEList;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.Table;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.FillingMode;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustablePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Papyrus Table</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.impl.PapyrusTableImpl#getName <em>Name</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.impl.PapyrusTableImpl#getType <em>Type</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.impl.PapyrusTableImpl#getTable <em>Table</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.impl.PapyrusTableImpl#getFillingMode <em>Filling Mode</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.impl.PapyrusTableImpl#getFeature <em>Feature</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.impl.PapyrusTableImpl#getQueries <em>Queries</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.impl.PapyrusTableImpl#isUsingUser <em>Using User</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.impl.PapyrusTableImpl#isUsingContextFeature <em>Using Context Feature
+ * </em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.impl.PapyrusTableImpl#isUsingQueries <em>Using Queries</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class PapyrusTableImpl extends EModelElementImpl implements PapyrusTable {
+
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getType() <em>Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getType()
+ * @generated
+ * @ordered
+ */
+ protected static final String TYPE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getType()
+ * @generated
+ * @ordered
+ */
+ protected String type = TYPE_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getTable() <em>Table</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getTable()
+ * @generated
+ * @ordered
+ */
+ protected Table table;
+
+ /**
+ * The default value of the '{@link #getFillingMode() <em>Filling Mode</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getFillingMode()
+ * @generated
+ * @ordered
+ */
+ protected static final FillingMode FILLING_MODE_EDEFAULT = FillingMode.USER;
+
+ /**
+ * The cached value of the '{@link #getFillingMode() <em>Filling Mode</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getFillingMode()
+ * @generated
+ * @ordered
+ */
+ protected FillingMode fillingMode = FILLING_MODE_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getFeature() <em>Feature</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getFeature()
+ * @generated
+ * @ordered
+ */
+ protected EStructuralFeature feature;
+
+ /**
+ * The cached value of the '{@link #getQueries() <em>Queries</em>}' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #getQueries()
+ * @generated
+ * @ordered
+ */
+ protected EList<Query> queries;
+
+ /**
+ * The default value of the '{@link #isUsingUser() <em>Using User</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #isUsingUser()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean USING_USER_EDEFAULT = false;
+
+ /**
+ * The default value of the '{@link #isUsingContextFeature() <em>Using Context Feature</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #isUsingContextFeature()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean USING_CONTEXT_FEATURE_EDEFAULT = false;
+
+ /**
+ * The default value of the '{@link #isUsingQueries() <em>Using Queries</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @see #isUsingQueries()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean USING_QUERIES_EDEFAULT = false;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected PapyrusTableImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PapyrustablePackage.Literals.PAPYRUS_TABLE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setName(final String newName) {
+ final String oldName = this.name;
+ this.name = newName;
+ if(eNotificationRequired()) {
+ eNotify(new ENotificationImpl(this, Notification.SET, PapyrustablePackage.PAPYRUS_TABLE__NAME, oldName, this.name));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getType() {
+ return this.type;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setType(final String newType) {
+ final String oldType = this.type;
+ this.type = newType;
+ if(eNotificationRequired()) {
+ eNotify(new ENotificationImpl(this, Notification.SET, PapyrustablePackage.PAPYRUS_TABLE__TYPE, oldType, this.type));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Table getTable() {
+ return this.table;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public NotificationChain basicSetTable(final Table newTable, NotificationChain msgs) {
+ final Table oldTable = this.table;
+ this.table = newTable;
+ if(eNotificationRequired()) {
+ final ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PapyrustablePackage.PAPYRUS_TABLE__TABLE, oldTable, newTable);
+ if(msgs == null) {
+ msgs = notification;
+ } else {
+ msgs.add(notification);
+ }
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setTable(final Table newTable) {
+ if(newTable != this.table) {
+ NotificationChain msgs = null;
+ if(this.table != null) {
+ msgs = ((InternalEObject)this.table).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PapyrustablePackage.PAPYRUS_TABLE__TABLE, null, msgs);
+ }
+ if(newTable != null) {
+ msgs = ((InternalEObject)newTable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PapyrustablePackage.PAPYRUS_TABLE__TABLE, null, msgs);
+ }
+ msgs = basicSetTable(newTable, msgs);
+ if(msgs != null) {
+ msgs.dispatch();
+ }
+ } else if(eNotificationRequired()) {
+ eNotify(new ENotificationImpl(this, Notification.SET, PapyrustablePackage.PAPYRUS_TABLE__TABLE, newTable, newTable));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public FillingMode getFillingMode() {
+ return this.fillingMode;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setFillingMode(final FillingMode newFillingMode) {
+ final FillingMode oldFillingMode = this.fillingMode;
+ this.fillingMode = newFillingMode == null ? FILLING_MODE_EDEFAULT : newFillingMode;
+ if(eNotificationRequired()) {
+ eNotify(new ENotificationImpl(this, Notification.SET, PapyrustablePackage.PAPYRUS_TABLE__FILLING_MODE, oldFillingMode, this.fillingMode));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EStructuralFeature getFeature() {
+ if(this.feature != null && this.feature.eIsProxy()) {
+ final InternalEObject oldFeature = (InternalEObject)this.feature;
+ this.feature = (EStructuralFeature)eResolveProxy(oldFeature);
+ if(this.feature != oldFeature) {
+ if(eNotificationRequired()) {
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, PapyrustablePackage.PAPYRUS_TABLE__FEATURE, oldFeature, this.feature));
+ }
+ }
+ }
+ return this.feature;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EStructuralFeature basicGetFeature() {
+ return this.feature;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setFeature(final EStructuralFeature newFeature) {
+ final EStructuralFeature oldFeature = this.feature;
+ this.feature = newFeature;
+ if(eNotificationRequired()) {
+ eNotify(new ENotificationImpl(this, Notification.SET, PapyrustablePackage.PAPYRUS_TABLE__FEATURE, oldFeature, this.feature));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EList<Query> getQueries() {
+ if(this.queries == null) {
+ this.queries = new EObjectResolvingEList<Query>(Query.class, this, PapyrustablePackage.PAPYRUS_TABLE__QUERIES);
+ }
+ return this.queries;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ public boolean isUsingUser() {
+ return true;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isUsingContextFeature() {
+ // TODO: implement this method to return the 'Using Context Feature' attribute
+ // Ensure that you remove @generated or mark it @generated NOT
+ // throw new UnsupportedOperationException();
+ return false;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isUsingQueries() {
+ // TODO: implement this method to return the 'Using Queries' attribute
+ // Ensure that you remove @generated or mark it @generated NOT
+ // throw new UnsupportedOperationException();
+ return false;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(final InternalEObject otherEnd, final int featureID, final NotificationChain msgs) {
+ switch(featureID) {
+ case PapyrustablePackage.PAPYRUS_TABLE__TABLE:
+ return basicSetTable(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object eGet(final int featureID, final boolean resolve, final boolean coreType) {
+ switch(featureID) {
+ case PapyrustablePackage.PAPYRUS_TABLE__NAME:
+ return getName();
+ case PapyrustablePackage.PAPYRUS_TABLE__TYPE:
+ return getType();
+ case PapyrustablePackage.PAPYRUS_TABLE__TABLE:
+ return getTable();
+ case PapyrustablePackage.PAPYRUS_TABLE__FILLING_MODE:
+ return getFillingMode();
+ case PapyrustablePackage.PAPYRUS_TABLE__FEATURE:
+ if(resolve) {
+ return getFeature();
+ }
+ return basicGetFeature();
+ case PapyrustablePackage.PAPYRUS_TABLE__QUERIES:
+ return getQueries();
+ case PapyrustablePackage.PAPYRUS_TABLE__USING_USER:
+ return isUsingUser();
+ case PapyrustablePackage.PAPYRUS_TABLE__USING_CONTEXT_FEATURE:
+ return isUsingContextFeature();
+ case PapyrustablePackage.PAPYRUS_TABLE__USING_QUERIES:
+ return isUsingQueries();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(final int featureID, final Object newValue) {
+ switch(featureID) {
+ case PapyrustablePackage.PAPYRUS_TABLE__NAME:
+ setName((String)newValue);
+ return;
+ case PapyrustablePackage.PAPYRUS_TABLE__TYPE:
+ setType((String)newValue);
+ return;
+ case PapyrustablePackage.PAPYRUS_TABLE__TABLE:
+ setTable((Table)newValue);
+ return;
+ case PapyrustablePackage.PAPYRUS_TABLE__FILLING_MODE:
+ setFillingMode((FillingMode)newValue);
+ return;
+ case PapyrustablePackage.PAPYRUS_TABLE__FEATURE:
+ setFeature((EStructuralFeature)newValue);
+ return;
+ case PapyrustablePackage.PAPYRUS_TABLE__QUERIES:
+ getQueries().clear();
+ getQueries().addAll((Collection<? extends Query>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void eUnset(final int featureID) {
+ switch(featureID) {
+ case PapyrustablePackage.PAPYRUS_TABLE__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case PapyrustablePackage.PAPYRUS_TABLE__TYPE:
+ setType(TYPE_EDEFAULT);
+ return;
+ case PapyrustablePackage.PAPYRUS_TABLE__TABLE:
+ setTable((Table)null);
+ return;
+ case PapyrustablePackage.PAPYRUS_TABLE__FILLING_MODE:
+ setFillingMode(FILLING_MODE_EDEFAULT);
+ return;
+ case PapyrustablePackage.PAPYRUS_TABLE__FEATURE:
+ setFeature((EStructuralFeature)null);
+ return;
+ case PapyrustablePackage.PAPYRUS_TABLE__QUERIES:
+ getQueries().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(final int featureID) {
+ switch(featureID) {
+ case PapyrustablePackage.PAPYRUS_TABLE__NAME:
+ return NAME_EDEFAULT == null ? this.name != null : !NAME_EDEFAULT.equals(this.name);
+ case PapyrustablePackage.PAPYRUS_TABLE__TYPE:
+ return TYPE_EDEFAULT == null ? this.type != null : !TYPE_EDEFAULT.equals(this.type);
+ case PapyrustablePackage.PAPYRUS_TABLE__TABLE:
+ return this.table != null;
+ case PapyrustablePackage.PAPYRUS_TABLE__FILLING_MODE:
+ return this.fillingMode != FILLING_MODE_EDEFAULT;
+ case PapyrustablePackage.PAPYRUS_TABLE__FEATURE:
+ return this.feature != null;
+ case PapyrustablePackage.PAPYRUS_TABLE__QUERIES:
+ return this.queries != null && !this.queries.isEmpty();
+ case PapyrustablePackage.PAPYRUS_TABLE__USING_USER:
+ return isUsingUser() != USING_USER_EDEFAULT;
+ case PapyrustablePackage.PAPYRUS_TABLE__USING_CONTEXT_FEATURE:
+ return isUsingContextFeature() != USING_CONTEXT_FEATURE_EDEFAULT;
+ case PapyrustablePackage.PAPYRUS_TABLE__USING_QUERIES:
+ return isUsingQueries() != USING_QUERIES_EDEFAULT;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if(eIsProxy()) {
+ return super.toString();
+ }
+
+ final StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: "); //$NON-NLS-1$
+ result.append(this.name);
+ result.append(", type: "); //$NON-NLS-1$
+ result.append(this.type);
+ result.append(", fillingMode: "); //$NON-NLS-1$
+ result.append(this.fillingMode);
+ result.append(')');
+ return result.toString();
+ }
+
+} //PapyrusTableImpl
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/impl/PapyrustableFactoryImpl.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/impl/PapyrustableFactoryImpl.java new file mode 100644 index 00000000000..cb3ae5ea018 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/impl/PapyrustableFactoryImpl.java @@ -0,0 +1,156 @@ +/**
+ * 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.efacet.metamodel.papyrustable.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PapyrustableFactoryImpl extends EFactoryImpl implements PapyrustableFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static PapyrustableFactory init() {
+ try {
+ PapyrustableFactory thePapyrustableFactory = (PapyrustableFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/Papyrus/PapyrusTable/0.9.0/papyrustable"); //$NON-NLS-1$
+ if (thePapyrustableFactory != null) {
+ return thePapyrustableFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new PapyrustableFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrustableFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case PapyrustablePackage.PAPYRUS_TABLE: return createPapyrusTable();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object createFromString(EDataType eDataType, String initialValue) {
+ switch (eDataType.getClassifierID()) {
+ case PapyrustablePackage.FILLING_MODE:
+ return createFillingModeFromString(eDataType, initialValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String convertToString(EDataType eDataType, Object instanceValue) {
+ switch (eDataType.getClassifierID()) {
+ case PapyrustablePackage.FILLING_MODE:
+ return convertFillingModeToString(eDataType, instanceValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrusTable createPapyrusTable() {
+ PapyrusTableImpl papyrusTable = new PapyrusTableImpl();
+ return papyrusTable;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public FillingMode createFillingModeFromString(EDataType eDataType, String initialValue) {
+ FillingMode result = FillingMode.get(initialValue);
+ if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ return result;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertFillingModeToString(EDataType eDataType, Object instanceValue) {
+ return instanceValue == null ? null : instanceValue.toString();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrustablePackage getPapyrustablePackage() {
+ return (PapyrustablePackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static PapyrustablePackage getPackage() {
+ return PapyrustablePackage.eINSTANCE;
+ }
+
+} //PapyrustableFactoryImpl
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/impl/PapyrustablePackageImpl.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/impl/PapyrustablePackageImpl.java new file mode 100644 index 00000000000..f49983bb14f --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/impl/PapyrustablePackageImpl.java @@ -0,0 +1,317 @@ +/**
+ * 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.efacet.metamodel.papyrustable.impl;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EcorePackage;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.ExtensiblePackage;
+
+import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.TablePackage;
+
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.FillingMode;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustableFactory;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustablePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PapyrustablePackageImpl extends EPackageImpl implements PapyrustablePackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass papyrusTableEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EEnum fillingModeEEnum = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * <p>Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustablePackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private PapyrustablePackageImpl() {
+ super(eNS_URI, PapyrustableFactory.eINSTANCE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
+ *
+ * <p>This method is used to initialize {@link PapyrustablePackage#eINSTANCE} when that field is accessed.
+ * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static PapyrustablePackage init() {
+ if (isInited) return (PapyrustablePackage)EPackage.Registry.INSTANCE.getEPackage(PapyrustablePackage.eNS_URI);
+
+ // Obtain or create and register package
+ PapyrustablePackageImpl thePapyrustablePackage = (PapyrustablePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof PapyrustablePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new PapyrustablePackageImpl());
+
+ isInited = true;
+
+ // Initialize simple dependencies
+ TablePackage.eINSTANCE.eClass();
+
+ // Create package meta-data objects
+ thePapyrustablePackage.createPackageContents();
+
+ // Initialize created meta-data
+ thePapyrustablePackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ thePapyrustablePackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(PapyrustablePackage.eNS_URI, thePapyrustablePackage);
+ return thePapyrustablePackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getPapyrusTable() {
+ return papyrusTableEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPapyrusTable_Name() {
+ return (EAttribute)papyrusTableEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPapyrusTable_Type() {
+ return (EAttribute)papyrusTableEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPapyrusTable_Table() {
+ return (EReference)papyrusTableEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPapyrusTable_FillingMode() {
+ return (EAttribute)papyrusTableEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPapyrusTable_Feature() {
+ return (EReference)papyrusTableEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPapyrusTable_Queries() {
+ return (EReference)papyrusTableEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPapyrusTable_UsingUser() {
+ return (EAttribute)papyrusTableEClass.getEStructuralFeatures().get(6);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPapyrusTable_UsingContextFeature() {
+ return (EAttribute)papyrusTableEClass.getEStructuralFeatures().get(7);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPapyrusTable_UsingQueries() {
+ return (EAttribute)papyrusTableEClass.getEStructuralFeatures().get(8);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EEnum getFillingMode() {
+ return fillingModeEEnum;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrustableFactory getPapyrustableFactory() {
+ return (PapyrustableFactory)getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createPackageContents() {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ papyrusTableEClass = createEClass(PAPYRUS_TABLE);
+ createEAttribute(papyrusTableEClass, PAPYRUS_TABLE__NAME);
+ createEAttribute(papyrusTableEClass, PAPYRUS_TABLE__TYPE);
+ createEReference(papyrusTableEClass, PAPYRUS_TABLE__TABLE);
+ createEAttribute(papyrusTableEClass, PAPYRUS_TABLE__FILLING_MODE);
+ createEReference(papyrusTableEClass, PAPYRUS_TABLE__FEATURE);
+ createEReference(papyrusTableEClass, PAPYRUS_TABLE__QUERIES);
+ createEAttribute(papyrusTableEClass, PAPYRUS_TABLE__USING_USER);
+ createEAttribute(papyrusTableEClass, PAPYRUS_TABLE__USING_CONTEXT_FEATURE);
+ createEAttribute(papyrusTableEClass, PAPYRUS_TABLE__USING_QUERIES);
+
+ // Create enums
+ fillingModeEEnum = createEEnum(FILLING_MODE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void initializePackageContents() {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Obtain other dependent packages
+ EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
+ TablePackage theTablePackage = (TablePackage)EPackage.Registry.INSTANCE.getEPackage(TablePackage.eNS_URI);
+ ExtensiblePackage theExtensiblePackage = (ExtensiblePackage)EPackage.Registry.INSTANCE.getEPackage(ExtensiblePackage.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+ papyrusTableEClass.getESuperTypes().add(theEcorePackage.getEModelElement());
+
+ // Initialize classes and features; add operations and parameters
+ initEClass(papyrusTableEClass, PapyrusTable.class, "PapyrusTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
+ initEAttribute(getPapyrusTable_Name(), ecorePackage.getEString(), "name", null, 0, 1, PapyrusTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEAttribute(getPapyrusTable_Type(), ecorePackage.getEString(), "type", null, 0, 1, PapyrusTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEReference(getPapyrusTable_Table(), theTablePackage.getTable(), null, "table", null, 0, 1, PapyrusTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEAttribute(getPapyrusTable_FillingMode(), this.getFillingMode(), "fillingMode", null, 0, 1, PapyrusTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEReference(getPapyrusTable_Feature(), theEcorePackage.getEStructuralFeature(), null, "feature", null, 0, 1, PapyrusTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEReference(getPapyrusTable_Queries(), theExtensiblePackage.getQuery(), null, "queries", null, 0, -1, PapyrusTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEAttribute(getPapyrusTable_UsingUser(), ecorePackage.getEBoolean(), "usingUser", null, 0, 1, PapyrusTable.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$
+ initEAttribute(getPapyrusTable_UsingContextFeature(), ecorePackage.getEBoolean(), "usingContextFeature", null, 0, 1, PapyrusTable.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$
+ initEAttribute(getPapyrusTable_UsingQueries(), ecorePackage.getEBoolean(), "usingQueries", null, 0, 1, PapyrusTable.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$
+
+ // Initialize enums and add enum literals
+ initEEnum(fillingModeEEnum, FillingMode.class, "FillingMode"); //$NON-NLS-1$
+ addEEnumLiteral(fillingModeEEnum, FillingMode.USER);
+ addEEnumLiteral(fillingModeEEnum, FillingMode.QUERIES);
+ addEEnumLiteral(fillingModeEEnum, FillingMode.CONTEXT_FEATURE);
+
+ // Create resource
+ createResource(eNS_URI);
+ }
+
+} //PapyrustablePackageImpl
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/util/PapyrustableAdapterFactory.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/util/PapyrustableAdapterFactory.java new file mode 100644 index 00000000000..94d13863d18 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/util/PapyrustableAdapterFactory.java @@ -0,0 +1,149 @@ +/**
+ * 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.efacet.metamodel.papyrustable.util;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustablePackage
+ * @generated
+ */
+public class PapyrustableAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static PapyrustablePackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrustableAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = PapyrustablePackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrustableSwitch<Adapter> modelSwitch =
+ new PapyrustableSwitch<Adapter>() {
+ @Override
+ public Adapter casePapyrusTable(PapyrusTable object) {
+ return createPapyrusTableAdapter();
+ }
+ @Override
+ public Adapter caseEModelElement(EModelElement object) {
+ return createEModelElementAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable <em>Papyrus Table</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable
+ * @generated
+ */
+ public Adapter createPapyrusTableAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecore.EModelElement <em>EModel Element</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.emf.ecore.EModelElement
+ * @generated
+ */
+ public Adapter createEModelElementAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //PapyrustableAdapterFactory
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/util/PapyrustableSwitch.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/util/PapyrustableSwitch.java new file mode 100644 index 00000000000..558f5388aa4 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/metamodel/papyrustable/util/PapyrustableSwitch.java @@ -0,0 +1,137 @@ +/**
+ * 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.efacet.metamodel.papyrustable.util;
+
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.Switch;
+
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustablePackage
+ * @generated
+ */
+public class PapyrustableSwitch<T> extends Switch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static PapyrustablePackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrustableSwitch() {
+ if (modelPackage == null) {
+ modelPackage = PapyrustablePackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Checks whether this is a switch for the given package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @parameter ePackage the package in question.
+ * @return whether this is a switch for the given package.
+ * @generated
+ */
+ @Override
+ protected boolean isSwitchFor(EPackage ePackage) {
+ return ePackage == modelPackage;
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ @Override
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case PapyrustablePackage.PAPYRUS_TABLE: {
+ PapyrusTable papyrusTable = (PapyrusTable)theEObject;
+ T result = casePapyrusTable(papyrusTable);
+ if (result == null) result = caseEModelElement(papyrusTable);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Papyrus Table</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Papyrus Table</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T casePapyrusTable(PapyrusTable object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EModel Element</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EModel Element</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseEModelElement(EModelElement object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ @Override
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //PapyrustableSwitch
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.modelexplorer/.classpath b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.modelexplorer/.classpath new file mode 100644 index 00000000000..2d1a4302f04 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.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/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.modelexplorer/.project b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.modelexplorer/.project new file mode 100644 index 00000000000..80a28e8b68d --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.modelexplorer/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.table.efacet.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/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.modelexplorer/.settings/org.eclipse.jdt.core.prefs b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.modelexplorer/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..44217f8c068 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.modelexplorer/.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/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.modelexplorer/META-INF/MANIFEST.MF b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.modelexplorer/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..a97d4002477 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.modelexplorer/META-INF/MANIFEST.MF @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Table Modelexplorer (Incubation) +Bundle-SymbolicName: org.eclipse.papyrus.infra.table.efacet.modelexplorer +Bundle-Version: 0.9.0.qualifier +Bundle-Activator: org.eclipse.papyrus.infra.table.efacet.modelexplorer.Activator +Bundle-Vendor: Eclipse Modeling Project +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Bundle-ActivationPolicy: lazy diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.modelexplorer/build.properties b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.modelexplorer/build.properties new file mode 100644 index 00000000000..41eb6ade2b4 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.modelexplorer/build.properties @@ -0,0 +1,4 @@ +source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.modelexplorer/src/org/eclipse/papyrus/infra/table/efacet/modelexplorer/Activator.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.modelexplorer/src/org/eclipse/papyrus/infra/table/efacet/modelexplorer/Activator.java new file mode 100644 index 00000000000..8ba19528072 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.modelexplorer/src/org/eclipse/papyrus/infra/table/efacet/modelexplorer/Activator.java @@ -0,0 +1,50 @@ +package org.eclipse.papyrus.infra.table.efacet.modelexplorer;
+
+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.modelexplorer"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = 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/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/.classpath b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/.classpath new file mode 100644 index 00000000000..cedf0d0d0b5 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src-gen"/>
+ <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/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/.project b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/.project new file mode 100644 index 00000000000..375736a4d75 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/META-INF/MANIFEST.MF b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..6b505749ae1 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/META-INF/MANIFEST.MF @@ -0,0 +1,27 @@ +Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit;singleton:=true
+Bundle-Version: 0.9.0.qualifier
+Bundle-ClassPath: .
+Bundle-Activator: org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.provider.PapyrustableconfigurationEditPlugin$Implementation
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.provider
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel;visibility:=reexport,
+ org.eclipse.emf.edit;visibility:=reexport,
+ org.eclipse.emf.facet.widgets.celleditors;visibility:=reexport,
+ org.eclipse.emf.facet.widgets.celleditors.edit;visibility:=reexport,
+ org.eclipse.emf.facet.custom.metamodel;visibility:=reexport,
+ org.eclipse.emf.facet.custom.metamodel.edit;visibility:=reexport,
+ org.eclipse.emf.ecore;visibility:=reexport,
+ org.eclipse.emf.ecore.edit;visibility:=reexport,
+ org.eclipse.emf.facet.efacet.metamodel;visibility:=reexport,
+ org.eclipse.emf.facet.efacet.metamodel.edit;visibility:=reexport,
+ org.eclipse.papyrus.infra.table.efacet.metamodel;visibility:=reexport,
+ org.eclipse.papyrus.infra.table.efacet.metamodel.edit;visibility:=reexport,
+ org.eclipse.emf.facet.widgets.table.metamodel;visibility:=reexport,
+ org.eclipse.emf.facet.widgets.table.metamodel.edit;visibility:=reexport
+Bundle-ActivationPolicy: lazy
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/build.properties b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/build.properties new file mode 100644 index 00000000000..2579f63d79f --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/build.properties @@ -0,0 +1,19 @@ +# 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
+# ttp://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+
+bin.includes = .,\
+ icons/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties
+jars.compile.order = .
+source.. = src-gen/
+output.. = bin/
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/icons/full/ctool16/CreatePapyrusTableConfiguration_tableConfiguration_TableConfiguration.gif b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/icons/full/ctool16/CreatePapyrusTableConfiguration_tableConfiguration_TableConfiguration.gif Binary files differnew file mode 100644 index 00000000000..b72dc20b46f --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/icons/full/ctool16/CreatePapyrusTableConfiguration_tableConfiguration_TableConfiguration.gif diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/icons/full/obj16/PapyrusTableConfiguration.gif b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/icons/full/obj16/PapyrusTableConfiguration.gif Binary files differnew file mode 100644 index 00000000000..48e3cf22687 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/icons/full/obj16/PapyrusTableConfiguration.gif diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/plugin.properties b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/plugin.properties new file mode 100644 index 00000000000..bc9358f783f --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/plugin.properties @@ -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
+# ttp://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+
+pluginName = Papyrustableconfiguration Edit Support
+providerName = www.example.org
+
+_UI_CreateChild_text = {0}
+_UI_CreateChild_text2 = {1} {0}
+_UI_CreateChild_text3 = {1}
+_UI_CreateChild_tooltip = Create New {0} Under {1} Feature
+_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}.
+_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent.
+
+_UI_PropertyDescriptor_description = The {0} of the {1}
+
+_UI_PapyrusTableConfiguration_type = Papyrus Table Configuration
+_UI_Unknown_type = Object
+
+_UI_Unknown_datatype= Value
+
+_UI_PapyrusTableConfiguration_fillingMode_feature = Filling Mode
+_UI_PapyrusTableConfiguration_fillingQueries_feature = Filling Queries
+_UI_PapyrusTableConfiguration_listenFeature_feature = Listen Feature
+_UI_PapyrusTableConfiguration_tableConfiguration_feature = Table Configuration
+_UI_Unknown_feature = Unspecified
+
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/plugin.xml b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/plugin.xml new file mode 100644 index 00000000000..5f16e24d88d --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/plugin.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+ 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
+ ttp://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
+ <factory
+ uri="http://www.eclipse.org/Papyrus/PapyrusTableConfiguration/0.9.0/papyrustableconfiguration"
+ class="org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.provider.PapyrustableconfigurationItemProviderAdapterFactory"
+ supportedTypes=
+ "org.eclipse.emf.edit.provider.IEditingDomainItemProvider
+ org.eclipse.emf.edit.provider.IStructuredItemContentProvider
+ org.eclipse.emf.edit.provider.ITreeItemContentProvider
+ org.eclipse.emf.edit.provider.IItemLabelProvider
+ org.eclipse.emf.edit.provider.IItemPropertySource"/>
+ </extension>
+
+</plugin>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/provider/PapyrusTableConfigurationItemProvider.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/provider/PapyrusTableConfigurationItemProvider.java new file mode 100644 index 00000000000..27490828a9d --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/provider/PapyrusTableConfigurationItemProvider.java @@ -0,0 +1,230 @@ +/**
+ * 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
+ * ttp://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.papyrustableconfiguration.metamodel.papyrustableconfiguration.provider;
+
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.tableconfiguration.TableconfigurationFactory;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.FillingMode;
+import org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration;
+import org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrustableconfigurationPackage;
+
+
+/**
+ * This is the item provider adapter for a
+ * {@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class PapyrusTableConfigurationItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
+
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public PapyrusTableConfigurationItemProvider(final AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(final Object object) {
+ if(this.itemPropertyDescriptors == null) {
+ super.getPropertyDescriptors(object);
+
+ addFillingModePropertyDescriptor(object);
+ addFillingQueriesPropertyDescriptor(object);
+ addListenFeaturePropertyDescriptor(object);
+ }
+ return this.itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Filling Mode feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addFillingModePropertyDescriptor(final Object object) {
+ this.itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory)this.adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_PapyrusTableConfiguration_fillingMode_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusTableConfiguration_fillingMode_feature", "_UI_PapyrusTableConfiguration_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ PapyrustableconfigurationPackage.Literals.PAPYRUS_TABLE_CONFIGURATION__FILLING_MODE, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Filling Queries feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addFillingQueriesPropertyDescriptor(final Object object) {
+ this.itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory)this.adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_PapyrusTableConfiguration_fillingQueries_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusTableConfiguration_fillingQueries_feature", "_UI_PapyrusTableConfiguration_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ PapyrustableconfigurationPackage.Literals.PAPYRUS_TABLE_CONFIGURATION__FILLING_QUERIES, true, false, true, null, null, null));
+ }
+
+ /**
+ * This adds a property descriptor for the Listen Feature feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void addListenFeaturePropertyDescriptor(final Object object) {
+ this.itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory)this.adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_PapyrusTableConfiguration_listenFeature_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusTableConfiguration_listenFeature_feature", "_UI_PapyrusTableConfiguration_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ PapyrustableconfigurationPackage.Literals.PAPYRUS_TABLE_CONFIGURATION__LISTEN_FEATURE, true, false, true, null, null, null));
+ }
+
+ /**
+ * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
+ * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
+ * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Collection<? extends EStructuralFeature> getChildrenFeatures(final Object object) {
+ if(this.childrenFeatures == null) {
+ super.getChildrenFeatures(object);
+ this.childrenFeatures.add(EcorePackage.Literals.EMODEL_ELEMENT__EANNOTATIONS);
+ this.childrenFeatures.add(PapyrustableconfigurationPackage.Literals.PAPYRUS_TABLE_CONFIGURATION__TABLE_CONFIGURATION);
+ }
+ return this.childrenFeatures;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EStructuralFeature getChildFeature(final Object object, final Object child) {
+ // Check the type of the specified child object and return the proper feature to use for
+ // adding (see {@link AddCommand}) it as a child.
+
+ return super.getChildFeature(object, child);
+ }
+
+ /**
+ * This returns PapyrusTableConfiguration.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getImage(final Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/PapyrusTableConfiguration")); //$NON-NLS-1$
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public String getText(final Object object) {
+ final FillingMode labelValue = ((PapyrusTableConfiguration)object).getFillingMode();
+ final String label = labelValue == null ? null : labelValue.toString();
+ return label == null || label.length() == 0 ? getString("_UI_PapyrusTableConfiguration_type") : //$NON-NLS-1$
+ getString("_UI_PapyrusTableConfiguration_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void notifyChanged(final Notification notification) {
+ updateChildren(notification);
+
+ switch(notification.getFeatureID(PapyrusTableConfiguration.class)) {
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__FILLING_MODE:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ return;
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__EANNOTATIONS:
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__TABLE_CONFIGURATION:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(final Collection<Object> newChildDescriptors, final Object object) {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+
+ newChildDescriptors.add(createChildParameter(PapyrustableconfigurationPackage.Literals.PAPYRUS_TABLE_CONFIGURATION__TABLE_CONFIGURATION, TableconfigurationFactory.eINSTANCE.createTableConfiguration()));
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator() {
+ return PapyrustableconfigurationEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/provider/PapyrustableconfigurationEditPlugin.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/provider/PapyrustableconfigurationEditPlugin.java new file mode 100644 index 00000000000..376165e407f --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/provider/PapyrustableconfigurationEditPlugin.java @@ -0,0 +1,116 @@ +/**
+ * 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
+ * ttp://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.papyrustableconfiguration.metamodel.papyrustableconfiguration.provider;
+
+import org.eclipse.emf.common.EMFPlugin;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.provider.EcoreEditPlugin;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.provider.CustomEditPlugin;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.provider.Efacet2EditPlugin;
+import org.eclipse.emf.facet.widgets.celleditors.edit.CelleditorsEditPlugin;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.provider.PapyrustableEditPlugin;
+//import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.provider.Tableinstance02EditPlugin;
+//
+//import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.tableconfiguration.provider.TableConfigurationEditPlugin;
+
+/**
+ * This is the central singleton for the Papyrustableconfiguration edit plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public final class PapyrustableconfigurationEditPlugin extends EMFPlugin {
+
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static final PapyrustableconfigurationEditPlugin INSTANCE = new PapyrustableconfigurationEditPlugin();
+
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private static Implementation plugin;
+
+ /**
+ * Create the instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ public PapyrustableconfigurationEditPlugin() {
+ super(new ResourceLocator[]{ CelleditorsEditPlugin.INSTANCE, CustomEditPlugin.INSTANCE, EcoreEditPlugin.INSTANCE, Efacet2EditPlugin.INSTANCE, PapyrustableEditPlugin.INSTANCE,
+
+ });
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return the singleton instance.
+ * @generated
+ */
+ @Override
+ public ResourceLocator getPluginResourceLocator() {
+ return plugin;
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return the singleton instance.
+ * @generated
+ */
+ public static Implementation getPlugin() {
+ return plugin;
+ }
+
+ /**
+ * The actual implementation of the Eclipse <b>Plugin</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static class Implementation extends EclipsePlugin {
+
+ /**
+ * Creates an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Implementation() {
+ super();
+
+ // Remember the static instance.
+ //
+ plugin = this;
+ }
+ }
+
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/provider/PapyrustableconfigurationItemProviderAdapterFactory.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/provider/PapyrustableconfigurationItemProviderAdapterFactory.java new file mode 100644 index 00000000000..c10b1d52a46 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/provider/PapyrustableconfigurationItemProviderAdapterFactory.java @@ -0,0 +1,207 @@ +/**
+ * 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
+ * ttp://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.papyrustableconfiguration.metamodel.papyrustableconfiguration.provider;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.edit.provider.ChangeNotifier;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IChangeNotifier;
+import org.eclipse.emf.edit.provider.IDisposable;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.INotifyChangedListener;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.util.PapyrustableconfigurationAdapterFactory;
+
+/**
+ * This is the factory that is used to provide the interfaces needed to support Viewers.
+ * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}.
+ * The adapters also support Eclipse property sheets.
+ * Note that most of the adapters are shared among multiple instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PapyrustableconfigurationItemProviderAdapterFactory extends PapyrustableconfigurationAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable {
+ /**
+ * This keeps track of the root adapter factory that delegates to this adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ComposedAdapterFactory parentAdapterFactory;
+
+ /**
+ * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IChangeNotifier changeNotifier = new ChangeNotifier();
+
+ /**
+ * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<Object> supportedTypes = new ArrayList<Object>();
+
+ /**
+ * This constructs an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrustableconfigurationItemProviderAdapterFactory() {
+ supportedTypes.add(IEditingDomainItemProvider.class);
+ supportedTypes.add(IStructuredItemContentProvider.class);
+ supportedTypes.add(ITreeItemContentProvider.class);
+ supportedTypes.add(IItemLabelProvider.class);
+ supportedTypes.add(IItemPropertySource.class);
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrusTableConfigurationItemProvider papyrusTableConfigurationItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createPapyrusTableConfigurationAdapter() {
+ if (papyrusTableConfigurationItemProvider == null) {
+ papyrusTableConfigurationItemProvider = new PapyrusTableConfigurationItemProvider(this);
+ }
+
+ return papyrusTableConfigurationItemProvider;
+ }
+
+ /**
+ * This returns the root adapter factory that contains this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ComposeableAdapterFactory getRootAdapterFactory() {
+ return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory();
+ }
+
+ /**
+ * This sets the composed adapter factory that contains this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) {
+ this.parentAdapterFactory = parentAdapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object type) {
+ return supportedTypes.contains(type) || super.isFactoryForType(type);
+ }
+
+ /**
+ * This implementation substitutes the factory itself as the key for the adapter.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter adapt(Notifier notifier, Object type) {
+ return super.adapt(notifier, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object adapt(Object object, Object type) {
+ if (isFactoryForType(type)) {
+ Object adapter = super.adapt(object, type);
+ if (!(type instanceof Class<?>) || (((Class<?>)type).isInstance(adapter))) {
+ return adapter;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * This adds a listener.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void addListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.addListener(notifyChangedListener);
+ }
+
+ /**
+ * This removes a listener.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void removeListener(INotifyChangedListener notifyChangedListener) {
+ changeNotifier.removeListener(notifyChangedListener);
+ }
+
+ /**
+ * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void fireNotifyChanged(Notification notification) {
+ changeNotifier.fireNotifyChanged(notification);
+
+ if (parentAdapterFactory != null) {
+ parentAdapterFactory.fireNotifyChanged(notification);
+ }
+ }
+
+ /**
+ * This disposes all of the item providers created by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void dispose() {
+ if (papyrusTableConfigurationItemProvider != null) papyrusTableConfigurationItemProvider.dispose();
+ }
+
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/.classpath b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/.classpath new file mode 100644 index 00000000000..cedf0d0d0b5 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src-gen"/>
+ <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/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/.project b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/.project new file mode 100644 index 00000000000..268aacc2025 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/META-INF/MANIFEST.MF b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..a7be94f2bf1 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/META-INF/MANIFEST.MF @@ -0,0 +1,24 @@ +Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor;singleton:=true
+Bundle-Version: 0.9.0.qualifier
+Bundle-ClassPath: .
+Bundle-Activator: org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.presentation.PapyrustableconfigurationEditorPlugin$Implementation
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.presentation
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources;visibility:=reexport,
+ org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit;visibility:=reexport,
+ org.eclipse.emf.ecore.xmi;visibility:=reexport,
+ org.eclipse.emf.edit.ui;visibility:=reexport,
+ org.eclipse.ui.ide;visibility:=reexport,
+ org.eclipse.emf.facet.widgets.celleditors.edit;visibility:=reexport,
+ org.eclipse.emf.facet.custom.metamodel.edit;visibility:=reexport,
+ org.eclipse.emf.ecore.edit;visibility:=reexport,
+ org.eclipse.emf.facet.efacet.metamodel.edit;visibility:=reexport,
+ org.eclipse.papyrus.infra.table.efacet.metamodel.edit;visibility:=reexport,
+ org.eclipse.emf.facet.widgets.table.metamodel.edit;visibility:=reexport
+Bundle-ActivationPolicy: lazy
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/build.properties b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/build.properties new file mode 100644 index 00000000000..500c7e0cea5 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/build.properties @@ -0,0 +1,19 @@ +# 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
+# ttp://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+
+bin.includes = .,\
+ icons/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties
+jars.compile.order = .
+source.. = src-gen/
+output.. = bin
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/icons/full/obj16/PapyrustableconfigurationModelFile.gif b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/icons/full/obj16/PapyrustableconfigurationModelFile.gif Binary files differnew file mode 100644 index 00000000000..74c1ecf5723 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/icons/full/obj16/PapyrustableconfigurationModelFile.gif diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/icons/full/wizban/NewPapyrustableconfiguration.gif b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/icons/full/wizban/NewPapyrustableconfiguration.gif Binary files differnew file mode 100644 index 00000000000..cda87bb85c1 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/icons/full/wizban/NewPapyrustableconfiguration.gif diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/plugin.properties b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/plugin.properties new file mode 100644 index 00000000000..dcc414ad4db --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/plugin.properties @@ -0,0 +1,62 @@ +# 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
+# ttp://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+
+pluginName = Papyrustableconfiguration Editor
+providerName = www.example.org
+
+_UI_PapyrustableconfigurationEditor_menu = &Papyrustableconfiguration Editor
+
+_UI_CreateChild_menu_item = &New Child
+_UI_CreateSibling_menu_item = N&ew Sibling
+
+_UI_ShowPropertiesView_menu_item = Show &Properties View
+_UI_RefreshViewer_menu_item = &Refresh
+
+_UI_SelectionPage_label = Selection
+_UI_ParentPage_label = Parent
+_UI_ListPage_label = List
+_UI_TreePage_label = Tree
+_UI_TablePage_label = Table
+_UI_TreeWithColumnsPage_label = Tree with Columns
+_UI_ObjectColumn_label = Object
+_UI_SelfColumn_label = Self
+
+_UI_NoObjectSelected = Selected Nothing
+_UI_SingleObjectSelected = Selected Object: {0}
+_UI_MultiObjectSelected = Selected {0} Objects
+
+_UI_OpenEditorError_label = Open Editor
+
+_UI_Wizard_category = Example EMF Model Creation Wizards
+
+_UI_CreateModelError_message = Problems encountered in file "{0}"
+
+_UI_PapyrustableconfigurationModelWizard_label = Papyrustableconfiguration Model
+_UI_PapyrustableconfigurationModelWizard_description = Create a new Papyrustableconfiguration model
+
+_UI_PapyrustableconfigurationEditor_label = Papyrustableconfiguration Model Editor
+
+_UI_PapyrustableconfigurationEditorFilenameDefaultBase = My
+_UI_PapyrustableconfigurationEditorFilenameExtensions = papyrustableconfiguration
+
+_UI_Wizard_label = New
+
+_WARN_FilenameExtension = The file name must end in ''.{0}''
+_WARN_FilenameExtensions = The file name must have one of the following extensions: {0}
+
+_UI_ModelObject = &Model Object
+_UI_XMLEncoding = &XML Encoding
+_UI_XMLEncodingChoices = UTF-8 ASCII UTF-16 UTF-16BE UTF-16LE ISO-8859-1
+_UI_Wizard_initial_object_description = Select a model object to create
+
+_UI_FileConflict_label = File Conflict
+_WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes?
+
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/plugin.xml b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/plugin.xml new file mode 100644 index 00000000000..e61966bd1d9 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/plugin.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+ 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
+ ttp://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.ui.newWizards">
+ <category
+ id="org.eclipse.emf.ecore.Wizard.category.ID"
+ name="%_UI_Wizard_category"/>
+ <wizard
+ id="org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.presentation.PapyrustableconfigurationModelWizardID"
+ name="%_UI_PapyrustableconfigurationModelWizard_label"
+ class="org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.presentation.PapyrustableconfigurationModelWizard"
+ category="org.eclipse.emf.ecore.Wizard.category.ID"
+ icon="icons/full/obj16/PapyrustableconfigurationModelFile.gif">
+ <description>%_UI_PapyrustableconfigurationModelWizard_description</description>
+ <selection class="org.eclipse.core.resources.IResource"/>
+ </wizard>
+ </extension>
+
+ <extension point="org.eclipse.ui.editors">
+ <editor
+ id="org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.presentation.PapyrustableconfigurationEditorID"
+ name="%_UI_PapyrustableconfigurationEditor_label"
+ icon="icons/full/obj16/PapyrustableconfigurationModelFile.gif"
+ extensions="papyrustableconfiguration"
+ class="org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.presentation.PapyrustableconfigurationEditor"
+ contributorClass="org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.presentation.PapyrustableconfigurationActionBarContributor">
+ </editor>
+ </extension>
+
+</plugin>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationActionBarContributor.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationActionBarContributor.java new file mode 100644 index 00000000000..e0b66e54fed --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationActionBarContributor.java @@ -0,0 +1,430 @@ +/**
+ * 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
+ * ttp://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.papyrustableconfiguration.metamodel.papyrustableconfiguration.presentation;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+import org.eclipse.emf.edit.ui.action.ControlAction;
+import org.eclipse.emf.edit.ui.action.CreateChildAction;
+import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+import org.eclipse.emf.edit.ui.action.LoadResourceAction;
+import org.eclipse.emf.edit.ui.action.ValidateAction;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IContributionManager;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.SubContributionItem;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * This is the action bar contributor for the Papyrustableconfiguration model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PapyrustableconfigurationActionBarContributor
+ extends EditingDomainActionBarContributor
+ implements ISelectionChangedListener {
+ /**
+ * This keeps track of the active editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IEditorPart activeEditorPart;
+
+ /**
+ * This keeps track of the current selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ISelectionProvider selectionProvider;
+
+ /**
+ * This action opens the Properties view.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction showPropertiesViewAction =
+ new Action(PapyrustableconfigurationEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) //$NON-NLS-1$
+ {
+ @Override
+ public void run() {
+ try {
+ getPage().showView("org.eclipse.ui.views.PropertySheet"); //$NON-NLS-1$
+ }
+ catch (PartInitException exception) {
+ PapyrustableconfigurationEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * This action refreshes the viewer of the current editor if the editor
+ * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IAction refreshViewerAction =
+ new Action(PapyrustableconfigurationEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) //$NON-NLS-1$
+ {
+ @Override
+ public boolean isEnabled() {
+ return activeEditorPart instanceof IViewerProvider;
+ }
+
+ @Override
+ public void run() {
+ if (activeEditorPart instanceof IViewerProvider) {
+ Viewer viewer = ((IViewerProvider)activeEditorPart).getViewer();
+ if (viewer != null) {
+ viewer.refresh();
+ }
+ }
+ }
+ };
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createChildActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateChild actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createChildMenuManager;
+
+ /**
+ * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor
+ * generated for the current selection by the item provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> createSiblingActions;
+
+ /**
+ * This is the menu manager into which menu contribution items should be added for CreateSibling actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IMenuManager createSiblingMenuManager;
+
+ /**
+ * This creates an instance of the contributor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrustableconfigurationActionBarContributor() {
+ super(ADDITIONS_LAST_STYLE);
+ loadResourceAction = new LoadResourceAction();
+ validateAction = new ValidateAction();
+ controlAction = new ControlAction();
+ }
+
+ /**
+ * This adds Separators for editor additions to the tool bar.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToToolBar(IToolBarManager toolBarManager) {
+ toolBarManager.add(new Separator("papyrustableconfiguration-settings")); //$NON-NLS-1$
+ toolBarManager.add(new Separator("papyrustableconfiguration-additions")); //$NON-NLS-1$
+ }
+
+ /**
+ * This adds to the menu bar a menu and some separators for editor additions,
+ * as well as the sub-menus for object creation items.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void contributeToMenu(IMenuManager menuManager) {
+ super.contributeToMenu(menuManager);
+
+ IMenuManager submenuManager = new MenuManager(PapyrustableconfigurationEditorPlugin.INSTANCE.getString("_UI_PapyrustableconfigurationEditor_menu"), "org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfigurationMenuID"); //$NON-NLS-1$ //$NON-NLS-2$
+ menuManager.insertAfter("additions", submenuManager); //$NON-NLS-1$
+ submenuManager.add(new Separator("settings")); //$NON-NLS-1$
+ submenuManager.add(new Separator("actions")); //$NON-NLS-1$
+ submenuManager.add(new Separator("additions")); //$NON-NLS-1$
+ submenuManager.add(new Separator("additions-end")); //$NON-NLS-1$
+
+ // Prepare for CreateChild item addition or removal.
+ //
+ createChildMenuManager = new MenuManager(PapyrustableconfigurationEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); //$NON-NLS-1$
+ submenuManager.insertBefore("additions", createChildMenuManager); //$NON-NLS-1$
+
+ // Prepare for CreateSibling item addition or removal.
+ //
+ createSiblingMenuManager = new MenuManager(PapyrustableconfigurationEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); //$NON-NLS-1$
+ submenuManager.insertBefore("additions", createSiblingMenuManager); //$NON-NLS-1$
+
+ // Force an update because Eclipse hides empty menus now.
+ //
+ submenuManager.addMenuListener
+ (new IMenuListener() {
+ public void menuAboutToShow(IMenuManager menuManager) {
+ menuManager.updateAll(true);
+ }
+ });
+
+ addGlobalActions(submenuManager);
+ }
+
+ /**
+ * When the active editor changes, this remembers the change and registers with it as a selection provider.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setActiveEditor(IEditorPart part) {
+ super.setActiveEditor(part);
+ activeEditorPart = part;
+
+ // Switch to the new selection provider.
+ //
+ if (selectionProvider != null) {
+ selectionProvider.removeSelectionChangedListener(this);
+ }
+ if (part == null) {
+ selectionProvider = null;
+ }
+ else {
+ selectionProvider = part.getSite().getSelectionProvider();
+ selectionProvider.addSelectionChangedListener(this);
+
+ // Fake a selection changed event to update the menus.
+ //
+ if (selectionProvider.getSelection() != null) {
+ selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection()));
+ }
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
+ * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
+ * that can be added to the selected object and updating the menus accordingly.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ // Remove any menu items for old selection.
+ //
+ if (createChildMenuManager != null) {
+ depopulateManager(createChildMenuManager, createChildActions);
+ }
+ if (createSiblingMenuManager != null) {
+ depopulateManager(createSiblingMenuManager, createSiblingActions);
+ }
+
+ // Query the new selection for appropriate new child/sibling descriptors
+ //
+ Collection<?> newChildDescriptors = null;
+ Collection<?> newSiblingDescriptors = null;
+
+ ISelection selection = event.getSelection();
+ if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) {
+ Object object = ((IStructuredSelection)selection).getFirstElement();
+
+ EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain();
+
+ newChildDescriptors = domain.getNewChildDescriptors(object, null);
+ newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
+ }
+
+ // Generate actions for selection; populate and redraw the menus.
+ //
+ createChildActions = generateCreateChildActions(newChildDescriptors, selection);
+ createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);
+
+ if (createChildMenuManager != null) {
+ populateManager(createChildMenuManager, createChildActions, null);
+ createChildMenuManager.update(true);
+ }
+ if (createSiblingMenuManager != null) {
+ populateManager(createSiblingMenuManager, createSiblingActions, null);
+ createSiblingMenuManager.update(true);
+ }
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateChildAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>,
+ * and returns the collection of these actions.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) {
+ Collection<IAction> actions = new ArrayList<IAction>();
+ if (descriptors != null) {
+ for (Object descriptor : descriptors) {
+ actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
+ }
+ }
+ return actions;
+ }
+
+ /**
+ * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
+ * by inserting them before the specified contribution item <code>contributionID</code>.
+ * If <code>contributionID</code> is <code>null</code>, they are simply added.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
+ if (actions != null) {
+ for (IAction action : actions) {
+ if (contributionID != null) {
+ manager.insertBefore(contributionID, action);
+ }
+ else {
+ manager.add(action);
+ }
+ }
+ }
+ }
+
+ /**
+ * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
+ * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
+ if (actions != null) {
+ IContributionItem[] items = manager.getItems();
+ for (int i = 0; i < items.length; i++) {
+ // Look into SubContributionItems
+ //
+ IContributionItem contributionItem = items[i];
+ while (contributionItem instanceof SubContributionItem) {
+ contributionItem = ((SubContributionItem)contributionItem).getInnerItem();
+ }
+
+ // Delete the ActionContributionItems with matching action.
+ //
+ if (contributionItem instanceof ActionContributionItem) {
+ IAction action = ((ActionContributionItem)contributionItem).getAction();
+ if (actions.contains(action)) {
+ manager.remove(contributionItem);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This populates the pop-up menu before it appears.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void menuAboutToShow(IMenuManager menuManager) {
+ super.menuAboutToShow(menuManager);
+ MenuManager submenuManager = null;
+
+ submenuManager = new MenuManager(PapyrustableconfigurationEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); //$NON-NLS-1$
+ populateManager(submenuManager, createChildActions, null);
+ menuManager.insertBefore("edit", submenuManager); //$NON-NLS-1$
+
+ submenuManager = new MenuManager(PapyrustableconfigurationEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); //$NON-NLS-1$
+ populateManager(submenuManager, createSiblingActions, null);
+ menuManager.insertBefore("edit", submenuManager); //$NON-NLS-1$
+ }
+
+ /**
+ * This inserts global actions before the "additions-end" separator.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void addGlobalActions(IMenuManager menuManager) {
+ menuManager.insertAfter("additions-end", new Separator("ui-actions")); //$NON-NLS-1$ //$NON-NLS-2$
+ menuManager.insertAfter("ui-actions", showPropertiesViewAction); //$NON-NLS-1$
+
+ refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
+ menuManager.insertAfter("ui-actions", refreshViewerAction); //$NON-NLS-1$
+
+ super.addGlobalActions(menuManager);
+ }
+
+ /**
+ * This ensures that a delete action will clean up all references to deleted objects.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean removeAllReferencesOnDelete() {
+ return true;
+ }
+
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationEditor.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationEditor.java new file mode 100644 index 00000000000..e69a4e62aed --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationEditor.java @@ -0,0 +1,1853 @@ +/**
+ * 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
+ * ttp://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.papyrustableconfiguration.metamodel.papyrustableconfiguration.presentation;
+
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EventObject;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.common.command.BasicCommandStack;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CommandStack;
+import org.eclipse.emf.common.command.CommandStackListener;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.ui.MarkerHelper;
+import org.eclipse.emf.common.ui.ViewerPane;
+import org.eclipse.emf.common.ui.editor.ProblemEditorPart;
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EValidator;
+import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.EContentAdapter;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
+import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor;
+import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;
+import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
+import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;
+import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper;
+import org.eclipse.emf.edit.ui.util.EditUIUtil;
+import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.provider.CustomItemProviderAdapterFactory;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.provider.ExtensibleItemProviderAdapterFactory;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.provider.EFacetItemProviderAdapterFactory;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.query.provider.QueryItemProviderAdapterFactory;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.runtime.provider.RuntimeItemProviderAdapterFactory;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.serialization.provider.SerializationItemProviderAdapterFactory;
+import org.eclipse.emf.facet.widgets.celleditors.modelCellEditor.provider.ModelCellEditorItemProviderAdapterFactory;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.provider.PapyrustableItemProviderAdapterFactory;
+import org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.provider.PapyrustableconfigurationItemProviderAdapterFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.ui.dialogs.SaveAsDialog;
+import org.eclipse.ui.ide.IGotoMarker;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.MultiPageEditorPart;
+import org.eclipse.ui.views.contentoutline.ContentOutline;
+import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.PropertySheet;
+import org.eclipse.ui.views.properties.PropertySheetPage;
+
+
+/**
+ * This is an example of a Papyrustableconfiguration model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class PapyrustableconfigurationEditor extends MultiPageEditorPart implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker {
+
+ /**
+ * This keeps track of the editing domain that is used to track all changes to the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected AdapterFactoryEditingDomain editingDomain;
+
+ /**
+ * This is the one adapter factory used for providing views of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ComposedAdapterFactory adapterFactory;
+
+ /**
+ * This is the content outline page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected IContentOutlinePage contentOutlinePage;
+
+ /**
+ * This is a kludge...
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected IStatusLineManager contentOutlineStatusLineManager;
+
+ /**
+ * This is the content outline page's viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected TreeViewer contentOutlineViewer;
+
+ /**
+ * This is the property sheet page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected PropertySheetPage propertySheetPage;
+
+ /**
+ * This is the viewer that shadows the selection in the content outline.
+ * The parent relation must be correctly defined for this to work.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected TreeViewer selectionViewer;
+
+ /**
+ * This inverts the roll of parent and child in the content provider and show parents as a tree.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected TreeViewer parentViewer;
+
+ /**
+ * This shows how a tree view works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected TreeViewer treeViewer;
+
+ /**
+ * This shows how a list view works.
+ * A list viewer doesn't support icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ListViewer listViewer;
+
+ /**
+ * This shows how a table view works.
+ * A table can be used as a list with icons.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected TableViewer tableViewer;
+
+ /**
+ * This shows how a tree view with columns works.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected TreeViewer treeViewerWithColumns;
+
+ /**
+ * This keeps track of the active viewer pane, in the book.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ViewerPane currentViewerPane;
+
+ /**
+ * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Viewer currentViewer;
+
+ /**
+ * This listens to which ever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ISelectionChangedListener selectionChangedListener;
+
+ /**
+ * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Collection<ISelectionChangedListener> selectionChangedListeners = new ArrayList<ISelectionChangedListener>();
+
+ /**
+ * This keeps track of the selection of the editor as a whole.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected ISelection editorSelection = StructuredSelection.EMPTY;
+
+ /**
+ * The MarkerHelper is responsible for creating workspace resource markers presented
+ * in Eclipse's Problems View.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected MarkerHelper markerHelper = new EditUIMarkerHelper();
+
+ /**
+ * This listens for when the outline becomes active
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected IPartListener partListener = new IPartListener() {
+
+ public void partActivated(final IWorkbenchPart p) {
+ if(p instanceof ContentOutline) {
+ if(((ContentOutline)p).getCurrentPage() == PapyrustableconfigurationEditor.this.contentOutlinePage) {
+ getActionBarContributor().setActiveEditor(PapyrustableconfigurationEditor.this);
+
+ setCurrentViewer(PapyrustableconfigurationEditor.this.contentOutlineViewer);
+ }
+ } else if(p instanceof PropertySheet) {
+ if(((PropertySheet)p).getCurrentPage() == PapyrustableconfigurationEditor.this.propertySheetPage) {
+ getActionBarContributor().setActiveEditor(PapyrustableconfigurationEditor.this);
+ handleActivate();
+ }
+ } else if(p == PapyrustableconfigurationEditor.this) {
+ handleActivate();
+ }
+ }
+
+ public void partBroughtToTop(final IWorkbenchPart p) {
+ // Ignore.
+ }
+
+ public void partClosed(final IWorkbenchPart p) {
+ // Ignore.
+ }
+
+ public void partDeactivated(final IWorkbenchPart p) {
+ // Ignore.
+ }
+
+ public void partOpened(final IWorkbenchPart p) {
+ // Ignore.
+ }
+ };
+
+ /**
+ * Resources that have been removed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been changed since last activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+
+ /**
+ * Resources that have been saved.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Collection<Resource> savedResources = new ArrayList<Resource>();
+
+ /**
+ * Map to store the diagnostic associated with a resource.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected Map<Resource, Diagnostic> resourceToDiagnosticMap = new LinkedHashMap<Resource, Diagnostic>();
+
+ /**
+ * Controls whether the problem indication should be updated.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected boolean updateProblemIndication = true;
+
+ /**
+ * Adapter used to update the problem indication when resources are demanded loaded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected EContentAdapter problemIndicationAdapter = new EContentAdapter() {
+
+ @Override
+ public void notifyChanged(final Notification notification) {
+ if(notification.getNotifier() instanceof Resource) {
+ switch(notification.getFeatureID(Resource.class)) {
+ case Resource.RESOURCE__IS_LOADED:
+ case Resource.RESOURCE__ERRORS:
+ case Resource.RESOURCE__WARNINGS:
+ {
+ final Resource resource = (Resource)notification.getNotifier();
+ final Diagnostic diagnostic = analyzeResourceProblems(resource, null);
+ if(diagnostic.getSeverity() != Diagnostic.OK) {
+ PapyrustableconfigurationEditor.this.resourceToDiagnosticMap.put(resource, diagnostic);
+ } else {
+ PapyrustableconfigurationEditor.this.resourceToDiagnosticMap.remove(resource);
+ }
+
+ if(PapyrustableconfigurationEditor.this.updateProblemIndication) {
+ getSite().getShell().getDisplay().asyncExec(new Runnable() {
+
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+ break;
+ }
+ }
+ } else {
+ super.notifyChanged(notification);
+ }
+ }
+
+ @Override
+ protected void setTarget(final Resource target) {
+ basicSetTarget(target);
+ }
+
+ @Override
+ protected void unsetTarget(final Resource target) {
+ basicUnsetTarget(target);
+ }
+ };
+
+ /**
+ * This listens for workspace changes.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected IResourceChangeListener resourceChangeListener = new IResourceChangeListener() {
+
+ public void resourceChanged(final IResourceChangeEvent event) {
+ final IResourceDelta delta = event.getDelta();
+ try {
+ class ResourceDeltaVisitor implements IResourceDeltaVisitor {
+
+ protected ResourceSet resourceSet = PapyrustableconfigurationEditor.this.editingDomain.getResourceSet();
+
+ protected Collection<Resource> changedResources = new ArrayList<Resource>();
+
+ protected Collection<Resource> removedResources = new ArrayList<Resource>();
+
+ public boolean visit(final IResourceDelta delta) {
+ if(delta.getResource().getType() == IResource.FILE) {
+ if(delta.getKind() == IResourceDelta.REMOVED || delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) {
+ final Resource resource = this.resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
+ if(resource != null) {
+ if(delta.getKind() == IResourceDelta.REMOVED) {
+ this.removedResources.add(resource);
+ } else if(!PapyrustableconfigurationEditor.this.savedResources.remove(resource)) {
+ this.changedResources.add(resource);
+ }
+ }
+ }
+ }
+
+ return true;
+ }
+
+ public Collection<Resource> getChangedResources() {
+ return this.changedResources;
+ }
+
+ public Collection<Resource> getRemovedResources() {
+ return this.removedResources;
+ }
+ }
+
+ final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
+ delta.accept(visitor);
+
+ if(!visitor.getRemovedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec(new Runnable() {
+
+ public void run() {
+ PapyrustableconfigurationEditor.this.removedResources.addAll(visitor.getRemovedResources());
+ if(!isDirty()) {
+ getSite().getPage().closeEditor(PapyrustableconfigurationEditor.this, false);
+ }
+ }
+ });
+ }
+
+ if(!visitor.getChangedResources().isEmpty()) {
+ getSite().getShell().getDisplay().asyncExec(new Runnable() {
+
+ public void run() {
+ PapyrustableconfigurationEditor.this.changedResources.addAll(visitor.getChangedResources());
+ if(getSite().getPage().getActiveEditor() == PapyrustableconfigurationEditor.this) {
+ handleActivate();
+ }
+ }
+ });
+ }
+ } catch (final CoreException exception) {
+ PapyrustableconfigurationEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ };
+
+ /**
+ * Handles activation of the editor or it's associated views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void handleActivate() {
+ // Recompute the read only state.
+ //
+ if(this.editingDomain.getResourceToReadOnlyMap() != null) {
+ this.editingDomain.getResourceToReadOnlyMap().clear();
+
+ // Refresh any actions that may become enabled or disabled.
+ //
+ setSelection(getSelection());
+ }
+
+ if(!this.removedResources.isEmpty()) {
+ if(handleDirtyConflict()) {
+ getSite().getPage().closeEditor(PapyrustableconfigurationEditor.this, false);
+ } else {
+ this.removedResources.clear();
+ this.changedResources.clear();
+ this.savedResources.clear();
+ }
+ } else if(!this.changedResources.isEmpty()) {
+ this.changedResources.removeAll(this.savedResources);
+ handleChangedResources();
+ this.changedResources.clear();
+ this.savedResources.clear();
+ }
+ }
+
+ /**
+ * Handles what to do with changed resources on activation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void handleChangedResources() {
+ if(!this.changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) {
+ if(isDirty()) {
+ this.changedResources.addAll(this.editingDomain.getResourceSet().getResources());
+ }
+ this.editingDomain.getCommandStack().flush();
+
+ this.updateProblemIndication = false;
+ for(final Resource resource : this.changedResources) {
+ if(resource.isLoaded()) {
+ resource.unload();
+ try {
+ resource.load(Collections.EMPTY_MAP);
+ } catch (final IOException exception) {
+ if(!this.resourceToDiagnosticMap.containsKey(resource)) {
+ this.resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ }
+ }
+ }
+
+ if(AdapterFactoryEditingDomain.isStale(this.editorSelection)) {
+ setSelection(StructuredSelection.EMPTY);
+ }
+
+ this.updateProblemIndication = true;
+ updateProblemIndication();
+ }
+ }
+
+ /**
+ * Updates the problems indication with the information described in the specified diagnostic.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void updateProblemIndication() {
+ if(this.updateProblemIndication) {
+ final BasicDiagnostic diagnostic = new BasicDiagnostic(Diagnostic.OK, "org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor", //$NON-NLS-1$
+ 0, null, new Object[]{ this.editingDomain.getResourceSet() });
+ for(final Diagnostic childDiagnostic : this.resourceToDiagnosticMap.values()) {
+ if(childDiagnostic.getSeverity() != Diagnostic.OK) {
+ diagnostic.add(childDiagnostic);
+ }
+ }
+
+ int lastEditorPage = getPageCount() - 1;
+ if(lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) {
+ ((ProblemEditorPart)getEditor(lastEditorPage)).setDiagnostic(diagnostic);
+ if(diagnostic.getSeverity() != Diagnostic.OK) {
+ setActivePage(lastEditorPage);
+ }
+ } else if(diagnostic.getSeverity() != Diagnostic.OK) {
+ final ProblemEditorPart problemEditorPart = new ProblemEditorPart();
+ problemEditorPart.setDiagnostic(diagnostic);
+ problemEditorPart.setMarkerHelper(this.markerHelper);
+ try {
+ addPage(++lastEditorPage, problemEditorPart, getEditorInput());
+ setPageText(lastEditorPage, problemEditorPart.getPartName());
+ setActivePage(lastEditorPage);
+ showTabs();
+ } catch (final PartInitException exception) {
+ PapyrustableconfigurationEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+
+ if(this.markerHelper.hasMarkers(this.editingDomain.getResourceSet())) {
+ this.markerHelper.deleteMarkers(this.editingDomain.getResourceSet());
+ if(diagnostic.getSeverity() != Diagnostic.OK) {
+ try {
+ this.markerHelper.createMarkers(diagnostic);
+ } catch (final CoreException exception) {
+ PapyrustableconfigurationEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Shows a dialog that asks if conflicting changes should be discarded.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected boolean handleDirtyConflict() {
+ return MessageDialog.openQuestion(getSite().getShell(), getString("_UI_FileConflict_label"), //$NON-NLS-1$
+ getString("_WARN_FileConflict")); //$NON-NLS-1$
+ }
+
+ /**
+ * This creates a model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public PapyrustableconfigurationEditor() {
+ super();
+ initializeEditingDomain();
+ }
+
+ /**
+ * This sets up the editing domain for the model editor.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ protected void initializeEditingDomain() {
+ // Create an adapter factory that yields item providers.
+ //
+ this.adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ this.adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ this.adapterFactory.addAdapterFactory(new PapyrustableconfigurationItemProviderAdapterFactory());
+ this.adapterFactory.addAdapterFactory(new ModelCellEditorItemProviderAdapterFactory());
+ this.adapterFactory.addAdapterFactory(new CustomItemProviderAdapterFactory());
+ this.adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory());
+ this.adapterFactory.addAdapterFactory(new EFacetItemProviderAdapterFactory());
+ this.adapterFactory.addAdapterFactory(new SerializationItemProviderAdapterFactory());
+ this.adapterFactory.addAdapterFactory(new ExtensibleItemProviderAdapterFactory());
+ this.adapterFactory.addAdapterFactory(new QueryItemProviderAdapterFactory());
+ this.adapterFactory.addAdapterFactory(new RuntimeItemProviderAdapterFactory());
+ this.adapterFactory.addAdapterFactory(new PapyrustableItemProviderAdapterFactory());
+ this.adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+
+ // Create the command stack that will notify this editor as commands are executed.
+ //
+ final BasicCommandStack commandStack = new BasicCommandStack();
+
+ // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus.
+ //
+ commandStack.addCommandStackListener(new CommandStackListener() {
+
+ public void commandStackChanged(final EventObject event) {
+ getContainer().getDisplay().asyncExec(new Runnable() {
+
+ public void run() {
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+
+ // Try to select the affected objects.
+ //
+ final Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
+ if(mostRecentCommand != null) {
+ setSelectionToViewer(mostRecentCommand.getAffectedObjects());
+ }
+ if(PapyrustableconfigurationEditor.this.propertySheetPage != null && !PapyrustableconfigurationEditor.this.propertySheetPage.getControl().isDisposed()) {
+ PapyrustableconfigurationEditor.this.propertySheetPage.refresh();
+ }
+ }
+ });
+ }
+ });
+
+ // Create the editing domain with a special command stack.
+ //
+ this.editingDomain = new AdapterFactoryEditingDomain(this.adapterFactory, commandStack, new HashMap<Resource, Boolean>());
+ }
+
+ /**
+ * This is here for the listener to be able to call it.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void firePropertyChange(final int action) {
+ super.firePropertyChange(action);
+ }
+
+ /**
+ * This sets the selection into whichever viewer is active.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setSelectionToViewer(final Collection<?> collection) {
+ final Collection<?> theSelection = collection;
+ // Make sure it's okay.
+ //
+ if(theSelection != null && !theSelection.isEmpty()) {
+ final Runnable runnable = new Runnable() {
+
+ public void run() {
+ // Try to select the items in the current content viewer of the editor.
+ //
+ if(PapyrustableconfigurationEditor.this.currentViewer != null) {
+ PapyrustableconfigurationEditor.this.currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
+ }
+ }
+ };
+ getSite().getShell().getDisplay().asyncExec(runnable);
+ }
+ }
+
+ /**
+ * This returns the editing domain as required by the {@link IEditingDomainProvider} interface.
+ * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain} and for supporting
+ * {@link org.eclipse.emf.edit.ui.action.CommandAction}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EditingDomain getEditingDomain() {
+ return this.editingDomain;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider {
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ReverseAdapterFactoryContentProvider(final AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object[] getElements(final Object object) {
+ final Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object[] getChildren(final Object object) {
+ final Object parent = super.getParent(object);
+ return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean hasChildren(final Object object) {
+ final Object parent = super.getParent(object);
+ return parent != null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public Object getParent(final Object object) {
+ return null;
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setCurrentViewerPane(final ViewerPane viewerPane) {
+ if(this.currentViewerPane != viewerPane) {
+ if(this.currentViewerPane != null) {
+ this.currentViewerPane.showFocus(false);
+ }
+ this.currentViewerPane = viewerPane;
+ }
+ setCurrentViewer(this.currentViewerPane.getViewer());
+ }
+
+ /**
+ * This makes sure that one content viewer, either for the current page or the outline view, if it has focus,
+ * is the current one.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setCurrentViewer(final Viewer viewer) {
+ // If it is changing...
+ //
+ if(this.currentViewer != viewer) {
+ if(this.selectionChangedListener == null) {
+ // Create the listener on demand.
+ //
+ this.selectionChangedListener = new ISelectionChangedListener() {
+
+ // This just notifies those things that are affected by the section.
+ //
+ public void selectionChanged(final SelectionChangedEvent selectionChangedEvent) {
+ setSelection(selectionChangedEvent.getSelection());
+ }
+ };
+ }
+
+ // Stop listening to the old one.
+ //
+ if(this.currentViewer != null) {
+ this.currentViewer.removeSelectionChangedListener(this.selectionChangedListener);
+ }
+
+ // Start listening to the new one.
+ //
+ if(viewer != null) {
+ viewer.addSelectionChangedListener(this.selectionChangedListener);
+ }
+
+ // Remember it.
+ //
+ this.currentViewer = viewer;
+
+ // Set the editors selection based on the current viewer's selection.
+ //
+ setSelection(this.currentViewer == null ? StructuredSelection.EMPTY : this.currentViewer.getSelection());
+ }
+ }
+
+ /**
+ * This returns the viewer as required by the {@link IViewerProvider} interface.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Viewer getViewer() {
+ return this.currentViewer;
+ }
+
+ /**
+ * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void createContextMenuFor(final StructuredViewer viewer) {
+ final MenuManager contextMenu = new MenuManager("#PopUp"); //$NON-NLS-1$
+ contextMenu.add(new Separator("additions")); //$NON-NLS-1$
+ contextMenu.setRemoveAllWhenShown(true);
+ contextMenu.addMenuListener(this);
+ final Menu menu = contextMenu.createContextMenu(viewer.getControl());
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
+
+ final int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
+ final Transfer[] transfers = new Transfer[]{ LocalTransfer.getInstance() };
+ viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(this.editingDomain, viewer));
+ }
+
+ /**
+ * This is the method called to load a resource into the editing domain's resource set based on the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void createModel() {
+ final URI resourceURI = EditUIUtil.getURI(getEditorInput());
+ Exception exception = null;
+ Resource resource = null;
+ try {
+ // Load the resource through the editing domain.
+ //
+ resource = this.editingDomain.getResourceSet().getResource(resourceURI, true);
+ } catch (final Exception e) {
+ exception = e;
+ resource = this.editingDomain.getResourceSet().getResource(resourceURI, false);
+ }
+
+ final Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
+ if(diagnostic.getSeverity() != Diagnostic.OK) {
+ this.resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ this.editingDomain.getResourceSet().eAdapters().add(this.problemIndicationAdapter);
+ }
+
+ /**
+ * Returns a diagnostic describing the errors and warnings listed in the resource
+ * and the specified exception (if any).
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Diagnostic analyzeResourceProblems(final Resource resource, final Exception exception) {
+ if(!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
+ final BasicDiagnostic basicDiagnostic = new BasicDiagnostic(Diagnostic.ERROR, "org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor", //$NON-NLS-1$
+ 0, getString("_UI_CreateModelError_message", resource.getURI()), //$NON-NLS-1$
+ new Object[]{ exception == null ? (Object)resource : exception });
+ basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
+ return basicDiagnostic;
+ } else if(exception != null) {
+ return new BasicDiagnostic(Diagnostic.ERROR, "org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor", //$NON-NLS-1$
+ 0, getString("_UI_CreateModelError_message", resource.getURI()), //$NON-NLS-1$
+ new Object[]{ exception });
+ } else {
+ return Diagnostic.OK_INSTANCE;
+ }
+ }
+
+ /**
+ * This is the method used by the framework to install your own controls.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void createPages() {
+ // Creates the model from the editor input
+ //
+ createModel();
+
+ // Only creates the other pages if there is something that can be edited
+ //
+ if(!getEditingDomain().getResourceSet().getResources().isEmpty()) {
+ // Create a page for the selection tree view.
+ //
+ {
+ final ViewerPane viewerPane = new ViewerPane(getSite().getPage(), PapyrustableconfigurationEditor.this) {
+
+ @Override
+ public Viewer createViewer(final Composite composite) {
+ final Tree tree = new Tree(composite, SWT.MULTI);
+ final TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ this.selectionViewer = (TreeViewer)viewerPane.getViewer();
+ this.selectionViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
+
+ this.selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+ this.selectionViewer.setInput(this.editingDomain.getResourceSet());
+ this.selectionViewer.setSelection(new StructuredSelection(this.editingDomain.getResourceSet().getResources().get(0)), true);
+ viewerPane.setTitle(this.editingDomain.getResourceSet());
+
+ new AdapterFactoryTreeEditor(this.selectionViewer.getTree(), this.adapterFactory);
+
+ createContextMenuFor(this.selectionViewer);
+ final int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_SelectionPage_label")); //$NON-NLS-1$
+ }
+
+ // Create a page for the parent tree view.
+ //
+ {
+ final ViewerPane viewerPane = new ViewerPane(getSite().getPage(), PapyrustableconfigurationEditor.this) {
+
+ @Override
+ public Viewer createViewer(final Composite composite) {
+ final Tree tree = new Tree(composite, SWT.MULTI);
+ final TreeViewer newTreeViewer = new TreeViewer(tree);
+ return newTreeViewer;
+ }
+
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ this.parentViewer = (TreeViewer)viewerPane.getViewer();
+ this.parentViewer.setAutoExpandLevel(30);
+ this.parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(this.adapterFactory));
+ this.parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+
+ createContextMenuFor(this.parentViewer);
+ final int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ParentPage_label")); //$NON-NLS-1$
+ }
+
+ // This is the page for the list viewer
+ //
+ {
+ final ViewerPane viewerPane = new ViewerPane(getSite().getPage(), PapyrustableconfigurationEditor.this) {
+
+ @Override
+ public Viewer createViewer(final Composite composite) {
+ return new ListViewer(composite);
+ }
+
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ this.listViewer = (ListViewer)viewerPane.getViewer();
+ this.listViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
+ this.listViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+
+ createContextMenuFor(this.listViewer);
+ final int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_ListPage_label")); //$NON-NLS-1$
+ }
+
+ // This is the page for the tree viewer
+ //
+ {
+ final ViewerPane viewerPane = new ViewerPane(getSite().getPage(), PapyrustableconfigurationEditor.this) {
+
+ @Override
+ public Viewer createViewer(final Composite composite) {
+ return new TreeViewer(composite);
+ }
+
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ this.treeViewer = (TreeViewer)viewerPane.getViewer();
+ this.treeViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
+ this.treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+
+ new AdapterFactoryTreeEditor(this.treeViewer.getTree(), this.adapterFactory);
+
+ createContextMenuFor(this.treeViewer);
+ final int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreePage_label")); //$NON-NLS-1$
+ }
+
+ // This is the page for the table viewer.
+ //
+ {
+ final ViewerPane viewerPane = new ViewerPane(getSite().getPage(), PapyrustableconfigurationEditor.this) {
+
+ @Override
+ public Viewer createViewer(final Composite composite) {
+ return new TableViewer(composite);
+ }
+
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+ this.tableViewer = (TableViewer)viewerPane.getViewer();
+
+ final Table table = this.tableViewer.getTable();
+ final TableLayout layout = new TableLayout();
+ table.setLayout(layout);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+
+ final TableColumn objectColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(3, 100, true));
+ objectColumn.setText(getString("_UI_ObjectColumn_label")); //$NON-NLS-1$
+ objectColumn.setResizable(true);
+
+ final TableColumn selfColumn = new TableColumn(table, SWT.NONE);
+ layout.addColumnData(new ColumnWeightData(2, 100, true));
+ selfColumn.setText(getString("_UI_SelfColumn_label")); //$NON-NLS-1$
+ selfColumn.setResizable(true);
+
+ this.tableViewer.setColumnProperties(new String[]{ "a", "b" }); //$NON-NLS-1$ //$NON-NLS-2$
+ this.tableViewer.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
+ this.tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+
+ createContextMenuFor(this.tableViewer);
+ final int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TablePage_label")); //$NON-NLS-1$
+ }
+
+ // This is the page for the table tree viewer.
+ //
+ {
+ final ViewerPane viewerPane = new ViewerPane(getSite().getPage(), PapyrustableconfigurationEditor.this) {
+
+ @Override
+ public Viewer createViewer(final Composite composite) {
+ return new TreeViewer(composite);
+ }
+
+ @Override
+ public void requestActivation() {
+ super.requestActivation();
+ setCurrentViewerPane(this);
+ }
+ };
+ viewerPane.createControl(getContainer());
+
+ this.treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
+
+ final Tree tree = this.treeViewerWithColumns.getTree();
+ tree.setLayoutData(new FillLayout());
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+
+ final TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE);
+ objectColumn.setText(getString("_UI_ObjectColumn_label")); //$NON-NLS-1$
+ objectColumn.setResizable(true);
+ objectColumn.setWidth(250);
+
+ final TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE);
+ selfColumn.setText(getString("_UI_SelfColumn_label")); //$NON-NLS-1$
+ selfColumn.setResizable(true);
+ selfColumn.setWidth(200);
+
+ this.treeViewerWithColumns.setColumnProperties(new String[]{ "a", "b" }); //$NON-NLS-1$ //$NON-NLS-2$
+ this.treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(this.adapterFactory));
+ this.treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(this.adapterFactory));
+
+ createContextMenuFor(this.treeViewerWithColumns);
+ final int pageIndex = addPage(viewerPane.getControl());
+ setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label")); //$NON-NLS-1$
+ }
+
+ getSite().getShell().getDisplay().asyncExec(new Runnable() {
+
+ public void run() {
+ setActivePage(0);
+ }
+ });
+ }
+
+ // Ensures that this editor will only display the page's tab
+ // area if there are more than one page
+ //
+ getContainer().addControlListener(new ControlAdapter() {
+
+ boolean guard = false;
+
+ @Override
+ public void controlResized(final ControlEvent event) {
+ if(!this.guard) {
+ this.guard = true;
+ hideTabs();
+ this.guard = false;
+ }
+ }
+ });
+
+ getSite().getShell().getDisplay().asyncExec(new Runnable() {
+
+ public void run() {
+ updateProblemIndication();
+ }
+ });
+ }
+
+ /**
+ * If there is just one page in the multi-page editor part,
+ * this hides the single tab at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void hideTabs() {
+ if(getPageCount() <= 1) {
+ setPageText(0, ""); //$NON-NLS-1$
+ if(getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(1);
+ final Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y + 6);
+ }
+ }
+ }
+
+ /**
+ * If there is more than one page in the multi-page editor part,
+ * this shows the tabs at the bottom.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void showTabs() {
+ if(getPageCount() > 1) {
+ setPageText(0, getString("_UI_SelectionPage_label")); //$NON-NLS-1$
+ if(getContainer() instanceof CTabFolder) {
+ ((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT);
+ final Point point = getContainer().getSize();
+ getContainer().setSize(point.x, point.y - 6);
+ }
+ }
+ }
+
+ /**
+ * This is used to track the active viewer.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected void pageChange(final int pageIndex) {
+ super.pageChange(pageIndex);
+
+ if(this.contentOutlinePage != null) {
+ handleContentOutlineSelection(this.contentOutlinePage.getSelection());
+ }
+ }
+
+ /**
+ * This is how the framework determines which interfaces we implement.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(final Class key) {
+ if(key.equals(IContentOutlinePage.class)) {
+ return showOutlineView() ? getContentOutlinePage() : null;
+ } else if(key.equals(IPropertySheetPage.class)) {
+ return getPropertySheetPage();
+ } else if(key.equals(IGotoMarker.class)) {
+ return this;
+ } else {
+ return super.getAdapter(key);
+ }
+ }
+
+ /**
+ * This accesses a cached version of the content outliner.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public IContentOutlinePage getContentOutlinePage() {
+ if(this.contentOutlinePage == null) {
+ // The content outline is just a tree.
+ //
+ class MyContentOutlinePage extends ContentOutlinePage {
+
+ @Override
+ public void createControl(final Composite parent) {
+ super.createControl(parent);
+ PapyrustableconfigurationEditor.this.contentOutlineViewer = getTreeViewer();
+ PapyrustableconfigurationEditor.this.contentOutlineViewer.addSelectionChangedListener(this);
+
+ // Set up the tree viewer.
+ //
+ PapyrustableconfigurationEditor.this.contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(PapyrustableconfigurationEditor.this.adapterFactory));
+ PapyrustableconfigurationEditor.this.contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(PapyrustableconfigurationEditor.this.adapterFactory));
+ PapyrustableconfigurationEditor.this.contentOutlineViewer.setInput(PapyrustableconfigurationEditor.this.editingDomain.getResourceSet());
+
+ // Make sure our popups work.
+ //
+ createContextMenuFor(PapyrustableconfigurationEditor.this.contentOutlineViewer);
+
+ if(!PapyrustableconfigurationEditor.this.editingDomain.getResourceSet().getResources().isEmpty()) {
+ // Select the root object in the view.
+ //
+ PapyrustableconfigurationEditor.this.contentOutlineViewer.setSelection(new StructuredSelection(PapyrustableconfigurationEditor.this.editingDomain.getResourceSet().getResources().get(0)), true);
+ }
+ }
+
+ @Override
+ public void makeContributions(final IMenuManager menuManager, final IToolBarManager toolBarManager, final IStatusLineManager statusLineManager) {
+ super.makeContributions(menuManager, toolBarManager, statusLineManager);
+ PapyrustableconfigurationEditor.this.contentOutlineStatusLineManager = statusLineManager;
+ }
+
+ @Override
+ public void setActionBars(final IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ }
+
+ this.contentOutlinePage = new MyContentOutlinePage();
+
+ // Listen to selection so that we can handle it is a special way.
+ //
+ this.contentOutlinePage.addSelectionChangedListener(new ISelectionChangedListener() {
+
+ // This ensures that we handle selections correctly.
+ //
+ public void selectionChanged(final SelectionChangedEvent event) {
+ handleContentOutlineSelection(event.getSelection());
+ }
+ });
+ }
+
+ return this.contentOutlinePage;
+ }
+
+ /**
+ * This accesses a cached version of the property sheet.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public IPropertySheetPage getPropertySheetPage() {
+ if(this.propertySheetPage == null) {
+ this.propertySheetPage = new ExtendedPropertySheetPage(this.editingDomain) {
+
+ @Override
+ public void setSelectionToViewer(final List<?> selection) {
+ PapyrustableconfigurationEditor.this.setSelectionToViewer(selection);
+ PapyrustableconfigurationEditor.this.setFocus();
+ }
+
+ @Override
+ public void setActionBars(final IActionBars actionBars) {
+ super.setActionBars(actionBars);
+ getActionBarContributor().shareGlobalActions(this, actionBars);
+ }
+ };
+ this.propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(this.adapterFactory));
+ }
+
+ return this.propertySheetPage;
+ }
+
+ /**
+ * This deals with how we want selection in the outliner to affect the other views.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void handleContentOutlineSelection(final ISelection selection) {
+ if(this.currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
+ final Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
+ if(selectedElements.hasNext()) {
+ // Get the first selected element.
+ //
+ final Object selectedElement = selectedElements.next();
+
+ // If it's the selection viewer, then we want it to select the same selection as this selection.
+ //
+ if(this.currentViewerPane.getViewer() == this.selectionViewer) {
+ final ArrayList<Object> selectionList = new ArrayList<Object>();
+ selectionList.add(selectedElement);
+ while(selectedElements.hasNext()) {
+ selectionList.add(selectedElements.next());
+ }
+
+ // Set the selection to the widget.
+ //
+ this.selectionViewer.setSelection(new StructuredSelection(selectionList));
+ } else {
+ // Set the input to the widget.
+ //
+ if(this.currentViewerPane.getViewer().getInput() != selectedElement) {
+ this.currentViewerPane.getViewer().setInput(selectedElement);
+ this.currentViewerPane.setTitle(selectedElement);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply tests the command stack.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean isDirty() {
+ return ((BasicCommandStack)this.editingDomain.getCommandStack()).isSaveNeeded();
+ }
+
+ /**
+ * This is for implementing {@link IEditorPart} and simply saves the model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void doSave(final IProgressMonitor progressMonitor) {
+ // Save only resources that have actually changed.
+ //
+ final Map<Object, Object> saveOptions = new HashMap<Object, Object>();
+ saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
+
+ // Do the work within an operation because this is a long running activity that modifies the workbench.
+ //
+ final WorkspaceModifyOperation operation = new WorkspaceModifyOperation() {
+
+ // This is the method that gets invoked when the operation runs.
+ //
+ @Override
+ public void execute(final IProgressMonitor monitor) {
+ // Save the resources to the file system.
+ //
+ boolean first = true;
+ for(final Resource resource : PapyrustableconfigurationEditor.this.editingDomain.getResourceSet().getResources()) {
+ if((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !PapyrustableconfigurationEditor.this.editingDomain.isReadOnly(resource)) {
+ try {
+ final long timeStamp = resource.getTimeStamp();
+ resource.save(saveOptions);
+ if(resource.getTimeStamp() != timeStamp) {
+ PapyrustableconfigurationEditor.this.savedResources.add(resource);
+ }
+ } catch (final Exception exception) {
+ PapyrustableconfigurationEditor.this.resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
+ }
+ first = false;
+ }
+ }
+ }
+ };
+
+ this.updateProblemIndication = false;
+ try {
+ // This runs the options, and shows progress.
+ //
+ new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);
+
+ // Refresh the necessary state.
+ //
+ ((BasicCommandStack)this.editingDomain.getCommandStack()).saveIsDone();
+ firePropertyChange(IEditorPart.PROP_DIRTY);
+ } catch (final Exception exception) {
+ // Something went wrong that shouldn't.
+ //
+ PapyrustableconfigurationEditorPlugin.INSTANCE.log(exception);
+ }
+ this.updateProblemIndication = true;
+ updateProblemIndication();
+ }
+
+ /**
+ * This returns whether something has been persisted to the URI of the specified resource.
+ * The implementation uses the URI converter from the editor's resource set to try to open an input stream.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected boolean isPersisted(final Resource resource) {
+ boolean result = false;
+ try {
+ final InputStream stream = this.editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
+ if(stream != null) {
+ result = true;
+ stream.close();
+ }
+ } catch (final IOException e) {
+ // Ignore
+ }
+ return result;
+ }
+
+ /**
+ * This always returns true because it is not currently supported.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public boolean isSaveAsAllowed() {
+ return true;
+ }
+
+ /**
+ * This also changes the editor's input.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void doSaveAs() {
+ final SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
+ saveAsDialog.open();
+ final IPath path = saveAsDialog.getResult();
+ if(path != null) {
+ final IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ if(file != null) {
+ doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected void doSaveAs(final URI uri, final IEditorInput editorInput) {
+ (this.editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ final IProgressMonitor progressMonitor = getActionBars().getStatusLineManager() != null ? getActionBars().getStatusLineManager().getProgressMonitor() : new NullProgressMonitor();
+ doSave(progressMonitor);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void gotoMarker(final IMarker marker) {
+ try {
+ if(marker.getType().equals(EValidator.MARKER)) {
+ final String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
+ if(uriAttribute != null) {
+ final URI uri = URI.createURI(uriAttribute);
+ final EObject eObject = this.editingDomain.getResourceSet().getEObject(uri, true);
+ if(eObject != null) {
+ setSelectionToViewer(Collections.singleton(this.editingDomain.getWrapper(eObject)));
+ }
+ }
+ }
+ } catch (final CoreException exception) {
+ PapyrustableconfigurationEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+
+ /**
+ * This is called during startup.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void init(final IEditorSite site, final IEditorInput editorInput) {
+ setSite(site);
+ setInputWithNotify(editorInput);
+ setPartName(editorInput.getName());
+ site.setSelectionProvider(this);
+ site.getPage().addPartListener(this.partListener);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(this.resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void setFocus() {
+ if(this.currentViewerPane != null) {
+ this.currentViewerPane.setFocus();
+ } else {
+ getControl(getActivePage()).setFocus();
+ }
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void addSelectionChangedListener(final ISelectionChangedListener listener) {
+ this.selectionChangedListeners.add(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void removeSelectionChangedListener(final ISelectionChangedListener listener) {
+ this.selectionChangedListeners.remove(listener);
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public ISelection getSelection() {
+ return this.editorSelection;
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection.
+ * Calling this result will notify the listeners.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setSelection(final ISelection selection) {
+ this.editorSelection = selection;
+
+ for(final ISelectionChangedListener listener : this.selectionChangedListeners) {
+ listener.selectionChanged(new SelectionChangedEvent(this, selection));
+ }
+ setStatusLineManager(selection);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setStatusLineManager(final ISelection selection) {
+ final IStatusLineManager statusLineManager = this.currentViewer != null && this.currentViewer == this.contentOutlineViewer ? this.contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
+
+ if(statusLineManager != null) {
+ if(selection instanceof IStructuredSelection) {
+ final Collection<?> collection = ((IStructuredSelection)selection).toList();
+ switch(collection.size()) {
+ case 0:
+ {
+ statusLineManager.setMessage(getString("_UI_NoObjectSelected")); //$NON-NLS-1$
+ break;
+ }
+ case 1:
+ {
+ final String text = new AdapterFactoryItemDelegator(this.adapterFactory).getText(collection.iterator().next());
+ statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); //$NON-NLS-1$
+ break;
+ }
+ default:
+ {
+ statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size()))); //$NON-NLS-1$
+ break;
+ }
+ }
+ } else {
+ statusLineManager.setMessage(""); //$NON-NLS-1$
+ }
+ }
+ }
+
+ /**
+ * This looks up a string in the plugin's plugin.properties file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private static String getString(final String key) {
+ return PapyrustableconfigurationEditorPlugin.INSTANCE.getString(key);
+ }
+
+ /**
+ * This looks up a string in plugin.properties, making a substitution.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private static String getString(final String key, final Object s1) {
+ return PapyrustableconfigurationEditorPlugin.INSTANCE.getString(key, new Object[]{ s1 });
+ }
+
+ /**
+ * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void menuAboutToShow(final IMenuManager menuManager) {
+ ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EditingDomainActionBarContributor getActionBarContributor() {
+ return (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public IActionBars getActionBars() {
+ return getActionBarContributor().getActionBars();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public AdapterFactory getAdapterFactory() {
+ return this.adapterFactory;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ public void dispose() {
+ this.updateProblemIndication = false;
+
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(this.resourceChangeListener);
+
+ getSite().getPage().removePartListener(this.partListener);
+
+ this.adapterFactory.dispose();
+
+ if(getActionBarContributor().getActiveEditor() == this) {
+ getActionBarContributor().setActiveEditor(null);
+ }
+
+ if(this.propertySheetPage != null) {
+ this.propertySheetPage.dispose();
+ }
+
+ if(this.contentOutlinePage != null) {
+ this.contentOutlinePage.dispose();
+ }
+
+ super.dispose();
+ }
+
+ /**
+ * Returns whether the outline view should be presented to the user.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected boolean showOutlineView() {
+ return true;
+ }
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationEditorPlugin.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationEditorPlugin.java new file mode 100644 index 00000000000..a1faac3158e --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationEditorPlugin.java @@ -0,0 +1,112 @@ +/**
+ * 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
+ * ttp://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.papyrustableconfiguration.metamodel.papyrustableconfiguration.presentation;
+
+import org.eclipse.emf.common.EMFPlugin;
+import org.eclipse.emf.common.ui.EclipseUIPlugin;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.provider.EcoreEditPlugin;
+import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.provider.CustomEditPlugin;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.provider.Efacet2EditPlugin;
+import org.eclipse.emf.facet.widgets.celleditors.edit.CelleditorsEditPlugin;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.provider.PapyrustableEditPlugin;
+
+/**
+ * This is the central singleton for the Papyrustableconfiguration editor plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public final class PapyrustableconfigurationEditorPlugin extends EMFPlugin {
+
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static final PapyrustableconfigurationEditorPlugin INSTANCE = new PapyrustableconfigurationEditorPlugin();
+
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private static Implementation plugin;
+
+ /**
+ * Create the instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
+ public PapyrustableconfigurationEditorPlugin() {
+ super(new ResourceLocator[]{ CelleditorsEditPlugin.INSTANCE, CustomEditPlugin.INSTANCE, EcoreEditPlugin.INSTANCE, Efacet2EditPlugin.INSTANCE, PapyrustableEditPlugin.INSTANCE, });
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return the singleton instance.
+ * @generated
+ */
+ @Override
+ public ResourceLocator getPluginResourceLocator() {
+ return plugin;
+ }
+
+ /**
+ * Returns the singleton instance of the Eclipse plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @return the singleton instance.
+ * @generated
+ */
+ public static Implementation getPlugin() {
+ return plugin;
+ }
+
+ /**
+ * The actual implementation of the Eclipse <b>Plugin</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public static class Implementation extends EclipseUIPlugin {
+
+ /**
+ * Creates an instance.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Implementation() {
+ super();
+
+ // Remember the static instance.
+ //
+ plugin = this;
+ }
+ }
+
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationModelWizard.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationModelWizard.java new file mode 100644 index 00000000000..fb0a7013f67 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/presentation/PapyrustableconfigurationModelWizard.java @@ -0,0 +1,614 @@ +/**
+ * 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
+ * ttp://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.papyrustableconfiguration.metamodel.papyrustableconfiguration.presentation;
+
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.common.CommonPlugin;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrustableconfigurationFactory;
+import org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrustableconfigurationPackage;
+import org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.provider.PapyrustableconfigurationEditPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.part.ISetSelectionTarget;
+
+
+/**
+ * This is a simple wizard for creating a new model file.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PapyrustableconfigurationModelWizard extends Wizard implements INewWizard {
+ /**
+ * The supported extensions for created files.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final List<String> FILE_EXTENSIONS =
+ Collections.unmodifiableList(Arrays.asList(PapyrustableconfigurationEditorPlugin.INSTANCE.getString("_UI_PapyrustableconfigurationEditorFilenameExtensions").split("\\s*,\\s*"))); //$NON-NLS-1$ //$NON-NLS-2$
+
+ /**
+ * A formatted list of supported file extensions, suitable for display.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String FORMATTED_FILE_EXTENSIONS =
+ PapyrustableconfigurationEditorPlugin.INSTANCE.getString("_UI_PapyrustableconfigurationEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ /**
+ * This caches an instance of the model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrustableconfigurationPackage papyrustableconfigurationPackage = PapyrustableconfigurationPackage.eINSTANCE;
+
+ /**
+ * This caches an instance of the model factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrustableconfigurationFactory papyrustableconfigurationFactory = papyrustableconfigurationPackage.getPapyrustableconfigurationFactory();
+
+ /**
+ * This is the file creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrustableconfigurationModelWizardNewFileCreationPage newFileCreationPage;
+
+ /**
+ * This is the initial object creation page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrustableconfigurationModelWizardInitialObjectCreationPage initialObjectCreationPage;
+
+ /**
+ * Remember the selection during initialization for populating the default container.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IStructuredSelection selection;
+
+ /**
+ * Remember the workbench during initialization.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected IWorkbench workbench;
+
+ /**
+ * Caches the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<String> initialObjectNames;
+
+ /**
+ * This just records the information.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.workbench = workbench;
+ this.selection = selection;
+ setWindowTitle(PapyrustableconfigurationEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); //$NON-NLS-1$
+ setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(PapyrustableconfigurationEditorPlugin.INSTANCE.getImage("full/wizban/NewPapyrustableconfiguration"))); //$NON-NLS-1$
+ }
+
+ /**
+ * Returns the names of the types that can be created as the root object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getInitialObjectNames() {
+ if (initialObjectNames == null) {
+ initialObjectNames = new ArrayList<String>();
+ for (EClassifier eClassifier : papyrustableconfigurationPackage.getEClassifiers()) {
+ if (eClassifier instanceof EClass) {
+ EClass eClass = (EClass)eClassifier;
+ if (!eClass.isAbstract()) {
+ initialObjectNames.add(eClass.getName());
+ }
+ }
+ }
+ Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator());
+ }
+ return initialObjectNames;
+ }
+
+ /**
+ * Create a new model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EObject createInitialModel() {
+ EClass eClass = (EClass)papyrustableconfigurationPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
+ EObject rootObject = papyrustableconfigurationFactory.create(eClass);
+ return rootObject;
+ }
+
+ /**
+ * Do the work after everything is specified.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean performFinish() {
+ try {
+ // Remember the file.
+ //
+ final IFile modelFile = getModelFile();
+
+ // Do the work within an operation.
+ //
+ WorkspaceModifyOperation operation =
+ new WorkspaceModifyOperation() {
+ @Override
+ protected void execute(IProgressMonitor progressMonitor) {
+ try {
+ // Create a resource set
+ //
+ ResourceSet resourceSet = new ResourceSetImpl();
+
+ // Get the URI of the model file.
+ //
+ URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true);
+
+ // Create a resource for this file.
+ //
+ Resource resource = resourceSet.createResource(fileURI);
+
+ // Add the initial model object to the contents.
+ //
+ EObject rootObject = createInitialModel();
+ if (rootObject != null) {
+ resource.getContents().add(rootObject);
+ }
+
+ // Save the contents of the resource to the file system.
+ //
+ Map<Object, Object> options = new HashMap<Object, Object>();
+ options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding());
+ resource.save(options);
+ }
+ catch (Exception exception) {
+ PapyrustableconfigurationEditorPlugin.INSTANCE.log(exception);
+ }
+ finally {
+ progressMonitor.done();
+ }
+ }
+ };
+
+ getContainer().run(false, false, operation);
+
+ // Select the new file resource in the current view.
+ //
+ IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page = workbenchWindow.getActivePage();
+ final IWorkbenchPart activePart = page.getActivePart();
+ if (activePart instanceof ISetSelectionTarget) {
+ final ISelection targetSelection = new StructuredSelection(modelFile);
+ getShell().getDisplay().asyncExec
+ (new Runnable() {
+ public void run() {
+ ((ISetSelectionTarget)activePart).selectReveal(targetSelection);
+ }
+ });
+ }
+
+ // Open an editor on the new file.
+ //
+ try {
+ page.openEditor
+ (new FileEditorInput(modelFile),
+ workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId());
+ }
+ catch (PartInitException exception) {
+ MessageDialog.openError(workbenchWindow.getShell(), PapyrustableconfigurationEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); //$NON-NLS-1$
+ return false;
+ }
+
+ return true;
+ }
+ catch (Exception exception) {
+ PapyrustableconfigurationEditorPlugin.INSTANCE.log(exception);
+ return false;
+ }
+ }
+
+ /**
+ * This is the one page of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class PapyrustableconfigurationModelWizardNewFileCreationPage extends WizardNewFileCreationPage {
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrustableconfigurationModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) {
+ super(pageId, selection);
+ }
+
+ /**
+ * The framework calls this to see if the file is correct.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean validatePage() {
+ if (super.validatePage()) {
+ String extension = new Path(getFileName()).getFileExtension();
+ if (extension == null || !FILE_EXTENSIONS.contains(extension)) {
+ String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension"; //$NON-NLS-1$ //$NON-NLS-2$
+ setErrorMessage(PapyrustableconfigurationEditorPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS }));
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName()));
+ }
+ }
+
+ /**
+ * This is the page where the type of object to create is selected.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public class PapyrustableconfigurationModelWizardInitialObjectCreationPage extends WizardPage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo initialObjectField;
+
+ /**
+ * @generated
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ */
+ protected List<String> encodings;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Combo encodingField;
+
+ /**
+ * Pass in the selection.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrustableconfigurationModelWizardInitialObjectCreationPage(String pageId) {
+ super(pageId);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ {
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.verticalSpacing = 12;
+ composite.setLayout(layout);
+
+ GridData data = new GridData();
+ data.verticalAlignment = GridData.FILL;
+ data.grabExcessVerticalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ composite.setLayoutData(data);
+ }
+
+ Label containerLabel = new Label(composite, SWT.LEFT);
+ {
+ containerLabel.setText(PapyrustableconfigurationEditorPlugin.INSTANCE.getString("_UI_ModelObject")); //$NON-NLS-1$
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ containerLabel.setLayoutData(data);
+ }
+
+ initialObjectField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ initialObjectField.setLayoutData(data);
+ }
+
+ for (String objectName : getInitialObjectNames()) {
+ initialObjectField.add(getLabel(objectName));
+ }
+
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.select(0);
+ }
+ initialObjectField.addModifyListener(validator);
+
+ Label encodingLabel = new Label(composite, SWT.LEFT);
+ {
+ encodingLabel.setText(PapyrustableconfigurationEditorPlugin.INSTANCE.getString("_UI_XMLEncoding")); //$NON-NLS-1$
+
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ encodingLabel.setLayoutData(data);
+ }
+ encodingField = new Combo(composite, SWT.BORDER);
+ {
+ GridData data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.grabExcessHorizontalSpace = true;
+ encodingField.setLayoutData(data);
+ }
+
+ for (String encoding : getEncodings()) {
+ encodingField.add(encoding);
+ }
+
+ encodingField.select(0);
+ encodingField.addModifyListener(validator);
+
+ setPageComplete(validatePage());
+ setControl(composite);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ModifyListener validator =
+ new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ setPageComplete(validatePage());
+ }
+ };
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected boolean validatePage() {
+ return getInitialObjectName() != null && getEncodings().contains(encodingField.getText());
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (visible) {
+ if (initialObjectField.getItemCount() == 1) {
+ initialObjectField.clearSelection();
+ encodingField.setFocus();
+ }
+ else {
+ encodingField.clearSelection();
+ initialObjectField.setFocus();
+ }
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getInitialObjectName() {
+ String label = initialObjectField.getText();
+
+ for (String name : getInitialObjectNames()) {
+ if (getLabel(name).equals(label)) {
+ return name;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getEncoding() {
+ return encodingField.getText();
+ }
+
+ /**
+ * Returns the label for the specified type name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected String getLabel(String typeName) {
+ try {
+ return PapyrustableconfigurationEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ catch(MissingResourceException mre) {
+ PapyrustableconfigurationEditorPlugin.INSTANCE.log(mre);
+ }
+ return typeName;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Collection<String> getEncodings() {
+ if (encodings == null) {
+ encodings = new ArrayList<String>();
+ for (StringTokenizer stringTokenizer = new StringTokenizer(PapyrustableconfigurationEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens(); ) //$NON-NLS-1$
+ {
+ encodings.add(stringTokenizer.nextToken());
+ }
+ }
+ return encodings;
+ }
+ }
+
+ /**
+ * The framework calls this to create the contents of the wizard.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void addPages() {
+ // Create a page, set the title, and the initial model file name.
+ //
+ newFileCreationPage = new PapyrustableconfigurationModelWizardNewFileCreationPage("Whatever", selection); //$NON-NLS-1$
+ newFileCreationPage.setTitle(PapyrustableconfigurationEditorPlugin.INSTANCE.getString("_UI_PapyrustableconfigurationModelWizard_label")); //$NON-NLS-1$
+ newFileCreationPage.setDescription(PapyrustableconfigurationEditorPlugin.INSTANCE.getString("_UI_PapyrustableconfigurationModelWizard_description")); //$NON-NLS-1$
+ newFileCreationPage.setFileName(PapyrustableconfigurationEditorPlugin.INSTANCE.getString("_UI_PapyrustableconfigurationEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0)); //$NON-NLS-1$ //$NON-NLS-2$
+ addPage(newFileCreationPage);
+
+ // Try and get the resource selection to determine a current directory for the file dialog.
+ //
+ if (selection != null && !selection.isEmpty()) {
+ // Get the resource...
+ //
+ Object selectedElement = selection.iterator().next();
+ if (selectedElement instanceof IResource) {
+ // Get the resource parent, if its a file.
+ //
+ IResource selectedResource = (IResource)selectedElement;
+ if (selectedResource.getType() == IResource.FILE) {
+ selectedResource = selectedResource.getParent();
+ }
+
+ // This gives us a directory...
+ //
+ if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
+ // Set this for the container.
+ //
+ newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());
+
+ // Make up a unique new name here.
+ //
+ String defaultModelBaseFilename = PapyrustableconfigurationEditorPlugin.INSTANCE.getString("_UI_PapyrustableconfigurationEditorFilenameDefaultBase"); //$NON-NLS-1$
+ String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
+ String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension; //$NON-NLS-1$
+ for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i) {
+ modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension; //$NON-NLS-1$
+ }
+ newFileCreationPage.setFileName(modelFilename);
+ }
+ }
+ }
+ initialObjectCreationPage = new PapyrustableconfigurationModelWizardInitialObjectCreationPage("Whatever2"); //$NON-NLS-1$
+ initialObjectCreationPage.setTitle(PapyrustableconfigurationEditorPlugin.INSTANCE.getString("_UI_PapyrustableconfigurationModelWizard_label")); //$NON-NLS-1$
+ initialObjectCreationPage.setDescription(PapyrustableconfigurationEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description")); //$NON-NLS-1$
+ addPage(initialObjectCreationPage);
+ }
+
+ /**
+ * Get the file from the page.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public IFile getModelFile() {
+ return newFileCreationPage.getModelFile();
+ }
+
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/.classpath b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/.classpath new file mode 100644 index 00000000000..cedf0d0d0b5 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src-gen"/>
+ <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/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/.project b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/.project new file mode 100644 index 00000000000..0564fe1e1ec --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/META-INF/MANIFEST.MF b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..4262eeaf541 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/META-INF/MANIFEST.MF @@ -0,0 +1,21 @@ +Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel;singleton:=true
+Bundle-Version: 0.9.0.qualifier
+Bundle-ClassPath: .
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package:
+ org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration,
+ org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.impl,
+ org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.util
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.ecore;visibility:=reexport,
+ org.eclipse.emf.facet.widgets.celleditors;visibility:=reexport,
+ org.eclipse.emf.facet.custom.metamodel;visibility:=reexport,
+ org.eclipse.emf.facet.efacet.metamodel;visibility:=reexport,
+ org.eclipse.papyrus.infra.table.efacet.metamodel;visibility:=reexport,
+ org.eclipse.emf.facet.widgets.table.metamodel;visibility:=reexport
+Bundle-ActivationPolicy: lazy
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/about.html b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/about.html new file mode 100644 index 00000000000..82d49bf5f81 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/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 ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). 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, "Program" 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 ("Redistributor") 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/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/build.properties b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/build.properties new file mode 100644 index 00000000000..3de35d375d1 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/build.properties @@ -0,0 +1,19 @@ +# 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
+# ttp://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+
+bin.includes = .,\
+ model/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties
+jars.compile.order = .
+source.. = src-gen/
+output.. = bin/
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/documentation.pdoc b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/documentation.pdoc new file mode 100644 index 00000000000..40c207632b9 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/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 provides the metamodel used in Papyrus for the Papyrus table configuration.">
+ <referent firstName="vincent" lastName="lorenzo" eMail="vincent.lorenzo@cea.fr" currentCompany="CEA-LIST"/>
+</doc:Documentation>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/model/papyrustableconfiguration.ecore b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/model/papyrustableconfiguration.ecore new file mode 100644 index 00000000000..451aab86ad6 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/model/papyrustableconfiguration.ecore @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="papyrustableconfiguration" nsURI="http://www.eclipse.org/Papyrus/PapyrusTableConfiguration/0.9.0/papyrustableconfiguration"
+ nsPrefix="org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="This package contains the model used in Papyrus to configure a PapyrusTableInstance2"/>
+ </eAnnotations>
+ <eClassifiers xsi:type="ecore:EClass" name="PapyrusTableConfiguration" eSuperTypes="http://www.eclipse.org/emf/2002/Ecore#//EModelElement">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="This element registers the parameters to configure a PapyrusTableInstance2"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="fillingMode" ordered="false"
+ eType="ecore:EEnum platform:/plugin/org.eclipse.papyrus.infra.table.efacet.metamodel/model/papyrustable.ecore#//FillingMode">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="This field allows to define the filling mode to use when the table is created."/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="fillingQueries" upperBound="-1"
+ eType="ecore:EClass platform:/plugin/org.eclipse.emf.facet.efacet.metamodel/model/efacet-0.2.0.ecore#//extensible/Query">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="This list registers the queries used to fill the PapyrusTable when it is in Queries Mode"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="listenFeature" eType="ecore:EClass platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EStructuralFeature">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="This field references the feature of the context of the table to listen, when the table in is Feature Mode"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="tableConfiguration" eType="ecore:EClass platform:/plugin/org.eclipse.emf.facet.widgets.table.metamodel/model/tableConfiguration-0.2.0.ecore#//TableConfiguration"
+ containment="true">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="This field references the emf-facet table configuration."/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/model/papyrustableconfiguration.genmodel b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/model/papyrustableconfiguration.genmodel new file mode 100644 index 00000000000..3579c06aae0 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/model/papyrustableconfiguration.genmodel @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="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
ttp://www.eclipse.org/legal/epl-v10.html

Contributors:
 Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation"
+ modelDirectory="/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen"
+ editDirectory="/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit/src-gen"
+ editorDirectory="/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor/src-gen"
+ modelPluginID="org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel"
+ modelName="Papyrustableconfiguration" nonNLSMarkers="true" importerID="org.eclipse.emf.importer.ecore"
+ complianceLevel="5.0" copyrightFields="false" editPluginID="org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.edit"
+ editorPluginID="org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.editor"
+ language="" usedGenPackages="platform:/plugin/org.eclipse.emf.facet.widgets.celleditors/model/celleditors.genmodel#//modelCellEditor platform:/plugin/org.eclipse.emf.facet.custom.metamodel/model/custom-0.2.0.genmodel#//custom platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore platform:/plugin/org.eclipse.emf.facet.efacet.metamodel/model/efacet-0.2.0.genmodel#//efacet platform:/plugin/org.eclipse.papyrus.infra.table.efacet.metamodel/model/papyrustable.genmodel#//papyrustable platform:/plugin/org.eclipse.emf.facet.widgets.table.metamodel/model/tableConfiguration-0.2.0.genmodel#//tableconfiguration platform:/plugin/org.eclipse.emf.facet.widgets.table.metamodel/model/table-0.2.0.genmodel#//table">
+ <foreignModel>papyrustableconfiguration.ecore</foreignModel>
+ <genPackages prefix="Papyrustableconfiguration" basePackage="org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel"
+ disposableProviderFactory="true" ecorePackage="papyrustableconfiguration.ecore#/">
+ <genClasses ecoreClass="papyrustableconfiguration.ecore#//PapyrusTableConfiguration">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute papyrustableconfiguration.ecore#//PapyrusTableConfiguration/fillingMode"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference papyrustableconfiguration.ecore#//PapyrusTableConfiguration/fillingQueries"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference papyrustableconfiguration.ecore#//PapyrusTableConfiguration/listenFeature"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference papyrustableconfiguration.ecore#//PapyrusTableConfiguration/tableConfiguration"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/plugin.properties b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/plugin.properties new file mode 100644 index 00000000000..ba08677260b --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/plugin.properties @@ -0,0 +1,13 @@ +# 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
+# ttp://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+
+pluginName = Papyrustableconfiguration Model
+providerName = www.example.org
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/plugin.xml b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/plugin.xml new file mode 100644 index 00000000000..50438105394 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/plugin.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+ 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
+ ttp://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <package
+ uri="http://www.eclipse.org/Papyrus/PapyrusTableConfiguration/0.9.0/papyrustableconfiguration"
+ class="org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.impl.PapyrustableconfigurationPackageImpl"
+ genModel="model/papyrustableconfiguration.genmodel"/>
+ </extension>
+
+</plugin>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/PapyrusTableConfiguration.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/PapyrusTableConfiguration.java new file mode 100644 index 00000000000..94e65332faf --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/PapyrusTableConfiguration.java @@ -0,0 +1,167 @@ +/**
+ * 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
+ * ttp://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.papyrustableconfiguration.metamodel.papyrustableconfiguration;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.tableconfiguration.TableConfiguration;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.FillingMode;
+
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Papyrus Table Configuration</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <!-- begin-model-doc -->
+ * This element registers the parameters to configure a PapyrusTableInstance2
+ * <!-- end-model-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>
+ * {@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration#getFillingMode
+ * <em>Filling Mode</em>}</li>
+ * <li>
+ * {@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration#getFillingQueries
+ * <em>Filling Queries</em>}</li>
+ * <li>
+ * {@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration#getListenFeature
+ * <em>Listen Feature</em>}</li>
+ * <li>
+ * {@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration#getTableConfiguration
+ * <em>Table Configuration</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrustableconfigurationPackage#getPapyrusTableConfiguration()
+ * @model
+ * @generated
+ */
+public interface PapyrusTableConfiguration extends EObject, EModelElement {
+
+ /**
+ * Returns the value of the '<em><b>Filling Mode</b></em>' attribute.
+ * The literals are from the enumeration {@link org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.FillingMode}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * This field allows to define the filling mode to use when the table is created.
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Filling Mode</em>' attribute.
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.FillingMode
+ * @see #setFillingMode(FillingMode)
+ * @see org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrustableconfigurationPackage#getPapyrusTableConfiguration_FillingMode()
+ * @model ordered="false"
+ * @generated
+ */
+ FillingMode getFillingMode();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration#getFillingMode
+ * <em>Filling Mode</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Filling Mode</em>' attribute.
+ * @see org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.FillingMode
+ * @see #getFillingMode()
+ * @generated
+ */
+ void setFillingMode(FillingMode value);
+
+ /**
+ * Returns the value of the '<em><b>Filling Queries</b></em>' reference list.
+ * The list contents are of type {@link org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * This list registers the queries used to fill the PapyrusTable when it is in Queries Mode
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Filling Queries</em>' reference list.
+ * @see org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrustableconfigurationPackage#getPapyrusTableConfiguration_FillingQueries()
+ * @model
+ * @generated
+ */
+ EList<Query> getFillingQueries();
+
+ /**
+ * Returns the value of the '<em><b>Listen Feature</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * This field references the feature of the context of the table to listen, when the table in is Feature Mode
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Listen Feature</em>' reference.
+ * @see #setListenFeature(EStructuralFeature)
+ * @see org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrustableconfigurationPackage#getPapyrusTableConfiguration_ListenFeature()
+ * @model
+ * @generated
+ */
+ EStructuralFeature getListenFeature();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration#getListenFeature
+ * <em>Listen Feature</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Listen Feature</em>' reference.
+ * @see #getListenFeature()
+ * @generated
+ */
+ void setListenFeature(EStructuralFeature value);
+
+ /**
+ * Returns the value of the '<em><b>Table Configuration</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * This field references the emf-facet table configuration.
+ * <!-- end-model-doc -->
+ *
+ * @return the value of the '<em>Table Configuration</em>' containment reference.
+ * @see #setTableConfiguration(TableConfiguration)
+ * @see org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrustableconfigurationPackage#getPapyrusTableConfiguration_TableConfiguration()
+ * @model containment="true"
+ * @generated
+ */
+ TableConfiguration getTableConfiguration();
+
+ /**
+ * Sets the value of the '
+ * {@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration#getTableConfiguration
+ * <em>Table Configuration</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Table Configuration</em>' containment reference.
+ * @see #getTableConfiguration()
+ * @generated
+ */
+ void setTableConfiguration(TableConfiguration value);
+
+} // PapyrusTableConfiguration
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/PapyrustableconfigurationFactory.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/PapyrustableconfigurationFactory.java new file mode 100644 index 00000000000..c10335eed47 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/PapyrustableconfigurationFactory.java @@ -0,0 +1,52 @@ +/**
+ * 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
+ * ttp://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.papyrustableconfiguration.metamodel.papyrustableconfiguration;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrustableconfigurationPackage
+ * @generated
+ */
+public interface PapyrustableconfigurationFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ PapyrustableconfigurationFactory eINSTANCE = org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.impl.PapyrustableconfigurationFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Papyrus Table Configuration</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Papyrus Table Configuration</em>'.
+ * @generated
+ */
+ PapyrusTableConfiguration createPapyrusTableConfiguration();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ PapyrustableconfigurationPackage getPapyrustableconfigurationPackage();
+
+} //PapyrustableconfigurationFactory
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/PapyrustableconfigurationPackage.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/PapyrustableconfigurationPackage.java new file mode 100644 index 00000000000..5dde77272d2 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/PapyrustableconfigurationPackage.java @@ -0,0 +1,257 @@ +/**
+ * 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
+ * ttp://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.papyrustableconfiguration.metamodel.papyrustableconfiguration;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EcorePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * <!-- begin-model-doc -->
+ * This package contains the model used in Papyrus to configure a PapyrusTableInstance2
+ * <!-- end-model-doc -->
+ * @see org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrustableconfigurationFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface PapyrustableconfigurationPackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "papyrustableconfiguration"; //$NON-NLS-1$
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.eclipse.org/Papyrus/PapyrusTableConfiguration/0.9.0/papyrustableconfiguration"; //$NON-NLS-1$
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration"; //$NON-NLS-1$
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ PapyrustableconfigurationPackage eINSTANCE = org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.impl.PapyrustableconfigurationPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.impl.PapyrusTableConfigurationImpl <em>Papyrus Table Configuration</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.impl.PapyrusTableConfigurationImpl
+ * @see org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.impl.PapyrustableconfigurationPackageImpl#getPapyrusTableConfiguration()
+ * @generated
+ */
+ int PAPYRUS_TABLE_CONFIGURATION = 0;
+
+ /**
+ * The feature id for the '<em><b>EAnnotations</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE_CONFIGURATION__EANNOTATIONS = EcorePackage.EMODEL_ELEMENT__EANNOTATIONS;
+
+ /**
+ * The feature id for the '<em><b>Filling Mode</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE_CONFIGURATION__FILLING_MODE = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Filling Queries</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE_CONFIGURATION__FILLING_QUERIES = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Listen Feature</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE_CONFIGURATION__LISTEN_FEATURE = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 2;
+
+ /**
+ * The feature id for the '<em><b>Table Configuration</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE_CONFIGURATION__TABLE_CONFIGURATION = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 3;
+
+ /**
+ * The number of structural features of the '<em>Papyrus Table Configuration</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE_CONFIGURATION_FEATURE_COUNT = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 4;
+
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration <em>Papyrus Table Configuration</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Papyrus Table Configuration</em>'.
+ * @see org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration
+ * @generated
+ */
+ EClass getPapyrusTableConfiguration();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration#getFillingMode <em>Filling Mode</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Filling Mode</em>'.
+ * @see org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration#getFillingMode()
+ * @see #getPapyrusTableConfiguration()
+ * @generated
+ */
+ EAttribute getPapyrusTableConfiguration_FillingMode();
+
+ /**
+ * Returns the meta object for the reference list '{@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration#getFillingQueries <em>Filling Queries</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Filling Queries</em>'.
+ * @see org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration#getFillingQueries()
+ * @see #getPapyrusTableConfiguration()
+ * @generated
+ */
+ EReference getPapyrusTableConfiguration_FillingQueries();
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration#getListenFeature <em>Listen Feature</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Listen Feature</em>'.
+ * @see org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration#getListenFeature()
+ * @see #getPapyrusTableConfiguration()
+ * @generated
+ */
+ EReference getPapyrusTableConfiguration_ListenFeature();
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration#getTableConfiguration <em>Table Configuration</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Table Configuration</em>'.
+ * @see org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration#getTableConfiguration()
+ * @see #getPapyrusTableConfiguration()
+ * @generated
+ */
+ EReference getPapyrusTableConfiguration_TableConfiguration();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ PapyrustableconfigurationFactory getPapyrustableconfigurationFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '{@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.impl.PapyrusTableConfigurationImpl <em>Papyrus Table Configuration</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.impl.PapyrusTableConfigurationImpl
+ * @see org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.impl.PapyrustableconfigurationPackageImpl#getPapyrusTableConfiguration()
+ * @generated
+ */
+ EClass PAPYRUS_TABLE_CONFIGURATION = eINSTANCE.getPapyrusTableConfiguration();
+
+ /**
+ * The meta object literal for the '<em><b>Filling Mode</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PAPYRUS_TABLE_CONFIGURATION__FILLING_MODE = eINSTANCE.getPapyrusTableConfiguration_FillingMode();
+
+ /**
+ * The meta object literal for the '<em><b>Filling Queries</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PAPYRUS_TABLE_CONFIGURATION__FILLING_QUERIES = eINSTANCE.getPapyrusTableConfiguration_FillingQueries();
+
+ /**
+ * The meta object literal for the '<em><b>Listen Feature</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PAPYRUS_TABLE_CONFIGURATION__LISTEN_FEATURE = eINSTANCE.getPapyrusTableConfiguration_ListenFeature();
+
+ /**
+ * The meta object literal for the '<em><b>Table Configuration</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference PAPYRUS_TABLE_CONFIGURATION__TABLE_CONFIGURATION = eINSTANCE.getPapyrusTableConfiguration_TableConfiguration();
+
+ }
+
+} //PapyrustableconfigurationPackage
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/impl/PapyrusTableConfigurationImpl.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/impl/PapyrusTableConfigurationImpl.java new file mode 100644 index 00000000000..f870142ac01 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/impl/PapyrusTableConfigurationImpl.java @@ -0,0 +1,361 @@ +/**
+ * 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
+ * ttp://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.papyrustableconfiguration.metamodel.papyrustableconfiguration.impl;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.EModelElementImpl;
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import org.eclipse.emf.ecore.util.EObjectResolvingEList;
+
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query;
+
+import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.tableconfiguration.TableConfiguration;
+
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.FillingMode;
+
+import org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration;
+import org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrustableconfigurationPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Papyrus Table Configuration</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.impl.PapyrusTableConfigurationImpl#getFillingMode <em>Filling Mode</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.impl.PapyrusTableConfigurationImpl#getFillingQueries <em>Filling Queries</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.impl.PapyrusTableConfigurationImpl#getListenFeature <em>Listen Feature</em>}</li>
+ * <li>{@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.impl.PapyrusTableConfigurationImpl#getTableConfiguration <em>Table Configuration</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class PapyrusTableConfigurationImpl extends EModelElementImpl implements PapyrusTableConfiguration {
+ /**
+ * The default value of the '{@link #getFillingMode() <em>Filling Mode</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getFillingMode()
+ * @generated
+ * @ordered
+ */
+ protected static final FillingMode FILLING_MODE_EDEFAULT = FillingMode.USER;
+
+ /**
+ * The cached value of the '{@link #getFillingMode() <em>Filling Mode</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getFillingMode()
+ * @generated
+ * @ordered
+ */
+ protected FillingMode fillingMode = FILLING_MODE_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getFillingQueries() <em>Filling Queries</em>}' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getFillingQueries()
+ * @generated
+ * @ordered
+ */
+ protected EList<Query> fillingQueries;
+
+ /**
+ * The cached value of the '{@link #getListenFeature() <em>Listen Feature</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getListenFeature()
+ * @generated
+ * @ordered
+ */
+ protected EStructuralFeature listenFeature;
+
+ /**
+ * The cached value of the '{@link #getTableConfiguration() <em>Table Configuration</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTableConfiguration()
+ * @generated
+ * @ordered
+ */
+ protected TableConfiguration tableConfiguration;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrusTableConfigurationImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return PapyrustableconfigurationPackage.Literals.PAPYRUS_TABLE_CONFIGURATION;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public FillingMode getFillingMode() {
+ return fillingMode;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setFillingMode(FillingMode newFillingMode) {
+ FillingMode oldFillingMode = fillingMode;
+ fillingMode = newFillingMode == null ? FILLING_MODE_EDEFAULT : newFillingMode;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__FILLING_MODE, oldFillingMode, fillingMode));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<Query> getFillingQueries() {
+ if (fillingQueries == null) {
+ fillingQueries = new EObjectResolvingEList<Query>(Query.class, this, PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__FILLING_QUERIES);
+ }
+ return fillingQueries;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EStructuralFeature getListenFeature() {
+ if (listenFeature != null && listenFeature.eIsProxy()) {
+ InternalEObject oldListenFeature = (InternalEObject)listenFeature;
+ listenFeature = (EStructuralFeature)eResolveProxy(oldListenFeature);
+ if (listenFeature != oldListenFeature) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__LISTEN_FEATURE, oldListenFeature, listenFeature));
+ }
+ }
+ return listenFeature;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EStructuralFeature basicGetListenFeature() {
+ return listenFeature;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setListenFeature(EStructuralFeature newListenFeature) {
+ EStructuralFeature oldListenFeature = listenFeature;
+ listenFeature = newListenFeature;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__LISTEN_FEATURE, oldListenFeature, listenFeature));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public TableConfiguration getTableConfiguration() {
+ return tableConfiguration;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetTableConfiguration(TableConfiguration newTableConfiguration, NotificationChain msgs) {
+ TableConfiguration oldTableConfiguration = tableConfiguration;
+ tableConfiguration = newTableConfiguration;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__TABLE_CONFIGURATION, oldTableConfiguration, newTableConfiguration);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setTableConfiguration(TableConfiguration newTableConfiguration) {
+ if (newTableConfiguration != tableConfiguration) {
+ NotificationChain msgs = null;
+ if (tableConfiguration != null)
+ msgs = ((InternalEObject)tableConfiguration).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__TABLE_CONFIGURATION, null, msgs);
+ if (newTableConfiguration != null)
+ msgs = ((InternalEObject)newTableConfiguration).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__TABLE_CONFIGURATION, null, msgs);
+ msgs = basicSetTableConfiguration(newTableConfiguration, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__TABLE_CONFIGURATION, newTableConfiguration, newTableConfiguration));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__TABLE_CONFIGURATION:
+ return basicSetTableConfiguration(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__FILLING_MODE:
+ return getFillingMode();
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__FILLING_QUERIES:
+ return getFillingQueries();
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__LISTEN_FEATURE:
+ if (resolve) return getListenFeature();
+ return basicGetListenFeature();
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__TABLE_CONFIGURATION:
+ return getTableConfiguration();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__FILLING_MODE:
+ setFillingMode((FillingMode)newValue);
+ return;
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__FILLING_QUERIES:
+ getFillingQueries().clear();
+ getFillingQueries().addAll((Collection<? extends Query>)newValue);
+ return;
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__LISTEN_FEATURE:
+ setListenFeature((EStructuralFeature)newValue);
+ return;
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__TABLE_CONFIGURATION:
+ setTableConfiguration((TableConfiguration)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__FILLING_MODE:
+ setFillingMode(FILLING_MODE_EDEFAULT);
+ return;
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__FILLING_QUERIES:
+ getFillingQueries().clear();
+ return;
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__LISTEN_FEATURE:
+ setListenFeature((EStructuralFeature)null);
+ return;
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__TABLE_CONFIGURATION:
+ setTableConfiguration((TableConfiguration)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__FILLING_MODE:
+ return fillingMode != FILLING_MODE_EDEFAULT;
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__FILLING_QUERIES:
+ return fillingQueries != null && !fillingQueries.isEmpty();
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__LISTEN_FEATURE:
+ return listenFeature != null;
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION__TABLE_CONFIGURATION:
+ return tableConfiguration != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (fillingMode: "); //$NON-NLS-1$
+ result.append(fillingMode);
+ result.append(')');
+ return result.toString();
+ }
+
+} //PapyrusTableConfigurationImpl
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/impl/PapyrustableconfigurationFactoryImpl.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/impl/PapyrustableconfigurationFactoryImpl.java new file mode 100644 index 00000000000..94a6665ae6e --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/impl/PapyrustableconfigurationFactoryImpl.java @@ -0,0 +1,105 @@ +/**
+ * 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
+ * ttp://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.papyrustableconfiguration.metamodel.papyrustableconfiguration.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+import org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PapyrustableconfigurationFactoryImpl extends EFactoryImpl implements PapyrustableconfigurationFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static PapyrustableconfigurationFactory init() {
+ try {
+ PapyrustableconfigurationFactory thePapyrustableconfigurationFactory = (PapyrustableconfigurationFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/Papyrus/PapyrusTableConfiguration/0.9.0/papyrustableconfiguration"); //$NON-NLS-1$
+ if (thePapyrustableconfigurationFactory != null) {
+ return thePapyrustableconfigurationFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new PapyrustableconfigurationFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrustableconfigurationFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION: return createPapyrusTableConfiguration();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrusTableConfiguration createPapyrusTableConfiguration() {
+ PapyrusTableConfigurationImpl papyrusTableConfiguration = new PapyrusTableConfigurationImpl();
+ return papyrusTableConfiguration;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrustableconfigurationPackage getPapyrustableconfigurationPackage() {
+ return (PapyrustableconfigurationPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static PapyrustableconfigurationPackage getPackage() {
+ return PapyrustableconfigurationPackage.eINSTANCE;
+ }
+
+} //PapyrustableconfigurationFactoryImpl
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/impl/PapyrustableconfigurationPackageImpl.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/impl/PapyrustableconfigurationPackageImpl.java new file mode 100644 index 00000000000..5568048390b --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/impl/PapyrustableconfigurationPackageImpl.java @@ -0,0 +1,238 @@ +/**
+ * 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
+ * ttp://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.papyrustableconfiguration.metamodel.papyrustableconfiguration.impl;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EcorePackage;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.ExtensiblePackage;
+
+import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.tableconfiguration.TableconfigurationPackage;
+
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustablePackage;
+
+import org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration;
+import org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrustableconfigurationFactory;
+import org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrustableconfigurationPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PapyrustableconfigurationPackageImpl extends EPackageImpl implements PapyrustableconfigurationPackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass papyrusTableConfigurationEClass = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * <p>Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrustableconfigurationPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private PapyrustableconfigurationPackageImpl() {
+ super(eNS_URI, PapyrustableconfigurationFactory.eINSTANCE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
+ *
+ * <p>This method is used to initialize {@link PapyrustableconfigurationPackage#eINSTANCE} when that field is accessed.
+ * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static PapyrustableconfigurationPackage init() {
+ if (isInited) return (PapyrustableconfigurationPackage)EPackage.Registry.INSTANCE.getEPackage(PapyrustableconfigurationPackage.eNS_URI);
+
+ // Obtain or create and register package
+ PapyrustableconfigurationPackageImpl thePapyrustableconfigurationPackage = (PapyrustableconfigurationPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof PapyrustableconfigurationPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new PapyrustableconfigurationPackageImpl());
+
+ isInited = true;
+
+ // Initialize simple dependencies
+ PapyrustablePackage.eINSTANCE.eClass();
+
+ // Create package meta-data objects
+ thePapyrustableconfigurationPackage.createPackageContents();
+
+ // Initialize created meta-data
+ thePapyrustableconfigurationPackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ thePapyrustableconfigurationPackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(PapyrustableconfigurationPackage.eNS_URI, thePapyrustableconfigurationPackage);
+ return thePapyrustableconfigurationPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getPapyrusTableConfiguration() {
+ return papyrusTableConfigurationEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPapyrusTableConfiguration_FillingMode() {
+ return (EAttribute)papyrusTableConfigurationEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPapyrusTableConfiguration_FillingQueries() {
+ return (EReference)papyrusTableConfigurationEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPapyrusTableConfiguration_ListenFeature() {
+ return (EReference)papyrusTableConfigurationEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getPapyrusTableConfiguration_TableConfiguration() {
+ return (EReference)papyrusTableConfigurationEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrustableconfigurationFactory getPapyrustableconfigurationFactory() {
+ return (PapyrustableconfigurationFactory)getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createPackageContents() {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ papyrusTableConfigurationEClass = createEClass(PAPYRUS_TABLE_CONFIGURATION);
+ createEAttribute(papyrusTableConfigurationEClass, PAPYRUS_TABLE_CONFIGURATION__FILLING_MODE);
+ createEReference(papyrusTableConfigurationEClass, PAPYRUS_TABLE_CONFIGURATION__FILLING_QUERIES);
+ createEReference(papyrusTableConfigurationEClass, PAPYRUS_TABLE_CONFIGURATION__LISTEN_FEATURE);
+ createEReference(papyrusTableConfigurationEClass, PAPYRUS_TABLE_CONFIGURATION__TABLE_CONFIGURATION);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void initializePackageContents() {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Obtain other dependent packages
+ PapyrustablePackage thePapyrustablePackage = (PapyrustablePackage)EPackage.Registry.INSTANCE.getEPackage(PapyrustablePackage.eNS_URI);
+ ExtensiblePackage theExtensiblePackage = (ExtensiblePackage)EPackage.Registry.INSTANCE.getEPackage(ExtensiblePackage.eNS_URI);
+ EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
+ TableconfigurationPackage theTableconfigurationPackage = (TableconfigurationPackage)EPackage.Registry.INSTANCE.getEPackage(TableconfigurationPackage.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+ papyrusTableConfigurationEClass.getESuperTypes().add(ecorePackage.getEModelElement());
+
+ // Initialize classes and features; add operations and parameters
+ initEClass(papyrusTableConfigurationEClass, PapyrusTableConfiguration.class, "PapyrusTableConfiguration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
+ initEAttribute(getPapyrusTableConfiguration_FillingMode(), thePapyrustablePackage.getFillingMode(), "fillingMode", null, 0, 1, PapyrusTableConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$
+ initEReference(getPapyrusTableConfiguration_FillingQueries(), theExtensiblePackage.getQuery(), null, "fillingQueries", null, 0, -1, PapyrusTableConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEReference(getPapyrusTableConfiguration_ListenFeature(), theEcorePackage.getEStructuralFeature(), null, "listenFeature", null, 0, 1, PapyrusTableConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEReference(getPapyrusTableConfiguration_TableConfiguration(), theTableconfigurationPackage.getTableConfiguration(), null, "tableConfiguration", null, 0, 1, PapyrusTableConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+
+ // Create resource
+ createResource(eNS_URI);
+ }
+
+} //PapyrustableconfigurationPackageImpl
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/util/PapyrustableconfigurationAdapterFactory.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/util/PapyrustableconfigurationAdapterFactory.java new file mode 100644 index 00000000000..10e4f9e8dbf --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/util/PapyrustableconfigurationAdapterFactory.java @@ -0,0 +1,149 @@ +/**
+ * 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
+ * ttp://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.papyrustableconfiguration.metamodel.papyrustableconfiguration.util;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrustableconfigurationPackage
+ * @generated
+ */
+public class PapyrustableconfigurationAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static PapyrustableconfigurationPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrustableconfigurationAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = PapyrustableconfigurationPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ @Override
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch that delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrustableconfigurationSwitch<Adapter> modelSwitch =
+ new PapyrustableconfigurationSwitch<Adapter>() {
+ @Override
+ public Adapter casePapyrusTableConfiguration(PapyrusTableConfiguration object) {
+ return createPapyrusTableConfigurationAdapter();
+ }
+ @Override
+ public Adapter caseEModelElement(EModelElement object) {
+ return createEModelElementAdapter();
+ }
+ @Override
+ public Adapter defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ @Override
+ public Adapter createAdapter(Notifier target) {
+ return modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration <em>Papyrus Table Configuration</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration
+ * @generated
+ */
+ public Adapter createPapyrusTableConfigurationAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecore.EModelElement <em>EModel Element</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.emf.ecore.EModelElement
+ * @generated
+ */
+ public Adapter createEModelElementAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //PapyrustableconfigurationAdapterFactory
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/util/PapyrustableconfigurationSwitch.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/util/PapyrustableconfigurationSwitch.java new file mode 100644 index 00000000000..b3c435d8b94 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel/src-gen/org/eclipse/papyrus/infra/table/efacet/papyrustableconfiguration/metamodel/papyrustableconfiguration/util/PapyrustableconfigurationSwitch.java @@ -0,0 +1,137 @@ +/**
+ * 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
+ * ttp://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.papyrustableconfiguration.metamodel.papyrustableconfiguration.util;
+
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.Switch;
+
+import org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrustableconfigurationPackage
+ * @generated
+ */
+public class PapyrustableconfigurationSwitch<T> extends Switch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static PapyrustableconfigurationPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrustableconfigurationSwitch() {
+ if (modelPackage == null) {
+ modelPackage = PapyrustableconfigurationPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Checks whether this is a switch for the given package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @parameter ePackage the package in question.
+ * @return whether this is a switch for the given package.
+ * @generated
+ */
+ @Override
+ protected boolean isSwitchFor(EPackage ePackage) {
+ return ePackage == modelPackage;
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ @Override
+ protected T doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case PapyrustableconfigurationPackage.PAPYRUS_TABLE_CONFIGURATION: {
+ PapyrusTableConfiguration papyrusTableConfiguration = (PapyrusTableConfiguration)theEObject;
+ T result = casePapyrusTableConfiguration(papyrusTableConfiguration);
+ if (result == null) result = caseEModelElement(papyrusTableConfiguration);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Papyrus Table Configuration</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Papyrus Table Configuration</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T casePapyrusTableConfiguration(PapyrusTableConfiguration object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EModel Element</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EModel Element</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseEModelElement(EModelElement object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ @Override
+ public T defaultCase(EObject object) {
+ return null;
+ }
+
+} //PapyrustableconfigurationSwitch
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/.classpath b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/.classpath new file mode 100644 index 00000000000..45f024e850e --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/.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/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/.project b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/.project new file mode 100644 index 00000000000..f6616caf598 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/.project @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.table.efacet</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.sdk.core.projectBuilder</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.emf.facet.common.sdk.core.ProjectNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/META-INF/MANIFEST.MF b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..ba44d11ca01 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/META-INF/MANIFEST.MF @@ -0,0 +1,24 @@ +Manifest-Version: 1.0
+Bundle-Name: Facet for TableEFacet (Incubation)
+Bundle-ClassPath: .,bin
+Bundle-Activator: org.eclipse.papyrus.infra.table.efacet.Activator
+Bundle-ManifestVersion: 2
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-SymbolicName: org.eclipse.papyrus.infra.table.efacet;singleton:
+ =true
+Bundle-ActivationPolicy: lazy
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.facet.util.core,
+ org.eclipse.uml2.uml,
+ org.eclipse.emf.ecore,
+ org.eclipse.emf.facet.infra.query.core,
+ org.eclipse.emf.facet.infra.facet.core,
+ org.eclipse.uml2.types,
+ org.eclipse.emf.facet.infra.browser.custom.core,
+ org.eclipse.papyrus.infra.core,
+ com.google.guava,
+ org.eclipse.papyrus.views.modelexplorer,
+ org.eclipse.papyrus.infra.table.efacet.metamodel
+Bundle-Version: 0.9.0.qualifier
+Bundle-Vendor: Eclipse Modeling Project
+
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/build.properties b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/build.properties new file mode 100644 index 00000000000..8de5aeeefd0 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/build.properties @@ -0,0 +1,6 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + resources/ diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/plugin.xml b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/plugin.xml new file mode 100644 index 00000000000..29d66931e5c --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/plugin.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.emf.facet.infra.facet.registration">
+ <facetset
+ file="resources/TableEFacet_Facet.facetSet">
+ </facetset>
+ </extension>
+ <extension
+ point="org.eclipse.emf.facet.infra.query.registration">
+ <modelqueryset
+ file="resources/TableEFacetQuery.querySet">
+ </modelqueryset>
+ </extension>
+ <extension
+ point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
+ <browserCustomization
+ file="resources/TableEFacetCustomization.uiCustom"
+ loadByDefault="true">
+ </browserCustomization>
+ </extension>
+ <extension
+ point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
+ <browserCustomization
+ file="resources/TableEFacet_FacetCustomization.uiCustom"
+ loadByDefault="true">
+ </browserCustomization>
+ </extension>
+
+</plugin>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/resources/TableEFacetCustomization.uiCustom b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/resources/TableEFacetCustomization.uiCustom new file mode 100644 index 00000000000..1ec33961a1f --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/resources/TableEFacetCustomization.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/TableEFacetQuery#GetTableName"/>
+ </defaultValue>
+ </customizedFeatures>
+ <customizedFeatures customizedFeature="icon">
+ <defaultValue xsi:type="uicustom:DerivedFeatureValue">
+ <valueCalculator xsi:type="query:JavaModelQuery" href="emffacet:/query/TableEFacetQuery#GetTableIcon"/>
+ </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/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/resources/TableEFacetQuery.querySet b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/resources/TableEFacetQuery.querySet new file mode 100644 index 00000000000..5c30d185f42 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/resources/TableEFacetQuery.querySet @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="ASCII"?>
+<query:ModelQuerySet xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:query="http://www.eclipse.org/EmfFacet/infra/query/0.8.incubation" name="TableEFacetQuery">
+ <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.efacet.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.efacet.queries.GetContainedTables">
+ <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="GetTableIcon" description="Return the path to the icon of the corresponding table" implementationClassName="org.eclipse.papyrus.infra.table.efacet.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/PapyrusTable/0.9.0/papyrustable#//PapyrusTable"/>
+ </queries>
+ <queries xsi:type="query:JavaModelQuery" name="GetTableName" description="Return the name for the table" implementationClassName="org.eclipse.papyrus.infra.table.efacet.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/PapyrusTable/0.9.0/papyrustable#//PapyrusTable"/>
+ </queries>
+</query:ModelQuerySet>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/resources/TableEFacet_Facet.facetSet b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/resources/TableEFacet_Facet.facetSet new file mode 100644 index 00000000000..df451b68448 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/resources/TableEFacet_Facet.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="TableEFacet_Facet" nsURI="http://www.eclipse.org/papyrus/TableEFacet_Facet" nsPrefix="TableEFacet_Facet">
+ <eClassifiers xsi:type="facet:Facet" name="TableEFacetContainer" 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/TableEFacetQuery#GetContainedTables"/>
+ </eStructuralFeatures>
+ <conditionQuery xsi:type="query:JavaModelQuery" href="emffacet:/query/TableEFacetQuery#IsTableContainer"/>
+ </eClassifiers>
+ <extendedPackage href="http://www.eclipse.org/uml2/4.0.0/UML#/"/>
+</facet:FacetSet>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/resources/TableEFacet_FacetCustomization.uiCustom b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/resources/TableEFacet_FacetCustomization.uiCustom new file mode 100644 index 00000000000..7f3885c6436 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/resources/TableEFacet_FacetCustomization.uiCustom @@ -0,0 +1,13 @@ +<?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/TableEFacet_Facet">
+ <types metaclassName="TableEFacet_Facet.TableEFacetContainer">
+ <references referenceName="tables">
+ <customizedFeatures customizedFeature="label">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="super>Tutu"/>
+ </customizedFeatures>
+ <customizedFeatures customizedFeature="collapseLink">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="true"/>
+ </customizedFeatures>
+ </references>
+ </types>
+</uicustom:MetamodelView>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/src/org/eclipse/papyrus/infra/table/efacet/Activator.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/src/org/eclipse/papyrus/infra/table/efacet/Activator.java new file mode 100644 index 00000000000..333c2d08d68 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/src/org/eclipse/papyrus/infra/table/efacet/Activator.java @@ -0,0 +1,35 @@ +package org.eclipse.papyrus.infra.table.efacet;
+
+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;
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.table.efacet"; //$NON-NLS-1$
+
+ @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/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/src/org/eclipse/papyrus/infra/table/efacet/queries/AbstractEditorContainerQuery.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/src/org/eclipse/papyrus/infra/table/efacet/queries/AbstractEditorContainerQuery.java new file mode 100644 index 00000000000..fd9ec5ca0ea --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/src/org/eclipse/papyrus/infra/table/efacet/queries/AbstractEditorContainerQuery.java @@ -0,0 +1,33 @@ +package org.eclipse.papyrus.infra.table.efacet.queries;
+
+import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
+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.EditorUtils;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
+
+/**
+ *
+ * An abstract class to get the pageMngr
+ *
+ */
+//TODO duplicated code from modelexplorer.views
+//TODO should be refactored and store into an upper plugin like oep.infra.core.xxx
+public abstract class AbstractEditorContainerQuery {//we don't need to implements IJavaModelQuery here
+
+ /**
+ *
+ * @return
+ * @throws ServiceException
+ */
+ protected IPageMngr getPageMngr() throws ServiceException {
+ // pageMngr can't be static, because there is a new IPageMngr each time we open a Papyrus Editor
+ final IMultiDiagramEditor papyrusEditor = EditorUtils.getMultiDiagramEditor();
+ if(papyrusEditor != null) {
+ final ServicesRegistry serviceRegistry = papyrusEditor.getServicesRegistry();
+ return ServiceUtils.getInstance().getIPageMngr(serviceRegistry);
+ }
+ throw new ServiceException("Can't retrieve the IPageMngr"); //$NON-NLS-1$
+ }
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/src/org/eclipse/papyrus/infra/table/efacet/queries/AbstractGetEditorIconQuery.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/src/org/eclipse/papyrus/infra/table/efacet/queries/AbstractGetEditorIconQuery.java new file mode 100644 index 00000000000..bed379fefce --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/src/org/eclipse/papyrus/infra/table/efacet/queries/AbstractGetEditorIconQuery.java @@ -0,0 +1,57 @@ +package org.eclipse.papyrus.infra.table.efacet.queries;
+
+import org.eclipse.papyrus.infra.core.editorsfactory.IPageIconsRegistry;
+import org.eclipse.papyrus.infra.core.editorsfactory.IPageIconsRegistryExtended;
+import org.eclipse.papyrus.infra.core.editorsfactory.PageIconsRegistry;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.utils.EditorUtils;
+
+/**
+ *
+ * An abstract class to get the iconRegistery
+ *
+ */
+//TODO duplicated code from modelexplorer.views
+//TODO should be refactored and store into an upper plugin like oep.infra.core.xxx
+public abstract class AbstractGetEditorIconQuery {//we don't need to implements IJavaModelQuery here
+
+ /**
+ * the icon registry
+ */
+ private static IPageIconsRegistry editorRegistry;
+
+ /**
+ * Get the EditorRegistry used to create editor instances. This default
+ * implementation return the singleton eINSTANCE. This method can be
+ * subclassed to return another registry.
+ *
+ * @return the singleton eINSTANCE of editor registry
+ */
+ protected IPageIconsRegistryExtended getEditorRegistry() {
+ if(editorRegistry == null) {
+ editorRegistry = createEditorRegistry();
+ }
+ if(!(editorRegistry instanceof IPageIconsRegistryExtended)) {
+ throw new RuntimeException("The editor registry do not implement IPageIconsRegistryExtended");////$NON-NLS-1$
+ }
+ return (IPageIconsRegistryExtended)editorRegistry;
+ }
+
+ /**
+ * Return the EditorRegistry for nested editor descriptors. Subclass should
+ * implements this method in order to return the registry associated to the
+ * extension point namespace.
+ *
+ * @return the EditorRegistry for nested editor descriptors
+ * FIXME : use a deprecated method
+ */
+ protected IPageIconsRegistry createEditorRegistry() {
+ try {
+ return EditorUtils.getServiceRegistry().getService(IPageIconsRegistry.class);
+ } catch (final ServiceException e) {
+ // Not found, return an empty one which return null for each
+ // request.
+ return new PageIconsRegistry();
+ }
+ }
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/src/org/eclipse/papyrus/infra/table/efacet/queries/GetContainedTables.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/src/org/eclipse/papyrus/infra/table/efacet/queries/GetContainedTables.java new file mode 100644 index 00000000000..da01cb9d7be --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/src/org/eclipse/papyrus/infra/table/efacet/queries/GetContainedTables.java @@ -0,0 +1,63 @@ +package org.eclipse.papyrus.infra.table.efacet.queries; + +import java.util.Collection; +import java.util.Iterator; + +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.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.efacet.metamodel.papyrustable.PapyrusTable; +import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrustablePackage; +import org.eclipse.uml2.uml.Element; + +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 GetContainedTables extends AbstractEditorContainerQuery implements IJavaModelQuery<Element, Collection<PapyrusTable>> { + + public Collection<PapyrusTable> evaluate(final Element context, final ParameterValueList parameterValues) throws ModelQueryExecutionException { + final Predicate<EStructuralFeature.Setting> p = new Predicate<EStructuralFeature.Setting>() { + + public boolean apply(final EStructuralFeature.Setting setting) { + return setting.getEObject() instanceof Table && setting.getEStructuralFeature() == TablePackage.Literals.TABLE__CONTEXT; + } + }; + final Function<EStructuralFeature.Setting, PapyrusTable> f = new Function<EStructuralFeature.Setting, PapyrusTable>() { + + public PapyrusTable apply(final EStructuralFeature.Setting setting) { + final Collection<Setting> references = PapyrusEcoreUtils.getUsages(setting.getEObject()); + final Predicate<Setting> p2 = new Predicate<EStructuralFeature.Setting>() { + + public boolean apply(final Setting setting) { + return setting.getEObject() instanceof PapyrusTable && PapyrustablePackage.Literals.PAPYRUS_TABLE__TABLE == setting.getEStructuralFeature(); + } + }; + final 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(final PapyrusTable table) { + return table != null; + } + }); + return Sets.newHashSet(transform); + } +} diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/src/org/eclipse/papyrus/infra/table/efacet/queries/GetTableIcon.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/src/org/eclipse/papyrus/infra/table/efacet/queries/GetTableIcon.java new file mode 100644 index 00000000000..6ce506e4251 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/src/org/eclipse/papyrus/infra/table/efacet/queries/GetTableIcon.java @@ -0,0 +1,17 @@ +package org.eclipse.papyrus.infra.table.efacet.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.efacet.metamodel.papyrustable.PapyrusTable; + +/** Return the path to the icon of the corresponding table */ +public class GetTableIcon extends AbstractGetEditorIconQuery implements IJavaModelQuery<PapyrusTable, String> { + + /** + * {@inheritDoc} + */ + public String evaluate(final PapyrusTable context, final ParameterValueList parameterValues) throws ModelQueryExecutionException { + return "/" + getEditorRegistry().getEditorURLIcon(context); //$NON-NLS-1$ + } +} diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/src/org/eclipse/papyrus/infra/table/efacet/queries/GetTableName.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/src/org/eclipse/papyrus/infra/table/efacet/queries/GetTableName.java new file mode 100644 index 00000000000..e90503635fa --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/src/org/eclipse/papyrus/infra/table/efacet/queries/GetTableName.java @@ -0,0 +1,14 @@ +package org.eclipse.papyrus.infra.table.efacet.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.efacet.metamodel.papyrustable.PapyrusTable; + +/** Return the name for the table */ +public class GetTableName implements IJavaModelQuery<PapyrusTable, String> { + + public String evaluate(final PapyrusTable context, final ParameterValueList parameterValues) throws ModelQueryExecutionException { + return context.getName() + "(new)"; + } +} diff --git a/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/src/org/eclipse/papyrus/infra/table/efacet/queries/IsTableContainer.java b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/src/org/eclipse/papyrus/infra/table/efacet/queries/IsTableContainer.java new file mode 100644 index 00000000000..1c7dcc5e103 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.infra.table.efacet/src/org/eclipse/papyrus/infra/table/efacet/queries/IsTableContainer.java @@ -0,0 +1,32 @@ +package org.eclipse.papyrus.infra.table.efacet.queries; + +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.table.metamodel.v0_2_0.table.Table; +import org.eclipse.emf.facet.widgets.table.metamodel.v0_2_0.table.TablePackage; +import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils; +import org.eclipse.uml2.uml.Element; + +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 +//FIXME : remove the dependencies on the ModelExplorer +public class IsTableContainer extends AbstractEditorContainerQuery implements IJavaModelQuery<Element, Boolean> { + + /** + * {@inheritDoc} + */ + public Boolean evaluate(final Element context, final ParameterValueList parameterValues) throws ModelQueryExecutionException { + final Predicate<Setting> p = new Predicate<Setting>() { + + public boolean apply(final Setting arg0) { + return arg0.getEObject() instanceof Table && arg0.getEStructuralFeature() == TablePackage.Literals.TABLE__CONTEXT; + } + }; + final boolean result = NavigatorUtils.find(context, p); + return NavigatorUtils.find(context, p); + } +} diff --git a/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/.classpath b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/.classpath new file mode 100644 index 00000000000..2d1a4302f04 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/.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/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/.project b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/.project new file mode 100644 index 00000000000..0d9b96b8456 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.table.efacet.uml.generic</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/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/.settings/org.eclipse.jdt.core.prefs b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..44217f8c068 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/.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/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/META-INF/MANIFEST.MF b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..b40b9641e44 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/META-INF/MANIFEST.MF @@ -0,0 +1,19 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.eclipse.papyrus.table.efacet.uml.generic;singleton:=true +Bundle-Version: 0.9.0.qualifier +Bundle-Activator: org.eclipse.papyrus.table.efacet.uml.generic.Activator +Bundle-Vendor: %providerName +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.papyrus.infra.core, + org.eclipse.papyrus.infra.table.efacet.metamodel, + org.eclipse.emf.facet.widgets.table.metamodel.edit;bundle-version="0.2.0", + org.eclipse.emf.facet.widgets.table.ui;bundle-version="0.2.0", + org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel, + org.eclipse.papyrus.infra.emf.efacet;bundle-version="0.9.0", + org.eclipse.papyrus.infra.table.efacet.common;bundle-version="0.9.0" +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Bundle-ActivationPolicy: lazy +Bundle-Localization: plugin diff --git a/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/about.html b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/about.html new file mode 100644 index 00000000000..82d49bf5f81 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/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 ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). 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, "Program" 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 ("Redistributor") 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/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/build.properties b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/build.properties new file mode 100644 index 00000000000..8665ac2ffec --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/build.properties @@ -0,0 +1,6 @@ +source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/icons/generic_UML_table.gif b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/icons/generic_UML_table.gif Binary files differnew file mode 100644 index 00000000000..7dba0a044de --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/icons/generic_UML_table.gif diff --git a/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/icons/generic_UML_table.png b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/icons/generic_UML_table.png Binary files differnew file mode 100644 index 00000000000..4bec73c4147 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/icons/generic_UML_table.png diff --git a/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/plugin.pdoc b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/plugin.pdoc new file mode 100644 index 00000000000..9661e051ca1 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/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 the new table for UML.">
+ <referent firstName="vincent" lastName="lorenzo" eMail="vincent.lorenzo@cea.fr" currentCompany="CEA-LIST"/>
+</doc:Documentation>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/plugin.properties b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/plugin.properties new file mode 100644 index 00000000000..0659cf5939e --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/plugin.properties @@ -0,0 +1,3 @@ +#Properties file for org.eclipse.papyrus.table.efacet.uml.generic
+providerName = Eclispe Modeling Project
+pluginName = Generic Table for UML (Incubation)
\ No newline at end of file diff --git a/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/plugin.xml b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/plugin.xml new file mode 100644 index 00000000000..a0159750a12 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/plugin.xml @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.papyrus.infra.core.papyrusDiagram">
+ <editorDiagram
+ factoryClass="org.eclipse.papyrus.table.efacet.uml.generic.factory.GenericTableEditorFactory"
+ icon="icons/generic_UML_table.png">
+ </editorDiagram>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ description="Create a new UML Table Editor (Generic)"
+ id="org.eclipse.papyrus.uml.generic.table.command"
+ name="Create a UML Table Editor (Generic)">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.papyrus.table.efacet.uml.generic.handlers.CreateGenericTableEditorHandler"
+ commandId="org.eclipse.papyrus.uml.generic.table.command">
+ <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.uml.generic.table.command"
+ icon="icons/generic_UML_table.png"
+ label="UML Generic Table"
+ mnemonic="&G"
+ style="push"
+ tooltip="Create a new UML Generic 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.uml.generic.table.command"
+ icon="icons/generic_UML_table.png"
+ label="UML Generic Table"
+ mnemonic="&G"
+ style="push"
+ tooltip="Create a new UML Generic 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.uml.generic.table.command"
+ icon="icons/generic_UML_table.png"
+ label="UML Generic Table"
+ mnemonic="&G"
+ style="push"
+ tooltip="Create a new UML Generic Table">
+ <visibleWhen>
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+
+</plugin>
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/resources/uml_generic_table.papyrustableconfiguration b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/resources/uml_generic_table.papyrustableconfiguration new file mode 100644 index 00000000000..0828c3fc2fb --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/resources/uml_generic_table.papyrustableconfiguration @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<org.eclipse.papyrus.infra.table.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:org.eclipse.papyrus.infra.table.papyrustableconfiguration="http://www.eclipse.org/Papyrus/PapyrusTableConfiguration/0.9.0/papyrustableconfiguration">
+ <tableConfiguration>
+ <canBePresentedInTheTable xsi:type="efacet:FacetOperation" href="platform:/plugin/org.eclipse.papyrus.uml.efacet/resources/uml.efacet#//uml_element/isUMLElementQuery"/>
+ <defaultFacets href="platform:/plugin/org.eclipse.papyrus.infra.emf.efacet/resources/papyrus_emf_facets.efacet#//papyrus_emf_facets"/>
+ <defaultCustomizations href="platform:/plugin/org.eclipse.papyrus.infra.emf.efacet/resources/emf_hidden_features.custom#/"/>
+ <defaultCustomizations href="platform:/plugin/org.eclipse.papyrus.uml.efacet/resources/uml_label.custom#/"/>
+ <defaultColumns xsi:type="efacet:FacetReference" href="platform:/plugin/org.eclipse.papyrus.infra.emf.efacet/resources/papyrus_emf_facets.efacet#//papyrus_emf_facets/self"/>
+ </tableConfiguration>
+</org.eclipse.papyrus.infra.table.papyrustableconfiguration:PapyrusTableConfiguration>
\ No newline at end of file diff --git a/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/src/org/eclipse/papyrus/table/efacet/uml/generic/Activator.java b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/src/org/eclipse/papyrus/table/efacet/uml/generic/Activator.java new file mode 100644 index 00000000000..39d5da27116 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/src/org/eclipse/papyrus/table/efacet/uml/generic/Activator.java @@ -0,0 +1,67 @@ +/*****************************************************************************
+ * 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.table.efacet.uml.generic;
+
+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.table.efacet.uml.generic"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(final BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(final BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/src/org/eclipse/papyrus/table/efacet/uml/generic/editor/GenericTableEditor.java b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/src/org/eclipse/papyrus/table/efacet/uml/generic/editor/GenericTableEditor.java new file mode 100644 index 00000000000..f359c3bbddf --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/src/org/eclipse/papyrus/table/efacet/uml/generic/editor/GenericTableEditor.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.table.efacet.uml.generic.editor;
+
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.table.efacet.common.editor.AbstractTableEditor;
+import org.eclipse.papyrus.infra.table.efacet.metamodel.papyrustable.PapyrusTable;
+
+
+
+public class GenericTableEditor extends AbstractTableEditor {
+
+ /** the type of the editor */
+ public static final String EDITOR_TYPE = "PapyrusGenericTable"; //$NON-NLS-1$
+
+ /** the default name for this table */
+ public static final String DEFAULT_NAME = "GenericTable"; //$NON-NLS-1$
+
+ /**
+ * @param servicesRegistry
+ * @param rawModel
+ *
+ */
+ public GenericTableEditor(final ServicesRegistry servicesRegistry, final PapyrusTable rawModel) {
+ super(servicesRegistry, rawModel);
+ }
+
+
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/src/org/eclipse/papyrus/table/efacet/uml/generic/factory/GenericTableEditorFactory.java b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/src/org/eclipse/papyrus/table/efacet/uml/generic/factory/GenericTableEditorFactory.java new file mode 100644 index 00000000000..4cafb997c76 --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/src/org/eclipse/papyrus/table/efacet/uml/generic/factory/GenericTableEditorFactory.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.table.efacet.uml.generic.factory;
+
+import org.eclipse.papyrus.infra.table.efacet.common.factory.AbstractTableEditorFactory;
+import org.eclipse.papyrus.table.efacet.uml.generic.editor.GenericTableEditor;
+
+
+/**
+ * @author dumoulin
+ *
+ */
+public class GenericTableEditorFactory extends AbstractTableEditorFactory {
+
+
+ /**
+ * Constructor.
+ *
+ * @param diagramClass
+ * @param expectedType
+ */
+ public GenericTableEditorFactory() {
+ super(GenericTableEditor.class, GenericTableEditor.EDITOR_TYPE);
+ }
+
+
+}
diff --git a/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/src/org/eclipse/papyrus/table/efacet/uml/generic/handlers/CreateGenericTableEditorHandler.java b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/src/org/eclipse/papyrus/table/efacet/uml/generic/handlers/CreateGenericTableEditorHandler.java new file mode 100644 index 00000000000..c5eefcb645a --- /dev/null +++ b/incoming/TableEFacet/org.eclipse.papyrus.table.efacet.uml.generic/src/org/eclipse/papyrus/table/efacet/uml/generic/handlers/CreateGenericTableEditorHandler.java @@ -0,0 +1,58 @@ +/*****************************************************************************
+ * 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.table.efacet.uml.generic.handlers;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.papyrus.infra.table.efacet.common.handlers.AbstractCreateTableEditorHandler;
+import org.eclipse.papyrus.infra.table.efacet.papyrustableconfiguration.metamodel.papyrustableconfiguration.PapyrusTableConfiguration;
+import org.eclipse.papyrus.table.efacet.uml.generic.Activator;
+import org.eclipse.papyrus.table.efacet.uml.generic.editor.GenericTableEditor;
+
+
+public class CreateGenericTableEditorHandler extends AbstractCreateTableEditorHandler {
+
+ /**
+ *
+ * Constructor.
+ *
+ */
+ public CreateGenericTableEditorHandler() {
+ super(GenericTableEditor.EDITOR_TYPE, GenericTableEditor.DEFAULT_NAME);
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.infra.table.common.handlers.AbstractCreateTableEditorHandler#getPapyrusTableConfiguration()
+ *
+ * @return
+ */
+ @Override
+ protected PapyrusTableConfiguration getPapyrusTableConfiguration() {
+ final ResourceSet resourceSet = getTableContext().eResource().getResourceSet();
+
+ final String symbolicName = Activator.getDefault().getBundle().getSymbolicName();
+ final URI uri = URI.createPlatformPluginURI(symbolicName + "/resources/uml_generic_table.papyrustableconfiguration", true); //$NON-NLS-1$
+ final Resource resource = resourceSet.getResource(uri, true);
+
+ PapyrusTableConfiguration configuration = null;
+
+ if(resource.getContents().get(0) instanceof PapyrusTableConfiguration) {
+ configuration = (PapyrusTableConfiguration)resource.getContents().get(0);
+ }
+ return configuration;
+ }
+
+}
|