Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaged Elaasar2017-02-21 08:19:48 +0000
committerFlorian Noyrit2017-03-13 16:19:06 +0000
commit7a1e61e4203fcf468a2635b80dd94182a95b588b (patch)
tree804451f2f230c2cb1a4b07815f4ccd2dc1edcf52 /plugins/infra/nattable
parentcb10068854ce727bc5004e997663ae0a3ae2ffd6 (diff)
downloadorg.eclipse.papyrus-7a1e61e4203fcf468a2635b80dd94182a95b588b.tar.gz
org.eclipse.papyrus-7a1e61e4203fcf468a2635b80dd94182a95b588b.tar.xz
org.eclipse.papyrus-7a1e61e4203fcf468a2635b80dd94182a95b588b.zip
Bug 510451 - Reimplement the ISO42010 specification to properly support
architectural contexts and viewpoints Replaced the viewpoint configuration framework by a new architectural context/viewpoint framework. This involves defining architecture contexts and viewpoints in models and contributing them via extension points or via the preferences. Models reference an architecture context and a set of viewpoints at creation time, but can be switched later. Architecture contexts double as client contexts for which elementtypesetconfigurations can be registered. They also define viewpoints, which reference representation kinds (diagrams or tables). This contribution defines three architecture contexts: UML, Profile, and SysML corresponding to what Papyrus used to call diagram categories. Change-Id: I203b58d9e97afdffc45c2674683c0281eb8a7c5b Signed-off-by: Maged Elaasar <melaasar@gmail.com>
Diffstat (limited to 'plugins/infra/nattable')
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.customization.nattableconfiguration/.classpath2
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.customization.nattableconfiguration/.settings/org.eclipse.jdt.core.prefs11
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.customization.nattableconfiguration/META-INF/MANIFEST.MF2
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/AbstractSynchronizedOnEStructuralFeatureAxisManager.java23
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/META-INF/MANIFEST.MF5
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/plugin.xml9
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/schema/tableReconciler.exsd (renamed from plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/schema/org.eclipse.papyrus.infra.nattable.configuration.exsd)250
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/api/TableEditorCreationHelper.java18
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/editor/AbstractEMFNattableEditor.java15
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/CreateNatTableFromCatalogHandler.java12
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/DynamicTablesMenuContribution.java8
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/PolicyDefinedTableHandler.java162
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/SyncTableCommandHelper.java252
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableCommandHelper.java156
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableReconcileHelper.java135
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableViewPrototype.java254
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/reconciler/TableReconciler.java131
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/reconciler/TableReconcilersReader.java164
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/reconciler/TableVersioningUtils.java204
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/wizards/ChooseNattableConfigWizardPage.java20
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/internal/common/commands/CreateAndOpenTableEditorCommand.java5
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetTableIcon.java7
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/EObjectInFlatTable.xwt2
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/EObjectInTreeTable.xwt2
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/SingleTable.xwt2
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/SingleTreeTable.xwt2
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/modelelement/NatTableModelElement.java10
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/.classpath7
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/.project28
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/META-INF/MANIFEST.MF23
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/about.html28
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/build.properties20
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/ctool16/CreateArchitectureDescriptionLanguage_representationKinds_PapyrusSyncTable.gifbin0 -> 223 bytes
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/ctool16/CreateArchitectureDescriptionLanguage_representationKinds_PapyrusTable.gifbin0 -> 223 bytes
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/obj16/PapyrusSyncTable.gifbin0 -> 304 bytes
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/obj16/PapyrusTable.gifbin0 -> 235 bytes
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/plugin.properties33
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/plugin.xml40
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/pom.xml12
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/src-gen/org/eclipse/papyrus/infra/nattable/representation/provider/PapyrusSyncTableItemProvider.java118
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/src-gen/org/eclipse/papyrus/infra/nattable/representation/provider/PapyrusTableItemProvider.java150
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/src-gen/org/eclipse/papyrus/infra/nattable/representation/provider/RepresentationEditPlugin.java110
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/src-gen/org/eclipse/papyrus/infra/nattable/representation/provider/RepresentationItemProviderAdapterFactory.java343
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/.classpath7
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/.project28
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/META-INF/MANIFEST.MF19
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/about.html28
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/build.properties20
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/model/NattableRepresentation.ecore10
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/model/NattableRepresentation.genmodel20
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/plugin.properties14
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/plugin.xml28
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/pom.xml12
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/PapyrusSyncTable.java29
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/PapyrusTable.java61
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/RepresentationFactory.java62
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/RepresentationPackage.java399
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/impl/PapyrusSyncTableImpl.java50
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/impl/PapyrusTableImpl.java175
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/impl/RepresentationFactoryImpl.java117
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/impl/RepresentationPackageImpl.java217
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/util/RepresentationAdapterFactory.java208
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/util/RepresentationSwitch.java198
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/plugin.xml8
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/resources/viewpageTable.configuration16
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF1
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/plugin.xml14
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/contentprovider/ContextFeatureContentProvider.java12
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectTreeAxisInNattableCommandProvider.java40
-rwxr-xr-xplugins/infra/nattable/pom.xml2
70 files changed, 3903 insertions, 667 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.customization.nattableconfiguration/.classpath b/plugins/infra/nattable/org.eclipse.papyrus.customization.nattableconfiguration/.classpath
index 098194ca4b7..eca7bdba8f0 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.customization.nattableconfiguration/.classpath
+++ b/plugins/infra/nattable/org.eclipse.papyrus.customization.nattableconfiguration/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.customization.nattableconfiguration/.settings/org.eclipse.jdt.core.prefs b/plugins/infra/nattable/org.eclipse.papyrus.customization.nattableconfiguration/.settings/org.eclipse.jdt.core.prefs
index f08be2b06c4..8ddd9a88d57 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.customization.nattableconfiguration/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/infra/nattable/org.eclipse.papyrus.customization.nattableconfiguration/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,15 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
-org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.customization.nattableconfiguration/META-INF/MANIFEST.MF b/plugins/infra/nattable/org.eclipse.papyrus.customization.nattableconfiguration/META-INF/MANIFEST.MF
index ae89ae09070..c38826267f5 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.customization.nattableconfiguration/META-INF/MANIFEST.MF
+++ b/plugins/infra/nattable/org.eclipse.papyrus.customization.nattableconfiguration/META-INF/MANIFEST.MF
@@ -25,7 +25,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.ui;bundle-version="1.2.0",
org.eclipse.papyrus.infra.ui.emf;bundle-version="1.2.0",
org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.papyrus.customization.nattableconfiguration,
org.eclipse.papyrus.customization.nattableconfiguration.edition,
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/AbstractSynchronizedOnEStructuralFeatureAxisManager.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/AbstractSynchronizedOnEStructuralFeatureAxisManager.java
index 52648dce925..83db1f276a8 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/AbstractSynchronizedOnEStructuralFeatureAxisManager.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.emf.nattable/src/org/eclipse/papyrus/infra/emf/nattable/manager/axis/AbstractSynchronizedOnEStructuralFeatureAxisManager.java
@@ -28,8 +28,11 @@ import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.emf.type.core.IClientContext;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.emf.gmf.command.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.emf.nattable.Activator;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager;
import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
@@ -38,6 +41,7 @@ import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfigurati
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.IAxisConfiguration;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisprovider.AbstractAxisProvider;
import org.eclipse.papyrus.infra.nattable.utils.AxisUtils;
+import org.eclipse.papyrus.infra.services.edit.context.TypeContext;
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
@@ -481,14 +485,19 @@ public abstract class AbstractSynchronizedOnEStructuralFeatureAxisManager extend
*/
@Override
public Command getDestroyAxisElementCommand(TransactionalEditingDomain domain, Integer axisPosition) {
- if (canDestroyAxisElement(axisPosition)) {
- final Object current = getElements().get(axisPosition);
- Object elementToDestroy = AxisUtils.getRepresentedElement(current);
- if (elementToDestroy != null && elementToDestroy instanceof EObject) {
- final DestroyElementRequest request = new DestroyElementRequest(getContextEditingDomain(), (EObject) elementToDestroy, false);
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(elementToDestroy);
- return new RemoveCommandWrapper(new GMFtoEMFCommandWrapper(provider.getEditCommand(request)), Collections.singleton(elementToDestroy));
+ try {
+ if (canDestroyAxisElement(axisPosition)) {
+ final Object current = getElements().get(axisPosition);
+ Object elementToDestroy = AxisUtils.getRepresentedElement(current);
+ if (elementToDestroy != null && elementToDestroy instanceof EObject) {
+ final DestroyElementRequest request = new DestroyElementRequest(getContextEditingDomain(), (EObject) elementToDestroy, false);
+ IClientContext context = TypeContext.getContext(domain);
+ final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(elementToDestroy, context);
+ return new RemoveCommandWrapper(new GMFtoEMFCommandWrapper(provider.getEditCommand(request)), Collections.singleton(elementToDestroy));
+ }
}
+ } catch (ServiceException e) {
+ Activator.log.error(e);
}
return UnexecutableCommand.INSTANCE;
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/META-INF/MANIFEST.MF b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/META-INF/MANIFEST.MF
index 17c21e03b24..f9ead8618e5 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/META-INF/MANIFEST.MF
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/META-INF/MANIFEST.MF
@@ -4,7 +4,9 @@ Export-Package: org.eclipse.papyrus.infra.nattable.common,
org.eclipse.papyrus.infra.nattable.common.editor,
org.eclipse.papyrus.infra.nattable.common.factory,
org.eclipse.papyrus.infra.nattable.common.handlers,
+ org.eclipse.papyrus.infra.nattable.common.helper,
org.eclipse.papyrus.infra.nattable.common.modelresource,
+ org.eclipse.papyrus.infra.nattable.common.reconciler,
org.eclipse.papyrus.infra.nattable.common.utils,
org.eclipse.papyrus.infra.nattable.common.wizards,
org.eclipse.papyrus.infra.nattable.internal.common.commands;x-friends:="org.eclipse.papyrus.infra.nattable.gmfdiag"
@@ -18,7 +20,8 @@ Require-Bundle: org.eclipse.papyrus.infra.nattable;bundle-version="[3.0.0,4.0.0)
org.eclipse.papyrus.infra.ui;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.types.core;bundle-version="[3.0.0,4.0.0)",
org.eclipse.papyrus.infra.internationalization.utils;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.papyrus.infra.internationalization.common;bundle-version="[1.0.0,2.0.0)"
+ org.eclipse.papyrus.infra.internationalization.common;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.papyrus.infra.nattable.representation;bundle-version="[1.0.0,2.0.0)";visibility:=reexport
Bundle-Vendor: %Bundle-Vendor
Bundle-ActivationPolicy: lazy
Bundle-Version: 3.0.0.qualifier
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/plugin.xml b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/plugin.xml
index 2c10f8d75c4..de1199dbc77 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/plugin.xml
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/plugin.xml
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
+ <extension-point id="tableReconciler" name="tableReconciler" schema="schema/tableReconciler.exsd"/>
+
<!--We declare the model used for the Papyrus Table Editor -->
<extension point="org.eclipse.papyrus.infra.core.model">
<model classname="org.eclipse.papyrus.infra.nattable.common.modelresource.PapyrusNattableModel" description="Model for Papyrus Nattable editors">
@@ -271,11 +273,4 @@
</activeWhen>
</handler>
</extension>
-<extension
- point="org.eclipse.papyrus.infra.types.core.elementTypeSetConfiguration">
- <elementTypeSet
- clientContextID="org.eclipse.papyrus.infra.services.edit.TypeContext"
- path="model/nattable-common.elementtypesconfigurations">
- </elementTypeSet>
-</extension>
</plugin>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/schema/org.eclipse.papyrus.infra.nattable.configuration.exsd b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/schema/tableReconciler.exsd
index e2551c85634..eebd998baae 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/schema/org.eclipse.papyrus.infra.nattable.configuration.exsd
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/schema/tableReconciler.exsd
@@ -1,134 +1,116 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.papyrus.infra.nattable" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.papyrus.infra.nattable" id="org.eclipse.papyrus.infra.nattable.configuration" name="Nattable Configuration"/>
- </appinfo>
- <documentation>
- This extension point allows to contribute table configurations to a catalog. This catalog allows to reuse existing configuration in a editor, a property view, and so on.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence minOccurs="1" maxOccurs="unbounded">
- <element ref="configuration"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="configuration">
- <annotation>
- <documentation>
- The file must be an EMF Model, with only one root. This root must be a TableConfiguration and its extension must be &quot;.nattableconfiguration&quot;.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="file" type="string" use="required">
- <annotation>
- <documentation>
- a file with the extension .nattableconfiguration
- </documentation>
- <appinfo>
- <meta.attribute kind="resource"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="type" type="string" use="required">
- <annotation>
- <documentation>
- The unique type identifier of the table as a string
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- MDT papyrus 0.10.0
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- See Papyrus nattable plugins
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- one
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- none
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- /*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
- </documentation>
- </annotation>
-
-</schema>
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.papyrus.infra.nattable.common" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.papyrus.infra.nattable.common" id="tableReconciler" name="tableReconciler"/>
+ </appinfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="tableReconciler"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="tableReconciler">
+ <complexType>
+ <attribute name="reconcilerClass" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.papyrus.infra.nattable.common.reconciler.TableReconciler:"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="source" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="target" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/api/TableEditorCreationHelper.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/api/TableEditorCreationHelper.java
index 4e8f340936a..2a55b328ec9 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/api/TableEditorCreationHelper.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/api/TableEditorCreationHelper.java
@@ -26,6 +26,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.osgi.util.NLS;
+import org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind;
import org.eclipse.papyrus.infra.core.resource.ModelSet;
import org.eclipse.papyrus.infra.core.resource.NotFoundException;
import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager;
@@ -40,9 +41,8 @@ import org.eclipse.papyrus.infra.nattable.internal.common.commands.CreateAndOpen
import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableconfiguration.TableConfiguration;
import org.eclipse.papyrus.infra.nattable.nattableconfiguration.NattableConfigurationRegistry;
-import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusSyncTable;
-import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusTable;
-import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusView;
+import org.eclipse.papyrus.infra.nattable.representation.PapyrusSyncTable;
+import org.eclipse.papyrus.infra.nattable.representation.PapyrusTable;
import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
@@ -372,15 +372,15 @@ public class TableEditorCreationHelper {
*/
protected URI getTableConfigurationURI(TableViewPrototype viewPrototype) {
Assert.isNotNull(viewPrototype);
- if (viewPrototype.getConfiguration() instanceof PapyrusTable) {
- PapyrusTable papyrusTable = (PapyrusTable) viewPrototype.getConfiguration();
+ if (viewPrototype.getRepresentationKind() instanceof PapyrusTable) {
+ PapyrusTable papyrusTable = (PapyrusTable) viewPrototype.getRepresentationKind();
String uri = papyrusTable.getConfiguration();
if (uri != null && uri.length() > 0) {
return URI.createURI(uri);
}
}
- if (viewPrototype.getConfiguration() instanceof PapyrusSyncTable) {
- return NattableConfigurationRegistry.INSTANCE.getConfigurationURI(((PapyrusSyncTable) viewPrototype.getConfiguration()).getImplementationID());
+ if (viewPrototype.getRepresentationKind() instanceof PapyrusSyncTable) {
+ return NattableConfigurationRegistry.INSTANCE.getConfigurationURI(((PapyrusSyncTable) viewPrototype.getRepresentationKind()).getImplementationID());
}
return null;
}
@@ -399,7 +399,7 @@ public class TableEditorCreationHelper {
return null;
}
// 1. get all available view prototype for the table context
- Collection<ViewPrototype> prototypes = PolicyChecker.getCurrent().getPrototypesFor(tableContext);
+ Collection<ViewPrototype> prototypes = PolicyChecker.getFor(tableContext).getPrototypesFor(tableContext);
Iterator<ViewPrototype> iter = prototypes.iterator();
// 2. find the view prototype allowing to create the wanted table, identified by it ViewPrototype
@@ -412,7 +412,7 @@ public class TableEditorCreationHelper {
return prototype;
}
if (implementationID == null || implementationID.isEmpty()) {
- PapyrusView configuration = prototype.getConfiguration();
+ PapyrusRepresentationKind configuration = prototype.getRepresentationKind();
if (configuration instanceof PapyrusTable) {
// we need to load the real table configuration to check the type
PapyrusTable papyrusTable = (PapyrusTable) configuration;
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/editor/AbstractEMFNattableEditor.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/editor/AbstractEMFNattableEditor.java
index 9ee5241d252..9cbebb91a6a 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/editor/AbstractEMFNattableEditor.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/editor/AbstractEMFNattableEditor.java
@@ -22,6 +22,7 @@ import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
@@ -37,6 +38,8 @@ import org.eclipse.papyrus.infra.internationalization.common.editor.IInternation
import org.eclipse.papyrus.infra.internationalization.utils.utils.LabelInternationalization;
import org.eclipse.papyrus.infra.internationalization.utils.utils.LabelInternationalizationUtils;
import org.eclipse.papyrus.infra.nattable.common.Activator;
+import org.eclipse.papyrus.infra.nattable.common.helper.TableReconcileHelper;
+import org.eclipse.papyrus.infra.nattable.common.reconciler.TableVersioningUtils;
import org.eclipse.papyrus.infra.nattable.common.utils.TableEditorInput;
import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
@@ -174,6 +177,18 @@ public abstract class AbstractEMFNattableEditor extends EditorPart implements Na
setPartName(LabelInternationalization.getInstance().getTableLabel(this.tableManager.getTable()));
}
+ @Override
+ protected void setInput(IEditorInput input) {
+ super.setInput(input);
+ if (getTable() != null && !TableVersioningUtils.isOfCurrentPapyrusVersion(getTable())) {
+ try {
+ new TableReconcileHelper(getEditingDomain()).reconcileTable(getTable());
+ } catch (CoreException e) {
+ Activator.log.error(e);
+ }
+ }
+ }
+
/**
*
* @see org.eclipse.emf.facet.widgets.nattable.workbench.editor.NatTableEditor#getEditingDomain()
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/CreateNatTableFromCatalogHandler.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/CreateNatTableFromCatalogHandler.java
index 0493ad10b74..26d0fb22e4c 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/CreateNatTableFromCatalogHandler.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/CreateNatTableFromCatalogHandler.java
@@ -37,9 +37,9 @@ import org.eclipse.papyrus.infra.nattable.common.Activator;
import org.eclipse.papyrus.infra.nattable.common.helper.TableViewPrototype;
import org.eclipse.papyrus.infra.nattable.common.wizards.CreateNattableFromCatalogWizard;
import org.eclipse.papyrus.infra.nattable.nattableconfiguration.NattableConfigurationRegistry;
+import org.eclipse.papyrus.infra.nattable.representation.PapyrusSyncTable;
+import org.eclipse.papyrus.infra.nattable.representation.PapyrusTable;
import org.eclipse.papyrus.infra.ui.util.ServiceUtilsForHandlers;
-import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusSyncTable;
-import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusTable;
import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchWindow;
@@ -193,15 +193,15 @@ public class CreateNatTableFromCatalogHandler extends AbstractHandler {
* the {@link URI} of the nattable configuration, or <code>null</code> if not found
*/
private URI getTableConfigurationURI(final TableViewPrototype viewPrototype) {
- if (viewPrototype.getConfiguration() instanceof PapyrusTable) {
- PapyrusTable papyrusTable = (PapyrusTable) viewPrototype.getConfiguration();
+ if (viewPrototype.getRepresentationKind() instanceof PapyrusTable) {
+ PapyrusTable papyrusTable = (PapyrusTable) viewPrototype.getRepresentationKind();
String uri = papyrusTable.getConfiguration();
if (uri != null && uri.length() > 0) {
return URI.createURI(uri);
}
}
- if (viewPrototype.getConfiguration() instanceof PapyrusSyncTable) {
- return NattableConfigurationRegistry.INSTANCE.getConfigurationURI(((PapyrusSyncTable) viewPrototype.getConfiguration()).getImplementationID());
+ if (viewPrototype.getRepresentationKind() instanceof PapyrusSyncTable) {
+ return NattableConfigurationRegistry.INSTANCE.getConfigurationURI(((PapyrusSyncTable) viewPrototype.getRepresentationKind()).getImplementationID());
}
return null;
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/DynamicTablesMenuContribution.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/DynamicTablesMenuContribution.java
index da320880dd5..dbdd0e3d5f3 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/DynamicTablesMenuContribution.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/DynamicTablesMenuContribution.java
@@ -21,8 +21,8 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusSyncTable;
-import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusTable;
+import org.eclipse.papyrus.infra.nattable.representation.PapyrusSyncTable;
+import org.eclipse.papyrus.infra.nattable.representation.PapyrusTable;
import org.eclipse.papyrus.infra.viewpoints.policy.DynamicContribution;
import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
@@ -60,8 +60,8 @@ public class DynamicTablesMenuContribution extends DynamicContribution {
// build a list of all the available prototypes
List<ViewPrototype> data = new ArrayList<ViewPrototype>();
- for (final ViewPrototype proto : PolicyChecker.getCurrent().getPrototypesFor(selection)) {
- if (!(proto.getConfiguration() instanceof PapyrusTable || proto.getConfiguration() instanceof PapyrusSyncTable)) {
+ for (final ViewPrototype proto : PolicyChecker.getFor(selection).getPrototypesFor(selection)) {
+ if (!(proto.getRepresentationKind() instanceof PapyrusTable || proto.getRepresentationKind() instanceof PapyrusSyncTable)) {
continue;
}
data.add(proto);
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/PolicyDefinedTableHandler.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/PolicyDefinedTableHandler.java
index 92e8f66b35e..19e4303a462 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/PolicyDefinedTableHandler.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/PolicyDefinedTableHandler.java
@@ -1,80 +1,82 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.nattable.common.handlers;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
-import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
-import org.eclipse.papyrus.infra.nattable.Activator;
-import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
-import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
-
-
-/**
- * Represents the handler for the creation of table defined in a viewpoint
- *
- * @author Laurent Wouters
- */
-public class PolicyDefinedTableHandler extends CreateNatTableEditorHandler {
- private URI configuration;
- private EObject context;
- private String name;
-
- public PolicyDefinedTableHandler(URI config, EObject context, String name) {
- this.configuration = config;
- this.context = context;
- this.name = name;
- }
-
- @Override
- protected EObject getTableContext() {
- return context;
- }
-
- @Override
- protected URI getTableEditorConfigurationURI() {
- return configuration;
- }
-
- public boolean execute(final ViewPrototype prototype) {
- final String name = this.name != null ? this.name : askName();
- if (name == null) {
- return false;
- }
- try {
- final ServicesRegistry serviceRegistry = ServiceUtilsForEObject.getInstance().getServiceRegistry(context);
- final TransactionalEditingDomain domain = ServiceUtils.getInstance().getTransactionalEditingDomain(serviceRegistry);
- domain.getCommandStack().execute(new RecordingCommand(domain) {
- @Override
- protected void doExecute() {
- try {
- Table table = PolicyDefinedTableHandler.this.doExecute(serviceRegistry, name, this.description);
- table.setOwner(context);
- table.setPrototype(prototype.getConfiguration());
- } catch (Exception ex) {
- Activator.log.error(ex);
- }
- }
- });
- return true;
- } catch (Exception ex) {
- Activator.log.error(ex);
- return false;
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.common.handlers;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
+import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
+import org.eclipse.papyrus.infra.nattable.Activator;
+import org.eclipse.papyrus.infra.nattable.common.reconciler.TableVersioningUtils;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+
+
+/**
+ * Represents the handler for the creation of table defined in a viewpoint
+ *
+ * @author Laurent Wouters
+ */
+public class PolicyDefinedTableHandler extends CreateNatTableEditorHandler {
+ private URI configuration;
+ private EObject context;
+ private String name;
+
+ public PolicyDefinedTableHandler(URI config, EObject context, String name) {
+ this.configuration = config;
+ this.context = context;
+ this.name = name;
+ }
+
+ @Override
+ protected EObject getTableContext() {
+ return context;
+ }
+
+ @Override
+ protected URI getTableEditorConfigurationURI() {
+ return configuration;
+ }
+
+ public boolean execute(final ViewPrototype prototype) {
+ final String name = this.name != null ? this.name : askName();
+ if (name == null) {
+ return false;
+ }
+ try {
+ final ServicesRegistry serviceRegistry = ServiceUtilsForEObject.getInstance().getServiceRegistry(context);
+ final TransactionalEditingDomain domain = ServiceUtils.getInstance().getTransactionalEditingDomain(serviceRegistry);
+ domain.getCommandStack().execute(new RecordingCommand(domain) {
+ @Override
+ protected void doExecute() {
+ try {
+ Table table = PolicyDefinedTableHandler.this.doExecute(serviceRegistry, name, this.description);
+ TableVersioningUtils.stampCurrentVersion(table);
+ table.setOwner(context);
+ table.setPrototype(prototype.getRepresentationKind());
+ } catch (Exception ex) {
+ Activator.log.error(ex);
+ }
+ }
+ });
+ return true;
+ } catch (Exception ex) {
+ Activator.log.error(ex);
+ return false;
+ }
+ }
+}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/SyncTableCommandHelper.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/SyncTableCommandHelper.java
index b6f3797e325..bbd018af7dd 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/SyncTableCommandHelper.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/SyncTableCommandHelper.java
@@ -1,122 +1,130 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.nattable.common.helper;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
-import org.eclipse.papyrus.infra.nattable.nattableconfiguration.NattableConfigurationRegistry;
-import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationPackage;
-import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusSyncTable;
-import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusView;
-import org.eclipse.papyrus.infra.viewpoints.policy.IViewTypeHelper;
-import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
-
-/**
- * Represents the command helper for the viewpoints application to synchronized tables
- *
- * @author Laurent Wouters
- */
-public class SyncTableCommandHelper implements IViewTypeHelper {
- /**
- * ID of the extension point for Papyrus tables
- */
- private static final String EXTENSION_PAPYRUS_SYNC_TABLE = NattableConfigurationRegistry.EXTENSION_ID;
-
- /**
- * The cache of implementations
- */
- private Map<String, String> implementations;
-
- /**
- * The cache of prototypes
- */
- private Map<PapyrusView, TableViewPrototype> cache;
-
-
-
- @Override
- public ViewPrototype getPrototypeFor(PapyrusView configuration) {
- if (!(configuration instanceof PapyrusSyncTable)) {
- return null;
- }
- if (implementations == null) {
- buildImplementationCache();
- }
- if (cache == null) {
- cache = new HashMap<PapyrusView, TableViewPrototype>();
- }
- if (cache.containsKey(configuration)) {
- return cache.get(configuration);
- }
- if (!implementations.containsKey(configuration.getImplementationID())) {
- return null;
- }
- TableViewPrototype proto = new TableViewPrototype((PapyrusSyncTable) configuration, implementations.get(configuration.getImplementationID()));
- cache.put(configuration, proto);
- return proto;
- }
-
- @Override
- public boolean isSupported(EClass type) {
- return (type == ConfigurationPackage.eINSTANCE.getPapyrusSyncTable());
- }
-
- @Override
- public boolean isSupported(EObject view) {
- if (!(view instanceof Table)) {
- return false;
- }
- Table table = (Table) view;
- return (table.getPrototype() instanceof PapyrusSyncTable);
- }
-
- @Override
- public ViewPrototype getPrototypeOf(EObject view) {
- return getPrototypeFor((PapyrusView) ((Table) view).getPrototype());
- }
-
- /**
- * Builds the cache of sync table implementations
- */
- private void buildImplementationCache() {
- implementations = new HashMap<String, String>();
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint point = registry.getExtensionPoint(EXTENSION_PAPYRUS_SYNC_TABLE);
- IExtension[] extensions = point.getExtensions();
- for (int i = 0; i != extensions.length; i++) {
- IConfigurationElement[] elements = extensions[i].getConfigurationElements();
- for (int j = 0; j != elements.length; j++) {
- if (elements[j].getName().equals("configuration")) {
- String type = elements[j].getAttribute("type");
- String file = elements[j].getAttribute("file");
- if (!file.startsWith("platform:/")) {
- file = "platform:/plugin/" + extensions[i].getContributor().getName() + "/" + file;
- }
- if (!implementations.containsKey(type)) {
- implementations.put(type, file);
- }
- }
- }
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.common.helper;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.infra.nattable.nattableconfiguration.NattableConfigurationRegistry;
+import org.eclipse.papyrus.infra.nattable.representation.PapyrusSyncTable;
+import org.eclipse.papyrus.infra.nattable.representation.RepresentationPackage;
+import org.eclipse.papyrus.infra.viewpoints.policy.IViewTypeHelper;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+
+/**
+ * Represents the command helper for the viewpoints application to synchronized tables
+ *
+ * @author Laurent Wouters
+ */
+public class SyncTableCommandHelper implements IViewTypeHelper {
+ /**
+ * ID of the extension point for Papyrus tables
+ */
+ private static final String EXTENSION_PAPYRUS_SYNC_TABLE = NattableConfigurationRegistry.EXTENSION_ID;
+
+ /**
+ * The cache of implementations
+ */
+ private Map<String, String> implementations;
+
+ /**
+ * The cache of prototypes
+ */
+ private Map<PapyrusRepresentationKind, TableViewPrototype> cache;
+
+
+
+ @Override
+ public ViewPrototype getPrototypeFor(PapyrusRepresentationKind configuration) {
+ if (!(configuration instanceof PapyrusSyncTable)) {
+ return null;
+ }
+ if (implementations == null) {
+ buildImplementationCache();
+ }
+ if (cache == null) {
+ cache = new HashMap<PapyrusRepresentationKind, TableViewPrototype>();
+ }
+ if (cache.containsKey(configuration)) {
+ return cache.get(configuration);
+ }
+ if (!implementations.containsKey(configuration.getImplementationID())) {
+ return null;
+ }
+ TableViewPrototype proto = new TableViewPrototype((PapyrusSyncTable) configuration, implementations.get(configuration.getImplementationID()));
+ cache.put(configuration, proto);
+ return proto;
+ }
+
+ @Override
+ public boolean isSupported(EClass type) {
+ return (type == RepresentationPackage.eINSTANCE.getPapyrusSyncTable());
+ }
+
+ @Override
+ public boolean isSupported(EObject view) {
+ if (!(view instanceof Table)) {
+ return false;
+ }
+ Table table = (Table) view;
+ return (table.getPrototype() instanceof PapyrusSyncTable);
+ }
+
+ @Override
+ public ViewPrototype getPrototypeOf(EObject view) {
+ if (!isSupported(view)) {
+ return null;
+ }
+ PolicyChecker checker = PolicyChecker.getFor(view);
+ PapyrusSyncTable repKind = (PapyrusSyncTable) ((Table)view).getPrototype();
+ if (checker.isInViewpoint(repKind))
+ return getPrototypeFor(repKind);
+ return ViewPrototype.UNAVAILABLE_VIEW;
+ }
+
+ /**
+ * Builds the cache of sync table implementations
+ */
+ private void buildImplementationCache() {
+ implementations = new HashMap<String, String>();
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint point = registry.getExtensionPoint(EXTENSION_PAPYRUS_SYNC_TABLE);
+ IExtension[] extensions = point.getExtensions();
+ for (int i = 0; i != extensions.length; i++) {
+ IConfigurationElement[] elements = extensions[i].getConfigurationElements();
+ for (int j = 0; j != elements.length; j++) {
+ if (elements[j].getName().equals("configuration")) {
+ String type = elements[j].getAttribute("type");
+ String file = elements[j].getAttribute("file");
+ if (!file.startsWith("platform:/")) {
+ file = "platform:/plugin/" + extensions[i].getContributor().getName() + "/" + file;
+ }
+ if (!implementations.containsKey(type)) {
+ implementations.put(type, file);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableCommandHelper.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableCommandHelper.java
index 0dad32232c4..63e02940f41 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableCommandHelper.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableCommandHelper.java
@@ -1,74 +1,82 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.nattable.common.helper;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
-import org.eclipse.papyrus.infra.viewpoints.configuration.ConfigurationPackage;
-import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusTable;
-import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusView;
-import org.eclipse.papyrus.infra.viewpoints.policy.IViewTypeHelper;
-import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
-
-/**
- * Represents the command helper for viewpoints-based generic tables
- *
- * @author Laurent Wouters
- */
-public class TableCommandHelper implements IViewTypeHelper {
-
- /**
- * The cache of prototypes
- */
- private Map<PapyrusView, TableViewPrototype> cache;
-
- @Override
- public ViewPrototype getPrototypeFor(PapyrusView configuration) {
- if (!(configuration instanceof PapyrusTable)) {
- return null;
- }
- if (cache == null) {
- cache = new HashMap<PapyrusView, TableViewPrototype>();
- }
- if (cache.containsKey(configuration)) {
- return cache.get(configuration);
- }
- TableViewPrototype proto = new TableViewPrototype((PapyrusTable) configuration);
- cache.put(configuration, proto);
- return proto;
- }
-
- @Override
- public boolean isSupported(EClass type) {
- return (type == ConfigurationPackage.eINSTANCE.getPapyrusTable());
- }
-
- @Override
- public boolean isSupported(EObject view) {
- if (!(view instanceof Table)) {
- return false;
- }
- Table table = (Table) view;
- return (table.getPrototype() instanceof PapyrusTable);
- }
-
- @Override
- public ViewPrototype getPrototypeOf(EObject view) {
- return getPrototypeFor((PapyrusView) ((Table) view).getPrototype());
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.common.helper;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.infra.nattable.representation.PapyrusTable;
+import org.eclipse.papyrus.infra.nattable.representation.RepresentationPackage;
+import org.eclipse.papyrus.infra.viewpoints.policy.IViewTypeHelper;
+import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+
+/**
+ * Represents the command helper for viewpoints-based generic tables
+ *
+ * @author Laurent Wouters
+ */
+public class TableCommandHelper implements IViewTypeHelper {
+
+ /**
+ * The cache of prototypes
+ */
+ private Map<PapyrusRepresentationKind, TableViewPrototype> cache;
+
+ @Override
+ public ViewPrototype getPrototypeFor(PapyrusRepresentationKind configuration) {
+ if (!(configuration instanceof PapyrusTable)) {
+ return null;
+ }
+ if (cache == null) {
+ cache = new HashMap<PapyrusRepresentationKind, TableViewPrototype>();
+ }
+ if (cache.containsKey(configuration)) {
+ return cache.get(configuration);
+ }
+ TableViewPrototype proto = new TableViewPrototype((PapyrusTable) configuration);
+ cache.put(configuration, proto);
+ return proto;
+ }
+
+ @Override
+ public boolean isSupported(EClass type) {
+ return (type == RepresentationPackage.eINSTANCE.getPapyrusTable());
+ }
+
+ @Override
+ public boolean isSupported(EObject view) {
+ if (!(view instanceof Table)) {
+ return false;
+ }
+ Table table = (Table) view;
+ return (table.getPrototype() instanceof PapyrusTable);
+ }
+
+ @Override
+ public ViewPrototype getPrototypeOf(EObject view) {
+ if (!isSupported(view)) {
+ return null;
+ }
+ PolicyChecker checker = PolicyChecker.getFor(view);
+ PapyrusTable repKind = (PapyrusTable) ((Table)view).getPrototype();
+ if (checker.isInViewpoint(repKind))
+ return getPrototypeFor(repKind);
+ return ViewPrototype.UNAVAILABLE_VIEW;
+ }
+}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableReconcileHelper.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableReconcileHelper.java
new file mode 100644
index 00000000000..4c515ac9370
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableReconcileHelper.java
@@ -0,0 +1,135 @@
+/*****************************************************************************
+ * Copyright (c) 2010, 2015 CEA LIST, Christian W. Damus, and others.
+ *
+ * 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:
+ * Maged Elaasar - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.common.helper;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.transaction.RollbackException;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.papyrus.infra.emf.gmf.util.GMFUnsafe;
+import org.eclipse.papyrus.infra.nattable.common.Activator;
+import org.eclipse.papyrus.infra.nattable.common.reconciler.TableReconciler;
+import org.eclipse.papyrus.infra.nattable.common.reconciler.TableReconcilersReader;
+import org.eclipse.papyrus.infra.nattable.common.reconciler.TableVersioningUtils;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+
+/**
+ * Table migration between version of Papyrus.
+ */
+public class TableReconcileHelper {
+
+ private final TransactionalEditingDomain domain;
+
+ /**
+ * Instantiates helper that will work with given {@link TransactionalEditingDomain}.
+ * Note that reconcile operations are performed outside the table command stack using {@link GMFUnsafe}
+ */
+ public TableReconcileHelper(TransactionalEditingDomain domain) {
+ this.domain = domain;
+ }
+
+ /**
+ * Process table reconcilers to migrate models. Does nothing if the table is already of the current Papyrus version based on {@link TableVersioningUtils#isOfCurrentPapyrusVersion(Table)} check.
+ * <p/>
+ * This method needs configured {@link TableEditDomain} to execute collected {@link ICommand} when needed, so it can't be called from constructor
+ *
+ * @param table
+ * the table to reconcile
+ * @throws CoreException
+ * subclass may throw wrapping any problem thrown from execution of reconcile using {@link GMFUnsafe}. Default implementation does not
+ * throw it however
+ */
+ public void reconcileTable(Table table) throws CoreException {
+ CompositeCommand migration = buildReconcileCommand(table);
+ if (migration == null) {
+ return;
+ }
+ migration.add(TableVersioningUtils.createStampCurrentVersionCommand(table));
+ try {
+ GMFUnsafe.write(domain, migration);
+ } catch (ExecutionException e) {
+ handleReconcileException(table, e);
+ } catch (InterruptedException e) {
+ handleReconcileException(table, e);
+ } catch (RollbackException e) {
+ handleReconcileException(table, e);
+ }
+ }
+
+ /**
+ * Process table reconcilers to migrate models.
+ *
+ * Returns <code>null</code> if the table is already of the current Papyrus version based on {@link TableVersioningUtils#isOfCurrentPapyrusVersion(Table)} check.
+ * <p/>
+ * If one of the reconcilers returns un-executable command, this method logs the problem and returns <code>null</code>
+ *
+ * @param table
+ * the table to reconcile
+ */
+ protected CompositeCommand buildReconcileCommand(Table table) {
+
+ CompositeCommand reconcileCommand = new CompositeCommand("Reconciling");
+
+ if (!TableVersioningUtils.isOfCurrentPapyrusVersion(table)) {
+
+ String sourceVersion = TableVersioningUtils.getCompatibilityVersion(table);
+ List <TableReconciler> reconcilers = TableReconcilersReader.getInstance().load();
+
+ boolean someFailed = false;
+ Iterator<TableReconciler> reconciler = reconcilers.iterator();
+ while (reconciler.hasNext() && !someFailed) {
+ TableReconciler next = reconciler.next();
+
+ if (!next.canReconcileFrom(table, sourceVersion)) {
+ // asked for ignore it for this instance, all fine
+ continue;
+ }
+ ICommand nextCommand = next.getReconcileCommand(table);
+ if (nextCommand == null) {
+ // legitimate no-op response, all fine
+ continue;
+ }
+ if (nextCommand.canExecute()) {
+ reconcileCommand.add(nextCommand);
+ } else {
+ Activator.log.error("Table reconciler " + next + " failed to reconcile table : " + table, null); //$NON-NLS-1$ //$NON-NLS-2$
+ someFailed = true;
+ }
+ }
+
+ if (someFailed) {
+ // probably better to fail the whole reconcile process as user will have a chance to reconcile later when we fix the problem with one of the reconcilers
+ // executing partial reconciliation will leave the table in the state with partially current and partially outdated versions
+ reconcileCommand = null;
+ }
+
+ }
+
+ return reconcileCommand;
+ }
+
+ /**
+ * Handles exception from running the table reconciler under {@link GMFUnsafe}.
+ * At the time method is called the table is probably broken, but default implementation just logs error.
+ * <p/>
+ * This is to allow subclass to decide whether it is worth opening the problem table.
+ */
+ protected void handleReconcileException(Table table, Exception e) throws CoreException {
+ Activator.log.error("Reconciling the table: " + table, e); //$NON-NLS-1$
+ }
+}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableViewPrototype.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableViewPrototype.java
index c61113c9f9b..d89572d47d1 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableViewPrototype.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableViewPrototype.java
@@ -1,127 +1,127 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.nattable.common.helper;
-
-import org.eclipse.emf.common.command.AbstractCommand;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.infra.nattable.common.handlers.PolicyDefinedTableHandler;
-import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
-import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusSyncTable;
-import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusTable;
-import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
-
-
-/**
- * Represents the prototype of a table defined in a viewpoint
- *
- * @author Laurent Wouters
- */
-public class TableViewPrototype extends ViewPrototype {
- private URI configFile;
-
- public TableViewPrototype(PapyrusTable configuration) {
- super(configuration);
- configFile = URI.createURI(configuration.getConfiguration());
- }
-
- public TableViewPrototype(PapyrusSyncTable configuration, String file) {
- super(configuration);
- configFile = URI.createURI(file);
- }
-
- @Override
- public boolean isOwnerReassignable() {
- return true;
- }
-
- @Override
- public boolean instantiateOn(EObject owner) {
- return instantiateOn(owner, null);
- }
-
- @Override
- public boolean instantiateOn(EObject owner, String name) {
- if (configFile == null) {
- return false;
- }
- PolicyDefinedTableHandler handler = new PolicyDefinedTableHandler(configFile, owner, name);
- return handler.execute(this);
- }
-
- @Override
- public Command getCommandChangeOwner(EObject view, final EObject target) {
- final Table table = (Table) view;
- final EObject previous = table.getOwner();
- return new AbstractCommand("Change table owner") {
- @Override
- public void execute() {
- table.setOwner(target);
- }
-
- @Override
- public void undo() {
- table.setOwner(previous);
- }
-
- @Override
- public void redo() {
- table.setOwner(target);
- }
-
- @Override
- protected boolean prepare() {
- return true;
- }
- };
- }
-
- @Override
- public Command getCommandChangeRoot(EObject view, final EObject target) {
- final Table table = (Table) view;
- final EObject previous = table.getContext();
- return new AbstractCommand("Change table root element") {
- @Override
- public void execute() {
- table.setContext(target);
- }
-
- @Override
- public void undo() {
- table.setContext(previous);
- }
-
- @Override
- public void redo() {
- table.setContext(target);
- }
-
- @Override
- protected boolean prepare() {
- return true;
- }
- };
- }
-
- @Override
- public EObject getOwnerOf(EObject view) {
- return ((Table) view).getOwner();
- }
-
- @Override
- public EObject getRootOf(EObject view) {
- return ((Table) view).getContext();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.common.helper;
+
+import org.eclipse.emf.common.command.AbstractCommand;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.infra.nattable.common.handlers.PolicyDefinedTableHandler;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.infra.nattable.representation.PapyrusSyncTable;
+import org.eclipse.papyrus.infra.nattable.representation.PapyrusTable;
+import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
+
+
+/**
+ * Represents the prototype of a table defined in a viewpoint
+ *
+ * @author Laurent Wouters
+ */
+public class TableViewPrototype extends ViewPrototype {
+ private URI configFile;
+
+ public TableViewPrototype(PapyrusTable configuration) {
+ super(configuration);
+ configFile = URI.createURI(configuration.getConfiguration());
+ }
+
+ public TableViewPrototype(PapyrusSyncTable configuration, String file) {
+ super(configuration);
+ configFile = URI.createURI(file);
+ }
+
+ @Override
+ public boolean isOwnerReassignable() {
+ return true;
+ }
+
+ @Override
+ public boolean instantiateOn(EObject owner) {
+ return instantiateOn(owner, null);
+ }
+
+ @Override
+ public boolean instantiateOn(EObject owner, String name) {
+ if (configFile == null) {
+ return false;
+ }
+ PolicyDefinedTableHandler handler = new PolicyDefinedTableHandler(configFile, owner, name);
+ return handler.execute(this);
+ }
+
+ @Override
+ public Command getCommandChangeOwner(EObject view, final EObject target) {
+ final Table table = (Table) view;
+ final EObject previous = table.getOwner();
+ return new AbstractCommand("Change table owner") {
+ @Override
+ public void execute() {
+ table.setOwner(target);
+ }
+
+ @Override
+ public void undo() {
+ table.setOwner(previous);
+ }
+
+ @Override
+ public void redo() {
+ table.setOwner(target);
+ }
+
+ @Override
+ protected boolean prepare() {
+ return true;
+ }
+ };
+ }
+
+ @Override
+ public Command getCommandChangeRoot(EObject view, final EObject target) {
+ final Table table = (Table) view;
+ final EObject previous = table.getContext();
+ return new AbstractCommand("Change table root element") {
+ @Override
+ public void execute() {
+ table.setContext(target);
+ }
+
+ @Override
+ public void undo() {
+ table.setContext(previous);
+ }
+
+ @Override
+ public void redo() {
+ table.setContext(target);
+ }
+
+ @Override
+ protected boolean prepare() {
+ return true;
+ }
+ };
+ }
+
+ @Override
+ public EObject getOwnerOf(EObject view) {
+ return ((Table) view).getOwner();
+ }
+
+ @Override
+ public EObject getRootOf(EObject view) {
+ return ((Table) view).getContext();
+ }
+}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/reconciler/TableReconciler.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/reconciler/TableReconciler.java
new file mode 100644
index 00000000000..fbd5a249dad
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/reconciler/TableReconciler.java
@@ -0,0 +1,131 @@
+/*****************************************************************************
+ * Copyright (c) 2017 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:
+ *
+ * Maged Elaasar - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.common.reconciler;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.notation.StringValueStyle;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+
+/**
+ * Instances of this base class are provided via "org.eclipse.papyrus.infra.gmfdiag.common.tableReconciler" extension point and provide migration of
+ * the table instances from "previous" version to the "current" Papyrus version. The version is stored as a {@link StringValueStyle} with name {@link TableVersioningUtils#COMPATIBILITY_VERSION}.
+ * <p/>
+ * Every {@link TableReconciler} subclass provides statical descriptor of its capabilities (that is, the supported table type, outdated "previous" version and the expected "current" version). For some possible advanced cases it also gets a chance to
+ * decline the reconciliation for some particular instance based on runtime data, via {@link TableReconciler#canReconcileFrom(Table, String)}.
+ * <p/>
+ * If the suitable reconcilers are found, all of them are asked to update table instance before the first table opening. Planned modifications are provided as an {@link ICommand} instance that allows user to roll-back them all at once.
+ * <p/>
+ */
+public abstract class TableReconciler implements IExecutableExtension {
+
+ /**
+ * Extension point attribute passed to {@link IConfigurationElement#createExecutableExtension(String)}, so value should be FQN of reconciler to
+ * instantiate.
+ * <p/>
+ * Note that the value of this class will be used to search the instance to un-register, so it should be unique among all the reconcilers for given table type. It is however safe to define same reconciler class for different table types.
+ * <p/>
+ * Value of this constant is "reconcilerClass"
+ */
+ public static final String ATTR_RECONCILER_CLASS = "reconcilerClass"; //$NON-NLS-1$
+
+ /**
+ * Mandatory extension attribute to define applicable outdated table version this reconciler can handle.
+ * Reconciler's that wants to update tables created before the Papyrus 1.0.0 release may be registered to "undefined" source version.
+ * <p/>
+ * Value of this constant is "source"
+ */
+ public static final String ATTR_SOURCE_VERSION = "source"; //$NON-NLS-1$
+
+ /**
+ * Mandatory extension attribute to define applicable "current" table version this reconciler will update the instance to.
+ * <p/>
+ * This value should pass the {@link TableVersioningUtils#isCurrentPapyrusVersion(String)} check for reconciler to be considered.
+ * <p/>
+ * Value of this constant is "target"
+ */
+ public static final String ATTR_TARGET_VERSION = "target"; //$NON-NLS-1$
+
+ private String mySourceVersion;
+
+ private String myTargetVersion;
+
+ /**
+ * The value of this to be used when searching
+ */
+ private String myClassFqn;
+
+ /**
+ * Instance of reconciler gets a chance to deny reconciliation based on some custom run-time properties.
+ * The <code>false</code> value returned from this method means that the table is unsuitable for this reconciler, and does not assume any error.
+ * <p>
+ * Subclass can override tgis method, default implementation always return true, because all the dfeault filtering is done based on static extension declarations.
+ *
+ * @param table
+ * the runtime instance to reconcile
+ * @param currentTableVersion
+ * @return <code>false</code> if this reconciler wants to be ignored for some particular table instance
+ */
+ public boolean canReconcileFrom(Table table, String currentTableVersion) {
+ return true;
+ }
+
+ /**
+ * Creates command that will fix the given table and update it to the statically known "current" version.
+ * It is considered an error to return the command with {@link ICommand#canExecute()} of <code>false</code>, and editor implementation will log an
+ * erroneous reconcile attempt.
+ * <p/>
+ * If the reconciler wants to ignore the instance it can either return <code>false</code> from {@link TableReconciler#canReconcileFrom(Table, String)} or return <code>null</code> from this method
+ *
+ * @param table
+ * @return the command or <code>null</code> if nothing to do with this instance
+ */
+ public abstract ICommand getReconcileCommand(Table table);
+
+ @Override
+ public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
+ mySourceVersion = config.getAttribute(ATTR_SOURCE_VERSION);
+ myTargetVersion = config.getAttribute(ATTR_TARGET_VERSION);
+ myClassFqn = config.getAttribute(propertyName);
+ }
+
+ public String getSourceVersion() {
+ return mySourceVersion;
+ }
+
+ public String getTargetVersion() {
+ return myTargetVersion;
+ }
+
+ public String getClassFqn() {
+ return myClassFqn;
+ }
+
+ protected static boolean safeEquals(String s1, String s2) {
+ if (s1 == s2) {
+ return true;
+ }
+ return s1 != null && s1.equals(s2);
+ }
+
+ /**
+ * For debug purpose only
+ */
+ @Override
+ public String toString() {
+ return "TableReconciler:" + myClassFqn + "[" + mySourceVersion + " -> " + myTargetVersion + "]";
+ }
+}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/reconciler/TableReconcilersReader.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/reconciler/TableReconcilersReader.java
new file mode 100644
index 00000000000..6b5fcb1eef7
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/reconciler/TableReconcilersReader.java
@@ -0,0 +1,164 @@
+/*****************************************************************************
+ * Copyright (c) 2017 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:
+ *
+ * Maged Elaasar - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.common.reconciler;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.ecore.plugin.RegistryReader;
+import org.eclipse.papyrus.infra.nattable.common.Activator;
+
+/**
+ * A reader of table reconcilers from the extensions
+ */
+public class TableReconcilersReader extends RegistryReader {
+
+ private static volatile TableReconcilersReader ourInstance = null;
+
+ private static final String EXT_PT = "tableReconciler"; //$NON-NLS-1$
+
+ private static final String TAG_TABLE_RECONCILER = "tableReconciler"; //$NON-NLS-1$
+
+ private List<TableReconciler> myReconcilers;
+
+ public final static TableReconcilersReader getInstance() {
+ if (ourInstance == null) {
+ synchronized (TableReconcilersReader.class) {
+ if (ourInstance == null) {
+ ourInstance = new TableReconcilersReader();
+ }
+ }
+ }
+ return ourInstance;
+ }
+
+ TableReconcilersReader() {
+ super(Platform.getExtensionRegistry(), Activator.PLUGIN_ID, EXT_PT);
+ }
+
+ /**
+ * @return unmodifiable map of loaded reconcilers
+ */
+ public synchronized List<TableReconciler> load() {
+ if (myReconcilers == null) {
+ myReconcilers = new ArrayList<TableReconciler>();
+ readRegistry();
+ }
+ return myReconcilers;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.emf.ecore.plugin.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement, boolean)
+ */
+ @Override
+ protected boolean readElement(IConfigurationElement element, boolean add) {
+ if (!TAG_TABLE_RECONCILER.equals(element.getName())) {
+ return false;
+ }
+
+ String className = element.getAttribute(TableReconciler.ATTR_RECONCILER_CLASS);
+ String sourceVersion = element.getAttribute(TableReconciler.ATTR_SOURCE_VERSION);
+ String targetVersion = element.getAttribute(TableReconciler.ATTR_TARGET_VERSION);
+
+ if (!checkNotEmpty(className)) {
+ logMissingAttribute(element, TableReconciler.ATTR_RECONCILER_CLASS);
+ return false;
+ }
+ if (!checkNotEmpty(sourceVersion)) {
+ logMissingAttribute(element, TableReconciler.ATTR_SOURCE_VERSION);
+ return false;
+ }
+
+ if (!checkNotEmpty(targetVersion)) {
+ logMissingAttribute(element, TableReconciler.ATTR_TARGET_VERSION);
+ return false;
+ }
+ if (!TableVersioningUtils.isCurrentPapyrusVersion(targetVersion)) {
+ Activator.log.debug("Reconciler for outdated version is still registered but will never be executed: " + className); //$NON-NLS-1$
+ return false;
+ }
+
+
+ if (add) {
+ addTableReconciler(element);
+ } else {
+ removeTableReconciler(element);
+ }
+
+ return true;
+ }
+
+ private static boolean checkNotEmpty(String attr) {
+ return (attr != null) && (attr.length() != 0);
+ }
+
+ protected void addTableReconciler(IConfigurationElement element) {
+ TableReconciler reconciler = createReconciler(element);
+ if (reconciler != null) {
+ synchronized (myReconcilers) {
+ myReconcilers.add(reconciler);
+ }
+ }
+ }
+
+ /**
+ * Unregisters reconciler defined by given extension element.
+ * <p/>
+ * Only table type and fully qualified class name will be used to find the one instance to remove.
+ */
+ protected void removeTableReconciler(IConfigurationElement element) {
+ String fqn = element.getAttribute(TableReconciler.ATTR_RECONCILER_CLASS);
+ if (fqn == null) {
+ // we already have skipped this config at the time of addition
+ return;
+ }
+
+ synchronized (myReconcilers) {
+ for (Iterator<TableReconciler> it = myReconcilers.iterator(); it.hasNext();) {
+ TableReconciler next = it.next();
+ if (fqn.equals(next.getClassFqn())) {
+ it.remove();
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * Instantiates the reconciler defined by given extension
+ *
+ * @param element
+ * @return configured reconciler instance or <code>null</code> if something bad happens (error is logged in this case)
+ */
+ private TableReconciler createReconciler(IConfigurationElement element) {
+ try {
+ Object reconcilerObject = element.createExecutableExtension(TableReconciler.ATTR_RECONCILER_CLASS);
+ if (reconcilerObject instanceof TableReconciler) {
+ return (TableReconciler) reconcilerObject;
+ } else {
+ Activator.log.error("Table reconciler extension does not extend mandatory TableReconciler base class: " + element.getAttribute(TableReconciler.ATTR_RECONCILER_CLASS), null); //$NON-NLS-1$
+ }
+ } catch (CoreException e) {
+ Activator.log.error(e);
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/reconciler/TableVersioningUtils.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/reconciler/TableVersioningUtils.java
new file mode 100644
index 00000000000..07098672b9a
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/reconciler/TableVersioningUtils.java
@@ -0,0 +1,204 @@
+/*****************************************************************************
+ * Copyright (c) 2017 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:
+ *
+ * Maged Elaasar - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.common.reconciler;
+
+import java.util.AbstractMap;
+import java.util.StringTokenizer;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.papyrus.infra.nattable.common.Activator;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+
+/**
+ * This class provide several convenience methods to tag a table with a version number
+ * or retrieve this version number.
+ */
+public class TableVersioningUtils {
+
+ /**
+ * Returns the "current" table version. Tables with this version don't require the reconciliation until the Papyrus version updates in such a
+ * way that some tables needs reconciliation.
+ * <p/>
+ * The current value returned by this method is "1.3.0".
+ * <p/>
+ * The value itself, howewer, should NOT be used outside of this package to avoid weird dependency issues. Instead, external code should
+ * use {@link TableVersioningUtils#stampCurrentVersion(Table)} and
+ * {@link TableVersioningUtils#createStampCurrentVersionCommand(Table)}.
+ * <p/>
+ * This method is intentinally NOT a constant but indeed the method. This method is intentionally private and should NOT be made public.
+ */
+ private static String CURRENT_TABLE_VERSION() {
+ return "1.3.0"; //$NON-NLS-1$
+ }
+
+ /**
+ * Directly marks the given table as either created with "current" Papyrus version or already reconciled to the "current" Papyrus version.
+ * <p/>
+ * It is guaranteed that {@link TableVersioningUtils#isOfCurrentPapyrusVersion(Table)} returns true immediately after the call to this method.
+ *
+ * @param table
+ * table to stamp as "current"
+ */
+ public static void stampCurrentVersion(Table table) {
+ setCompatibilityVersion(table, CURRENT_TABLE_VERSION());
+ }
+
+ /**
+ * Returns the command that will mark the given table as either created with "current" Papyrus version or already reconciled to the "current"
+ * Papyrus version.
+ * <p/>
+ * It is guaranteed that {@link TableVersioningUtils#isOfCurrentPapyrusVersion(Table)} will returns true immediately after the execution of the command.
+ *
+ * @param table
+ * @return the command that is guaranteed to be not null and executable
+ */
+ public static ICommand createStampCurrentVersionCommand(Table table) {
+ EAnnotation annot = findOrCreateCompatibilityAnnotation(table);
+ if (annot.eContainer() == null) {
+ annot.getDetails().put(COMPATIBILITY_VERSION, CURRENT_TABLE_VERSION());
+ return new SetValueCommand(new SetRequest(table, EcorePackage.eINSTANCE.getEModelElement_EAnnotations(), annot));
+ } else {
+ return new SetValueCommand(new SetRequest(annot, EcorePackage.eINSTANCE.getEAnnotation_Details(), new AbstractMap.SimpleEntry<String, String>(COMPATIBILITY_VERSION, CURRENT_TABLE_VERSION())));
+ }
+ }
+
+ /**
+ * The name of the {@link EAnnotation} that defines actual table version.
+ */
+ public static final String VERSION_ANNOTATION = "http://www.eclipse.org/papyrus/infra/nattable/version";//$NON-NLS-1$
+
+ /**
+ * The name of the {@link EAnnotation} that defines actual table version.
+ * <p/>
+ * The value for this constant is "version", it is intentionally the same as been used for SysML tables versioning.
+ */
+ public static final String COMPATIBILITY_VERSION = "version";//$NON-NLS-1$
+
+ /**
+ * The version constant for the tables that does not have a {@link TableVersioningUtils#COMPATIBILITY_VERSION} annotation.
+ * It may be assumed that these tables had been created on or before Papyrus 1.0.
+ */
+ public static final String UNDEFINED_VERSION = "undefined";//$NON-NLS-1$
+
+ private static final String DELIM_VERSION = ".";//$NON-NLS-1$
+
+ /**
+ * Get the table compatibility version.
+ *
+ * @param view
+ * the table
+ * @return the compatibility version or {@link TableVersioningUtils#UNDEFINED_VERSION} if none stored. Never returns <code>null</code>.
+ */
+ public static String getCompatibilityVersion(Table table) {
+ EAnnotation annot = findOrCreateCompatibilityAnnotation(table);
+ return annot.eContainer() == null ? UNDEFINED_VERSION : annot.getDetails().get(COMPATIBILITY_VERSION);
+ }
+
+ /**
+ * Set the table compatibility version.
+ *
+ * @param table
+ * the table
+ * @param version
+ * the compatibility version
+ */
+ public static void setCompatibilityVersion(Table table, String version) {
+ EAnnotation annot = findOrCreateCompatibilityAnnotation(table);
+ annot.getDetails().put(COMPATIBILITY_VERSION, version);
+ if (annot.eContainer() == null) {
+ table.getEAnnotations().add(annot);
+ }
+ }
+
+ /**
+ * Finds the existing annotation with {@link TableVersioningUtils#VERSION_ANNOTATION} name or creates a new one if none existing found.
+ * If a new annotation is created, it's not attached to the table
+ *
+ * @param table
+ * @return the existing or a new annotation with {@link TableVersioningUtils#VERSION_ANNOTATION} name.
+ */
+ private static EAnnotation findOrCreateCompatibilityAnnotation(Table table) {
+ EAnnotation annot = table.getEAnnotation(VERSION_ANNOTATION);
+ if (annot == null) {
+ annot = EcoreFactory.eINSTANCE.createEAnnotation();
+ annot.setSource(VERSION_ANNOTATION);
+ annot.getDetails().put(COMPATIBILITY_VERSION, CURRENT_TABLE_VERSION());
+ }
+ return annot;
+ }
+
+ /**
+ * Checks whether the table is of "current", last released type.
+ */
+ public static boolean isOfCurrentPapyrusVersion(Table table) {
+ return isCurrentPapyrusVersion(getCompatibilityVersion(table));
+ }
+
+ /**
+ * Checks whether the given string represent the current papyrus version without telling explicitly what the current version is.
+ *
+ * @param version
+ * version to check
+ * @return
+ */
+ public static boolean isCurrentPapyrusVersion(String version) {
+ return CURRENT_TABLE_VERSION().equals(version);
+ }
+
+ /**
+ * Compare to version number.
+ * The test is done only on the first 2 segments of a version.
+ * The two String should have the same number of segments (i.e: 0.9.2 and 1.1.0).
+ *
+ * @param referenceVersion
+ * Version that is the reference for the test
+ * @param testedVersion
+ * the version that is compare to the reference.
+ * @return true if the tested Version is before the reference Version .
+ * false by default.
+ */
+ public static boolean isBeforeVersion(String referenceVersion, String testedVersion) {
+ boolean before = false;
+
+ StringTokenizer targetVersionTokenizer = new StringTokenizer(referenceVersion, DELIM_VERSION);
+ StringTokenizer sourceVersionTokenizer = new StringTokenizer(testedVersion, DELIM_VERSION);
+ try {
+ if (targetVersionTokenizer.countTokens() == sourceVersionTokenizer.countTokens()) {// Check if the format is the same for the 2 Strings
+ int targetMainVersion = Integer.parseInt(targetVersionTokenizer.nextToken());// get the first number
+ int sourceMainVersion = Integer.parseInt(sourceVersionTokenizer.nextToken());
+ if (targetMainVersion == sourceMainVersion) {// if main versions are the same check the intermediate version
+ int targetIntermediateVersion = Integer.parseInt(targetVersionTokenizer.nextToken());// get the second number
+ int sourceIntermediateVersion = Integer.parseInt(sourceVersionTokenizer.nextToken());
+ before = (targetIntermediateVersion > sourceIntermediateVersion);
+
+
+ } else {
+ before = (targetMainVersion > sourceMainVersion);
+ }
+ }
+
+ } catch (NumberFormatException e) {
+ Activator.log.error(e);
+ }
+
+ return before;
+ }
+
+
+}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/wizards/ChooseNattableConfigWizardPage.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/wizards/ChooseNattableConfigWizardPage.java
index 95a66bfa848..46361c106a9 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/wizards/ChooseNattableConfigWizardPage.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/wizards/ChooseNattableConfigWizardPage.java
@@ -42,8 +42,8 @@ import org.eclipse.papyrus.infra.nattable.common.helper.TableViewPrototype;
import org.eclipse.papyrus.infra.nattable.common.messages.Messages;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableconfiguration.TableConfiguration;
import org.eclipse.papyrus.infra.nattable.nattableconfiguration.NattableConfigurationRegistry;
-import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusSyncTable;
-import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusTable;
+import org.eclipse.papyrus.infra.nattable.representation.PapyrusSyncTable;
+import org.eclipse.papyrus.infra.nattable.representation.PapyrusTable;
import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
import org.eclipse.swt.SWT;
@@ -73,7 +73,7 @@ public class ChooseNattableConfigWizardPage extends WizardPage {
/**
* The context of the future table.
*/
- private Object context;
+ private EObject context;
/**
* The checked image for the table to select the view prototypes.
@@ -191,7 +191,7 @@ public class ChooseNattableConfigWizardPage extends WizardPage {
@Override
public String getText(final Object element) {
ViewPrototype viewPrototype = (ViewPrototype) element;
- return viewPrototype.getConfiguration().getImplementationID();
+ return viewPrototype.getRepresentationKind().getImplementationID();
}
@Override
@@ -356,8 +356,8 @@ public class ChooseNattableConfigWizardPage extends WizardPage {
final List<ViewPrototype> viewPrototypes = new ArrayList<ViewPrototype>();
// build a list of all the available prototypes corresponding to the context
- for (final ViewPrototype proto : PolicyChecker.getCurrent().getAllPrototypes()) {
- if ((proto.getConfiguration() instanceof PapyrusTable || proto.getConfiguration() instanceof PapyrusSyncTable)) {
+ for (final ViewPrototype proto : PolicyChecker.getFor(context).getAllPrototypes()) {
+ if ((proto.getRepresentationKind() instanceof PapyrusTable || proto.getRepresentationKind() instanceof PapyrusSyncTable)) {
if (NattableConfigurationRegistry.INSTANCE.canCreateTable(proto.getImplementation(), context).isOK()) {
viewPrototypes.add(proto);
}
@@ -379,15 +379,15 @@ public class ChooseNattableConfigWizardPage extends WizardPage {
* the {@link URI} of the nattable configuration, or <code>null</code> if not found
*/
private URI getTableConfigurationURI(final TableViewPrototype viewPrototype) {
- if (viewPrototype.getConfiguration() instanceof PapyrusTable) {
- PapyrusTable papyrusTable = (PapyrusTable) viewPrototype.getConfiguration();
+ if (viewPrototype.getRepresentationKind() instanceof PapyrusTable) {
+ PapyrusTable papyrusTable = (PapyrusTable) viewPrototype.getRepresentationKind();
String uri = papyrusTable.getConfiguration();
if (uri != null && uri.length() > 0) {
return URI.createURI(uri);
}
}
- if (viewPrototype.getConfiguration() instanceof PapyrusSyncTable) {
- return NattableConfigurationRegistry.INSTANCE.getConfigurationURI(((PapyrusSyncTable) viewPrototype.getConfiguration()).getImplementationID());
+ if (viewPrototype.getRepresentationKind() instanceof PapyrusSyncTable) {
+ return NattableConfigurationRegistry.INSTANCE.getConfigurationURI(((PapyrusSyncTable) viewPrototype.getRepresentationKind()).getImplementationID());
}
return null;
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/internal/common/commands/CreateAndOpenTableEditorCommand.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/internal/common/commands/CreateAndOpenTableEditorCommand.java
index 8609b0e7575..182dd99ec1e 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/internal/common/commands/CreateAndOpenTableEditorCommand.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/internal/common/commands/CreateAndOpenTableEditorCommand.java
@@ -23,6 +23,7 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager;
import org.eclipse.papyrus.infra.nattable.common.helper.TableViewPrototype;
import org.eclipse.papyrus.infra.nattable.common.modelresource.PapyrusNattableModel;
+import org.eclipse.papyrus.infra.nattable.common.reconciler.TableVersioningUtils;
import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableconfiguration.TableConfiguration;
import org.eclipse.papyrus.infra.nattable.utils.TableHelper;
@@ -215,7 +216,7 @@ public class CreateAndOpenTableEditorCommand extends RecordingCommand {
@Override
protected void doExecute() {
final Table table = TableHelper.createTable(configuration, null, this.name, this.description); // context null here, see bug 410357
-
+ TableVersioningUtils.stampCurrentVersion(table);
table.setContext(this.context);
// Save the model in the associated resource
@@ -226,7 +227,7 @@ public class CreateAndOpenTableEditorCommand extends RecordingCommand {
} else {
table.setOwner(this.owner);
}
- table.setPrototype(tableViewPrototype.getConfiguration());
+ table.setPrototype(tableViewPrototype.getRepresentationKind());
if (this.pageManager != null) {
this.pageManager.openPage(table);
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetTableIcon.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetTableIcon.java
index 3341bf0d2af..77654b22492 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetTableIcon.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.modelexplorer/src/org/eclipse/papyrus/infra/nattable/modelexplorer/queries/GetTableIcon.java
@@ -11,15 +11,16 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.nattable.modelexplorer.queries;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IImage;
import org.eclipse.papyrus.emf.facet.custom.ui.ImageUtils;
import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager;
import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException;
import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2;
import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2;
+import org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind;
import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
import org.eclipse.papyrus.infra.ui.editorsfactory.AbstractGetEditorIconQuery;
-import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusView;
import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
/** Return the path to the icon of the corresponding table */
@@ -27,7 +28,7 @@ public class GetTableIcon extends AbstractGetEditorIconQuery implements IJavaQue
@Override
public IImage evaluate(Table source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException {
- ViewPrototype prototype = ViewPrototype.get((PapyrusView) source.getPrototype());
- return ImageUtils.wrap(prototype.getIconURI());
+ ViewPrototype prototype = ViewPrototype.get(source);
+ return (prototype != null) ? ImageUtils.wrap(prototype.getIconURI()) : null;
}
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/EObjectInFlatTable.xwt b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/EObjectInFlatTable.xwt
index 0fc1e2013dd..f3fe1a6a088 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/EObjectInFlatTable.xwt
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/EObjectInFlatTable.xwt
@@ -21,7 +21,7 @@
</Composite.layout>
<ppe:ReferenceLabel input="{Binding}"
property="EObjectInTable:Table:prototype" readOnly="true"
- customLabel="View Type"></ppe:ReferenceLabel>
+ customLabel="Table Kind"></ppe:ReferenceLabel>
<ppe:ReferenceDialog input="{Binding}"
property="EObjectInTable:Table:owner" customLabel="Owner"></ppe:ReferenceDialog>
<ppe:ReferenceLabel input="{Binding}"
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/EObjectInTreeTable.xwt b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/EObjectInTreeTable.xwt
index 1e2d8ba91ed..1d6f7d971bc 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/EObjectInTreeTable.xwt
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/EObjectInTreeTable.xwt
@@ -21,7 +21,7 @@
</Composite.layout>
<ppe:ReferenceLabel input="{Binding}"
property="EObjectInTable:Table:prototype" readOnly="true"
- customLabel="View Type"></ppe:ReferenceLabel>
+ customLabel="Table Kind"></ppe:ReferenceLabel>
<ppe:ReferenceDialog input="{Binding}"
property="EObjectInTable:Table:owner" customLabel="Owner"></ppe:ReferenceDialog>
<ppe:ReferenceLabel input="{Binding}"
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/SingleTable.xwt b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/SingleTable.xwt
index 034fdb13d6f..e4aeae38110 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/SingleTable.xwt
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/SingleTable.xwt
@@ -20,7 +20,7 @@
<ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout>
</Composite.layout>
<ppe:ReferenceLabel input="{Binding}"
- property="nattable:Table:prototype" readOnly="true" customLabel="View Type"></ppe:ReferenceLabel>
+ property="nattable:Table:prototype" readOnly="true" customLabel="Table Kind"></ppe:ReferenceLabel>
<ppe:ReferenceDialog input="{Binding}" property="nattable:Table:owner"
customLabel="Owner"></ppe:ReferenceDialog>
<ppe:ReferenceLabel input="{Binding}" property="nattable:Table:context"
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/SingleTreeTable.xwt b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/SingleTreeTable.xwt
index a2e58450cb6..febd67e8609 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/SingleTreeTable.xwt
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/model/ui/SingleTreeTable.xwt
@@ -20,7 +20,7 @@
<ppel:PropertiesLayout numColumns="2"></ppel:PropertiesLayout>
</Composite.layout>
<ppe:ReferenceLabel input="{Binding}"
- property="nattable:Table:prototype" readOnly="true" customLabel="View Type"></ppe:ReferenceLabel>
+ property="nattable:Table:prototype" readOnly="true" customLabel="Table Kind"></ppe:ReferenceLabel>
<ppe:ReferenceDialog input="{Binding}" property="nattable:Table:owner"
customLabel="Owner"></ppe:ReferenceDialog>
<ppe:ReferenceLabel input="{Binding}"
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/modelelement/NatTableModelElement.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/modelelement/NatTableModelElement.java
index acce95f2b98..e759b7a95ae 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/modelelement/NatTableModelElement.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.properties/src/org/eclipse/papyrus/infra/nattable/properties/modelelement/NatTableModelElement.java
@@ -28,6 +28,7 @@ import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind;
import org.eclipse.papyrus.infra.emf.nattable.selection.EObjectSelectionExtractor;
import org.eclipse.papyrus.infra.nattable.contentprovider.ColumnAxisIdentifierContentProvider;
import org.eclipse.papyrus.infra.nattable.contentprovider.ColumnContainmentFeatureContentProvider;
@@ -84,7 +85,6 @@ import org.eclipse.papyrus.infra.nattable.properties.utils.Constants;
import org.eclipse.papyrus.infra.nattable.utils.HeaderAxisConfigurationManagementUtils;
import org.eclipse.papyrus.infra.nattable.utils.NattableModelManagerFactory;
import org.eclipse.papyrus.infra.properties.ui.modelelement.EMFModelElement;
-import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusView;
import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
import org.eclipse.swt.graphics.Image;
@@ -629,19 +629,19 @@ public class NatTableModelElement extends EMFModelElement {
@Override
public Image getImage(Object element) {
- if (element == null) {
+ if (!(element instanceof PapyrusRepresentationKind)) {
return null;
}
- ViewPrototype proto = ViewPrototype.get((PapyrusView) element);
+ ViewPrototype proto = ViewPrototype.get((PapyrusRepresentationKind) element);
return proto.getIcon();
}
@Override
public String getText(Object element) {
- if (element == null) {
+ if (!(element instanceof PapyrusRepresentationKind)) {
return null;
}
- ViewPrototype proto = ViewPrototype.get((PapyrusView) element);
+ ViewPrototype proto = ViewPrototype.get((PapyrusRepresentationKind) element);
return proto.getQualifiedName();
}
};
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/.classpath b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/.classpath
new file mode 100644
index 00000000000..858bac421b8
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.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/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/.project b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/.project
new file mode 100644
index 00000000000..b0754473f28
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.nattable.representation.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/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/META-INF/MANIFEST.MF b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..1906c92b546
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/META-INF/MANIFEST.MF
@@ -0,0 +1,23 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.infra.nattable.representation.edit;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-ClassPath: .
+Bundle-Activator: org.eclipse.papyrus.infra.nattable.representation.provider.RepresentationEditPlugin$Implementation
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Export-Package: org.eclipse.papyrus.infra.nattable.representation.provider
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.papyrus.infra.nattable.representation;visibility:=reexport,
+ org.eclipse.emf.edit;visibility:=reexport,
+ org.eclipse.papyrus.infra.core.architecture;visibility:=reexport,
+ org.eclipse.papyrus.infra.core.architecture.edit;visibility:=reexport,
+ org.eclipse.papyrus.infra.constraints;visibility:=reexport,
+ org.eclipse.papyrus.infra.constraints.edit;visibility:=reexport,
+ org.eclipse.papyrus.infra.types;visibility:=reexport,
+ org.eclipse.papyrus.infra.types.edit;visibility:=reexport,
+ org.eclipse.papyrus.infra.architecture.representation;visibility:=reexport,
+ org.eclipse.papyrus.infra.architecture.representation.edit;visibility:=reexport
+Bundle-ActivationPolicy: lazy
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/about.html b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/about.html
new file mode 100644
index 00000000000..57d6d18a634
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/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 1, 2017</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/build.properties b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/build.properties
new file mode 100644
index 00000000000..62b77b9612e
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/build.properties
@@ -0,0 +1,20 @@
+# Copyright (c) 2017 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:
+# Maged Elaasar - Initial API and implementation
+#
+#
+
+bin.includes = .,\
+ icons/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties
+jars.compile.order = .
+source.. = src-gen/
+output.. = bin/
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/ctool16/CreateArchitectureDescriptionLanguage_representationKinds_PapyrusSyncTable.gif b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/ctool16/CreateArchitectureDescriptionLanguage_representationKinds_PapyrusSyncTable.gif
new file mode 100644
index 00000000000..bad30bb8e3d
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/ctool16/CreateArchitectureDescriptionLanguage_representationKinds_PapyrusSyncTable.gif
Binary files differ
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/ctool16/CreateArchitectureDescriptionLanguage_representationKinds_PapyrusTable.gif b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/ctool16/CreateArchitectureDescriptionLanguage_representationKinds_PapyrusTable.gif
new file mode 100644
index 00000000000..304981bb112
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/ctool16/CreateArchitectureDescriptionLanguage_representationKinds_PapyrusTable.gif
Binary files differ
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/obj16/PapyrusSyncTable.gif b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/obj16/PapyrusSyncTable.gif
new file mode 100644
index 00000000000..6ae6ab02668
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/obj16/PapyrusSyncTable.gif
Binary files differ
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/obj16/PapyrusTable.gif b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/obj16/PapyrusTable.gif
new file mode 100644
index 00000000000..6d5c9c4de9e
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/obj16/PapyrusTable.gif
Binary files differ
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/plugin.properties b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/plugin.properties
new file mode 100644
index 00000000000..37a6bb06d8e
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/plugin.properties
@@ -0,0 +1,33 @@
+# Copyright (c) 2017 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:
+# Maged Elaasar - Initial API and implementation
+#
+#
+
+pluginName = Nattable Representation Edit Support
+providerName = Eclipse Modeling Project
+
+_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_PapyrusSyncTable_type = Papyrus Sync Table
+_UI_PapyrusTable_type = Papyrus Table
+_UI_Unknown_type = Object
+
+_UI_Unknown_datatype= Value
+
+_UI_PapyrusTable_configuration_feature = Configuration
+_UI_Unknown_feature = Unspecified
+
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/plugin.xml b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/plugin.xml
new file mode 100644
index 00000000000..ce067bce48d
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/plugin.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+ Copyright (c) 2017 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:
+ Maged Elaasar - Initial API and implementation
+
+
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
+ <!-- @generated Representation -->
+ <factory
+ uri="http://www.eclipse.org/papyrus/infra/nattable/representation"
+ class="org.eclipse.papyrus.infra.nattable.representation.provider.RepresentationItemProviderAdapterFactory"
+ 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>
+
+ <extension point="org.eclipse.emf.edit.childCreationExtenders">
+ <!-- @generated Representation -->
+ <extender
+ uri="http://www.eclipse.org/papyrus/infra/core/architecture"
+ class="org.eclipse.papyrus.infra.nattable.representation.provider.RepresentationItemProviderAdapterFactory$ArchitectureChildCreationExtender"/>
+ </extension>
+
+</plugin>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/pom.xml b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/pom.xml
new file mode 100644
index 00000000000..973ffa17d99
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/pom.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.papyrus.infra-nattable</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.papyrus.infra.nattable.representation.edit</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project> \ No newline at end of file
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/src-gen/org/eclipse/papyrus/infra/nattable/representation/provider/PapyrusSyncTableItemProvider.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/src-gen/org/eclipse/papyrus/infra/nattable/representation/provider/PapyrusSyncTableItemProvider.java
new file mode 100644
index 00000000000..95da8d823e7
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/src-gen/org/eclipse/papyrus/infra/nattable/representation/provider/PapyrusSyncTableItemProvider.java
@@ -0,0 +1,118 @@
+/**
+ * Copyright (c) 2017 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:
+ * Maged Elaasar - Initial API and implementation
+ *
+ *
+ */
+package org.eclipse.papyrus.infra.nattable.representation.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.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.papyrus.infra.architecture.representation.provider.PapyrusRepresentationKindItemProvider;
+import org.eclipse.papyrus.infra.nattable.representation.PapyrusSyncTable;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.nattable.representation.PapyrusSyncTable} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PapyrusSyncTableItemProvider
+ extends PapyrusRepresentationKindItemProvider {
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrusSyncTableItemProvider(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);
+
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This returns PapyrusSyncTable.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object) {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/PapyrusSyncTable"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ @Override
+ public String getText(Object object) {
+ return getTextFor((PapyrusSyncTable) object);
+ }
+
+ /**
+ * 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);
+ 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 RepresentationEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/src-gen/org/eclipse/papyrus/infra/nattable/representation/provider/PapyrusTableItemProvider.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/src-gen/org/eclipse/papyrus/infra/nattable/representation/provider/PapyrusTableItemProvider.java
new file mode 100644
index 00000000000..049ec0ae6d7
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/src-gen/org/eclipse/papyrus/infra/nattable/representation/provider/PapyrusTableItemProvider.java
@@ -0,0 +1,150 @@
+/**
+ * Copyright (c) 2017 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:
+ * Maged Elaasar - Initial API and implementation
+ *
+ *
+ */
+package org.eclipse.papyrus.infra.nattable.representation.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.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.papyrus.infra.architecture.representation.provider.PapyrusRepresentationKindItemProvider;
+import org.eclipse.papyrus.infra.nattable.representation.PapyrusTable;
+import org.eclipse.papyrus.infra.nattable.representation.RepresentationPackage;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.nattable.representation.PapyrusTable} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class PapyrusTableItemProvider extends PapyrusRepresentationKindItemProvider {
+ /**
+ * 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);
+
+ addConfigurationPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Configuration feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addConfigurationPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_PapyrusTable_configuration_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_PapyrusTable_configuration_feature", "_UI_PapyrusTable_type"),
+ RepresentationPackage.Literals.PAPYRUS_TABLE__CONFIGURATION,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_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"));
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ @Override
+ public String getText(Object object) {
+ return getTextFor((PapyrusTable) object);
+ }
+
+ /**
+ * 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 RepresentationPackage.PAPYRUS_TABLE__CONFIGURATION:
+ 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 RepresentationEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/src-gen/org/eclipse/papyrus/infra/nattable/representation/provider/RepresentationEditPlugin.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/src-gen/org/eclipse/papyrus/infra/nattable/representation/provider/RepresentationEditPlugin.java
new file mode 100644
index 00000000000..5172eb2f3d0
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/src-gen/org/eclipse/papyrus/infra/nattable/representation/provider/RepresentationEditPlugin.java
@@ -0,0 +1,110 @@
+/**
+ * Copyright (c) 2017 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:
+ * Maged Elaasar - Initial API and implementation
+ *
+ *
+ */
+package org.eclipse.papyrus.infra.nattable.representation.provider;
+
+import org.eclipse.emf.common.EMFPlugin;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+import org.eclipse.papyrus.infra.constraints.provider.ConstraintsEditPlugin;
+
+import org.eclipse.papyrus.infra.core.architecture.provider.ArchitectureEditPlugin;
+
+import org.eclipse.papyrus.infra.types.provider.TypesConfigurationsEditPlugin;
+
+/**
+ * This is the central singleton for the Representation edit plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public final class RepresentationEditPlugin extends EMFPlugin {
+ /**
+ * Keep track of the singleton.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final RepresentationEditPlugin INSTANCE = new RepresentationEditPlugin();
+
+ /**
+ * 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
+ */
+ public RepresentationEditPlugin() {
+ super
+ (new ResourceLocator [] {
+ ArchitectureEditPlugin.INSTANCE,
+ ConstraintsEditPlugin.INSTANCE,
+ TypesConfigurationsEditPlugin.INSTANCE,
+ org.eclipse.papyrus.infra.architecture.representation.provider.RepresentationEditPlugin.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/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/src-gen/org/eclipse/papyrus/infra/nattable/representation/provider/RepresentationItemProviderAdapterFactory.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/src-gen/org/eclipse/papyrus/infra/nattable/representation/provider/RepresentationItemProviderAdapterFactory.java
new file mode 100644
index 00000000000..fbdf25afc00
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/src-gen/org/eclipse/papyrus/infra/nattable/representation/provider/RepresentationItemProviderAdapterFactory.java
@@ -0,0 +1,343 @@
+/**
+ * Copyright (c) 2017 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:
+ * Maged Elaasar - Initial API and implementation
+ *
+ *
+ */
+package org.eclipse.papyrus.infra.nattable.representation.provider;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+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.common.util.ResourceLocator;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.emf.edit.command.CommandParameter;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+
+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.IChildCreationExtender;
+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.core.architecture.ArchitectureDescriptionLanguage;
+import org.eclipse.papyrus.infra.core.architecture.ArchitecturePackage;
+
+import org.eclipse.papyrus.infra.core.architecture.util.ArchitectureSwitch;
+
+import org.eclipse.papyrus.infra.nattable.representation.RepresentationFactory;
+
+import org.eclipse.papyrus.infra.nattable.representation.util.RepresentationAdapterFactory;
+
+/**
+ * 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 RepresentationItemProviderAdapterFactory extends RepresentationAdapterFactory 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 RepresentationItemProviderAdapterFactory() {
+ 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.nattable.representation.PapyrusSyncTable} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrusSyncTableItemProvider papyrusSyncTableItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.papyrus.infra.nattable.representation.PapyrusSyncTable}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createPapyrusSyncTableAdapter() {
+ if (papyrusSyncTableItemProvider == null) {
+ papyrusSyncTableItemProvider = new PapyrusSyncTableItemProvider(this);
+ }
+
+ return papyrusSyncTableItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.infra.nattable.representation.PapyrusTable} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrusTableItemProvider papyrusTableItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.papyrus.infra.nattable.representation.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 (papyrusSyncTableItemProvider != null) papyrusSyncTableItemProvider.dispose();
+ if (papyrusTableItemProvider != null) papyrusTableItemProvider.dispose();
+ }
+
+ /**
+ * A child creation extender for the {@link ArchitecturePackage}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static class ArchitectureChildCreationExtender implements IChildCreationExtender {
+ /**
+ * The switch for creating child descriptors specific to each extended class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static class CreationSwitch extends ArchitectureSwitch<Object> {
+ /**
+ * The child descriptors being populated.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<Object> newChildDescriptors;
+
+ /**
+ * The domain in which to create the children.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EditingDomain editingDomain;
+
+ /**
+ * Creates the a switch for populating child descriptors in the given domain.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ CreationSwitch(List<Object> newChildDescriptors, EditingDomain editingDomain) {
+ this.newChildDescriptors = newChildDescriptors;
+ this.editingDomain = editingDomain;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object caseArchitectureDescriptionLanguage(ArchitectureDescriptionLanguage object) {
+ newChildDescriptors.add
+ (createChildParameter
+ (ArchitecturePackage.Literals.ARCHITECTURE_DESCRIPTION_LANGUAGE__REPRESENTATION_KINDS,
+ RepresentationFactory.eINSTANCE.createPapyrusSyncTable()));
+
+ newChildDescriptors.add
+ (createChildParameter
+ (ArchitecturePackage.Literals.ARCHITECTURE_DESCRIPTION_LANGUAGE__REPRESENTATION_KINDS,
+ RepresentationFactory.eINSTANCE.createPapyrusTable()));
+
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected CommandParameter createChildParameter(Object feature, Object child) {
+ return new CommandParameter(null, feature, child);
+ }
+
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Collection<Object> getNewChildDescriptors(Object object, EditingDomain editingDomain) {
+ ArrayList<Object> result = new ArrayList<Object>();
+ new CreationSwitch(result, editingDomain).doSwitch((EObject)object);
+ return result;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ResourceLocator getResourceLocator() {
+ return RepresentationEditPlugin.INSTANCE;
+ }
+ }
+
+}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/.classpath b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/.classpath
new file mode 100644
index 00000000000..858bac421b8
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/.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/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/.project b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/.project
new file mode 100644
index 00000000000..c9b22dc0be3
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.nattable.representation</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/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/META-INF/MANIFEST.MF b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..9043b65bcfb
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/META-INF/MANIFEST.MF
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.infra.nattable.representation;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-ClassPath: .
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Export-Package: org.eclipse.papyrus.infra.nattable.representation,
+ org.eclipse.papyrus.infra.nattable.representation.impl,
+ org.eclipse.papyrus.infra.nattable.representation.util
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.ecore;visibility:=reexport,
+ org.eclipse.papyrus.infra.core.architecture;visibility:=reexport,
+ org.eclipse.papyrus.infra.constraints;visibility:=reexport,
+ org.eclipse.papyrus.infra.types;visibility:=reexport,
+ org.eclipse.papyrus.infra.architecture.representation;visibility:=reexport
+Bundle-ActivationPolicy: lazy
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/about.html b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/about.html
new file mode 100644
index 00000000000..57d6d18a634
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/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 1, 2017</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/build.properties b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/build.properties
new file mode 100644
index 00000000000..81ffbe2379a
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/build.properties
@@ -0,0 +1,20 @@
+# Copyright (c) 2017 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:
+# Maged Elaasar - Initial API and implementation
+#
+#
+
+bin.includes = .,\
+ model/,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties
+jars.compile.order = .
+source.. = src-gen/
+output.. = bin/
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/model/NattableRepresentation.ecore b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/model/NattableRepresentation.ecore
new file mode 100755
index 00000000000..629def092b4
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/model/NattableRepresentation.ecore
@@ -0,0 +1,10 @@
+<?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="representation" nsURI="http://www.eclipse.org/papyrus/infra/nattable/representation"
+ nsPrefix="nattablerepresentation">
+ <eClassifiers xsi:type="ecore:EClass" name="PapyrusSyncTable" eSuperTypes="../../org.eclipse.papyrus.infra.architecture.representation/model/Representation.ecore#//PapyrusRepresentationKind"/>
+ <eClassifiers xsi:type="ecore:EClass" name="PapyrusTable" eSuperTypes="../../org.eclipse.papyrus.infra.architecture.representation/model/Representation.ecore#//PapyrusRepresentationKind">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="configuration" lowerBound="1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/model/NattableRepresentation.genmodel b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/model/NattableRepresentation.genmodel
new file mode 100644
index 00000000000..5b1f3d033b9
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/model/NattableRepresentation.genmodel
@@ -0,0 +1,20 @@
+<?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) 2017 CEA LIST.&#xD;&#xA;&#xD;&#xA; All rights reserved. This program and the accompanying materials&#xD;&#xA; are made available under the terms of the Eclipse Public License v1.0&#xD;&#xA; which accompanies this distribution, and is available at&#xD;&#xA; http://www.eclipse.org/legal/epl-v10.html&#xD;&#xA; &#xD;&#xA; Contributors:&#xD;&#xA; Maged Elaasar - Initial API and implementation&#xD;&#xA; &#xD;&#xA;"
+ modelDirectory="/org.eclipse.papyrus.infra.nattable.representation/src-gen" editDirectory="/org.eclipse.papyrus.infra.nattable.representation.edit/src-gen"
+ editorDirectory="/org.eclipse.papyrus.infra.nattable.representation.editor/src-gen"
+ modelPluginID="org.eclipse.papyrus.infra.nattable.representation" modelName="Representation"
+ rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" testsDirectory="/org.eclipse.papyrus.infra.nattable.representation.tests/src-gen"
+ importerID="org.eclipse.emf.importer.ecore" complianceLevel="8.0" copyrightFields="false"
+ editPluginID="org.eclipse.papyrus.infra.nattable.representation.edit" editorPluginID="org.eclipse.papyrus.infra.nattable.representation.editor"
+ usedGenPackages="../../org.eclipse.papyrus.infra.core.architecture/model/Architecture.genmodel#//architecture ../../org.eclipse.papyrus.infra.constraints/Model/Constraints.genmodel#//constraints ../../org.eclipse.papyrus.infra.types/model/ElementTypesConfigurations.genmodel#//types ../../org.eclipse.papyrus.infra.architecture.representation/model/Representation.genmodel#//representation"
+ operationReflection="true" importOrganizing="true">
+ <foreignModel>NattableRepresentation.ecore</foreignModel>
+ <genPackages prefix="Representation" basePackage="org.eclipse.papyrus.infra.nattable"
+ disposableProviderFactory="true" childCreationExtenders="true" ecorePackage="NattableRepresentation.ecore#/">
+ <genClasses ecoreClass="NattableRepresentation.ecore#//PapyrusSyncTable"/>
+ <genClasses ecoreClass="NattableRepresentation.ecore#//PapyrusTable">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute NattableRepresentation.ecore#//PapyrusTable/configuration"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/plugin.properties b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/plugin.properties
new file mode 100644
index 00000000000..e57d9090ae4
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/plugin.properties
@@ -0,0 +1,14 @@
+# Copyright (c) 2017 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:
+# Maged Elaasar - Initial API and implementation
+#
+#
+
+pluginName = Nattable Representation Model
+providerName = Eclipse Modeling Project
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/plugin.xml b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/plugin.xml
new file mode 100644
index 00000000000..d465c91be47
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/plugin.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+ Copyright (c) 2017 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:
+ Maged Elaasar - Initial API and implementation
+
+
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.emf.ecore.generated_package">
+ <!-- @generated Representation -->
+ <package
+ uri="http://www.eclipse.org/papyrus/infra/nattable/representation"
+ class="org.eclipse.papyrus.infra.nattable.representation.RepresentationPackage"
+ genModel="model/NattableRepresentation.genmodel"/>
+ </extension>
+
+</plugin>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/pom.xml b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/pom.xml
new file mode 100644
index 00000000000..888c774a38a
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/pom.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.papyrus.infra-nattable</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.papyrus.infra.nattable.representation</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project> \ No newline at end of file
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/PapyrusSyncTable.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/PapyrusSyncTable.java
new file mode 100644
index 00000000000..ef48048cc97
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/PapyrusSyncTable.java
@@ -0,0 +1,29 @@
+/**
+ * Copyright (c) 2017 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:
+ * Maged Elaasar - Initial API and implementation
+ *
+ *
+ */
+package org.eclipse.papyrus.infra.nattable.representation;
+
+import org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Papyrus Sync Table</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see org.eclipse.papyrus.infra.nattable.representation.RepresentationPackage#getPapyrusSyncTable()
+ * @model
+ * @generated
+ */
+public interface PapyrusSyncTable extends PapyrusRepresentationKind {
+} // PapyrusSyncTable
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/PapyrusTable.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/PapyrusTable.java
new file mode 100644
index 00000000000..087a6804b03
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/PapyrusTable.java
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2017 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:
+ * Maged Elaasar - Initial API and implementation
+ *
+ *
+ */
+package org.eclipse.papyrus.infra.nattable.representation;
+
+import org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Papyrus Table</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.representation.PapyrusTable#getConfiguration <em>Configuration</em>}</li>
+ * </ul>
+ *
+ * @see org.eclipse.papyrus.infra.nattable.representation.RepresentationPackage#getPapyrusTable()
+ * @model
+ * @generated
+ */
+public interface PapyrusTable extends PapyrusRepresentationKind {
+ /**
+ * Returns the value of the '<em><b>Configuration</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Configuration</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Configuration</em>' attribute.
+ * @see #setConfiguration(String)
+ * @see org.eclipse.papyrus.infra.nattable.representation.RepresentationPackage#getPapyrusTable_Configuration()
+ * @model required="true"
+ * @generated
+ */
+ String getConfiguration();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.papyrus.infra.nattable.representation.PapyrusTable#getConfiguration <em>Configuration</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Configuration</em>' attribute.
+ * @see #getConfiguration()
+ * @generated
+ */
+ void setConfiguration(String value);
+
+} // PapyrusTable
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/RepresentationFactory.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/RepresentationFactory.java
new file mode 100644
index 00000000000..bc030866f65
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/RepresentationFactory.java
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2017 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:
+ * Maged Elaasar - Initial API and implementation
+ *
+ *
+ */
+package org.eclipse.papyrus.infra.nattable.representation;
+
+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.nattable.representation.RepresentationPackage
+ * @generated
+ */
+public interface RepresentationFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ RepresentationFactory eINSTANCE = org.eclipse.papyrus.infra.nattable.representation.impl.RepresentationFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Papyrus Sync Table</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Papyrus Sync Table</em>'.
+ * @generated
+ */
+ PapyrusSyncTable createPapyrusSyncTable();
+
+ /**
+ * 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
+ */
+ RepresentationPackage getRepresentationPackage();
+
+} //RepresentationFactory
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/RepresentationPackage.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/RepresentationPackage.java
new file mode 100644
index 00000000000..112d9d594c6
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/RepresentationPackage.java
@@ -0,0 +1,399 @@
+/**
+ * Copyright (c) 2017 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:
+ * Maged Elaasar - Initial API and implementation
+ *
+ *
+ */
+package org.eclipse.papyrus.infra.nattable.representation;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+
+/**
+ * <!-- 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 operation of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.infra.nattable.representation.RepresentationFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface RepresentationPackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "representation";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.eclipse.org/papyrus/infra/nattable/representation";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "nattablerepresentation";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ RepresentationPackage eINSTANCE = org.eclipse.papyrus.infra.nattable.representation.impl.RepresentationPackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.eclipse.papyrus.infra.nattable.representation.impl.PapyrusSyncTableImpl <em>Papyrus Sync Table</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.infra.nattable.representation.impl.PapyrusSyncTableImpl
+ * @see org.eclipse.papyrus.infra.nattable.representation.impl.RepresentationPackageImpl#getPapyrusSyncTable()
+ * @generated
+ */
+ int PAPYRUS_SYNC_TABLE = 0;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_SYNC_TABLE__NAME = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__NAME;
+
+ /**
+ * The feature id for the '<em><b>Desciption</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_SYNC_TABLE__DESCIPTION = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__DESCIPTION;
+
+ /**
+ * The feature id for the '<em><b>Qualified Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_SYNC_TABLE__QUALIFIED_NAME = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__QUALIFIED_NAME;
+
+ /**
+ * The feature id for the '<em><b>Language</b></em>' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_SYNC_TABLE__LANGUAGE = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__LANGUAGE;
+
+ /**
+ * The feature id for the '<em><b>Concerns</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_SYNC_TABLE__CONCERNS = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__CONCERNS;
+
+ /**
+ * The feature id for the '<em><b>Icon</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_SYNC_TABLE__ICON = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__ICON;
+
+ /**
+ * The feature id for the '<em><b>Parent</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_SYNC_TABLE__PARENT = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__PARENT;
+
+ /**
+ * The feature id for the '<em><b>Model Rules</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_SYNC_TABLE__MODEL_RULES = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__MODEL_RULES;
+
+ /**
+ * The feature id for the '<em><b>Owning Rules</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_SYNC_TABLE__OWNING_RULES = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__OWNING_RULES;
+
+ /**
+ * The feature id for the '<em><b>Implementation ID</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_SYNC_TABLE__IMPLEMENTATION_ID = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__IMPLEMENTATION_ID;
+
+ /**
+ * The number of structural features of the '<em>Papyrus Sync Table</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_SYNC_TABLE_FEATURE_COUNT = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND_FEATURE_COUNT + 0;
+
+ /**
+ * The number of operations of the '<em>Papyrus Sync Table</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_SYNC_TABLE_OPERATION_COUNT = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND_OPERATION_COUNT + 0;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.papyrus.infra.nattable.representation.impl.PapyrusTableImpl <em>Papyrus Table</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.infra.nattable.representation.impl.PapyrusTableImpl
+ * @see org.eclipse.papyrus.infra.nattable.representation.impl.RepresentationPackageImpl#getPapyrusTable()
+ * @generated
+ */
+ int PAPYRUS_TABLE = 1;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE__NAME = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__NAME;
+
+ /**
+ * The feature id for the '<em><b>Desciption</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE__DESCIPTION = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__DESCIPTION;
+
+ /**
+ * The feature id for the '<em><b>Qualified Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE__QUALIFIED_NAME = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__QUALIFIED_NAME;
+
+ /**
+ * The feature id for the '<em><b>Language</b></em>' container reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE__LANGUAGE = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__LANGUAGE;
+
+ /**
+ * The feature id for the '<em><b>Concerns</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE__CONCERNS = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__CONCERNS;
+
+ /**
+ * The feature id for the '<em><b>Icon</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE__ICON = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__ICON;
+
+ /**
+ * The feature id for the '<em><b>Parent</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE__PARENT = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__PARENT;
+
+ /**
+ * The feature id for the '<em><b>Model Rules</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE__MODEL_RULES = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__MODEL_RULES;
+
+ /**
+ * The feature id for the '<em><b>Owning Rules</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE__OWNING_RULES = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__OWNING_RULES;
+
+ /**
+ * The feature id for the '<em><b>Implementation ID</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE__IMPLEMENTATION_ID = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__IMPLEMENTATION_ID;
+
+ /**
+ * The feature id for the '<em><b>Configuration</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE__CONFIGURATION = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND_FEATURE_COUNT + 0;
+
+ /**
+ * 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 = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND_FEATURE_COUNT + 1;
+
+ /**
+ * The number of operations of the '<em>Papyrus Table</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PAPYRUS_TABLE_OPERATION_COUNT = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND_OPERATION_COUNT + 0;
+
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.papyrus.infra.nattable.representation.PapyrusSyncTable <em>Papyrus Sync Table</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Papyrus Sync Table</em>'.
+ * @see org.eclipse.papyrus.infra.nattable.representation.PapyrusSyncTable
+ * @generated
+ */
+ EClass getPapyrusSyncTable();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.papyrus.infra.nattable.representation.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.nattable.representation.PapyrusTable
+ * @generated
+ */
+ EClass getPapyrusTable();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.nattable.representation.PapyrusTable#getConfiguration <em>Configuration</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Configuration</em>'.
+ * @see org.eclipse.papyrus.infra.nattable.representation.PapyrusTable#getConfiguration()
+ * @see #getPapyrusTable()
+ * @generated
+ */
+ EAttribute getPapyrusTable_Configuration();
+
+ /**
+ * 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
+ */
+ RepresentationFactory getRepresentationFactory();
+
+ /**
+ * <!-- 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 operation 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.nattable.representation.impl.PapyrusSyncTableImpl <em>Papyrus Sync Table</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.infra.nattable.representation.impl.PapyrusSyncTableImpl
+ * @see org.eclipse.papyrus.infra.nattable.representation.impl.RepresentationPackageImpl#getPapyrusSyncTable()
+ * @generated
+ */
+ EClass PAPYRUS_SYNC_TABLE = eINSTANCE.getPapyrusSyncTable();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.papyrus.infra.nattable.representation.impl.PapyrusTableImpl <em>Papyrus Table</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.papyrus.infra.nattable.representation.impl.PapyrusTableImpl
+ * @see org.eclipse.papyrus.infra.nattable.representation.impl.RepresentationPackageImpl#getPapyrusTable()
+ * @generated
+ */
+ EClass PAPYRUS_TABLE = eINSTANCE.getPapyrusTable();
+
+ /**
+ * The meta object literal for the '<em><b>Configuration</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PAPYRUS_TABLE__CONFIGURATION = eINSTANCE.getPapyrusTable_Configuration();
+
+ }
+
+} //RepresentationPackage
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/impl/PapyrusSyncTableImpl.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/impl/PapyrusSyncTableImpl.java
new file mode 100644
index 00000000000..34cb0fa3b34
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/impl/PapyrusSyncTableImpl.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2017 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:
+ * Maged Elaasar - Initial API and implementation
+ *
+ *
+ */
+package org.eclipse.papyrus.infra.nattable.representation.impl;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.papyrus.infra.architecture.representation.impl.PapyrusRepresentationKindImpl;
+
+import org.eclipse.papyrus.infra.nattable.representation.PapyrusSyncTable;
+import org.eclipse.papyrus.infra.nattable.representation.RepresentationPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Papyrus Sync Table</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class PapyrusSyncTableImpl extends PapyrusRepresentationKindImpl implements PapyrusSyncTable {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrusSyncTableImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return RepresentationPackage.Literals.PAPYRUS_SYNC_TABLE;
+ }
+
+} //PapyrusSyncTableImpl
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/impl/PapyrusTableImpl.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/impl/PapyrusTableImpl.java
new file mode 100644
index 00000000000..86ed00363a5
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/impl/PapyrusTableImpl.java
@@ -0,0 +1,175 @@
+/**
+ * Copyright (c) 2017 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:
+ * Maged Elaasar - Initial API and implementation
+ *
+ *
+ */
+package org.eclipse.papyrus.infra.nattable.representation.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import org.eclipse.papyrus.infra.architecture.representation.impl.PapyrusRepresentationKindImpl;
+
+import org.eclipse.papyrus.infra.nattable.representation.PapyrusTable;
+import org.eclipse.papyrus.infra.nattable.representation.RepresentationPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Papyrus Table</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link org.eclipse.papyrus.infra.nattable.representation.impl.PapyrusTableImpl#getConfiguration <em>Configuration</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class PapyrusTableImpl extends PapyrusRepresentationKindImpl implements PapyrusTable {
+ /**
+ * The default value of the '{@link #getConfiguration() <em>Configuration</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getConfiguration()
+ * @generated
+ * @ordered
+ */
+ protected static final String CONFIGURATION_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getConfiguration() <em>Configuration</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getConfiguration()
+ * @generated
+ * @ordered
+ */
+ protected String configuration = CONFIGURATION_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PapyrusTableImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return RepresentationPackage.Literals.PAPYRUS_TABLE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getConfiguration() {
+ return configuration;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setConfiguration(String newConfiguration) {
+ String oldConfiguration = configuration;
+ configuration = newConfiguration;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, RepresentationPackage.PAPYRUS_TABLE__CONFIGURATION, oldConfiguration, configuration));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case RepresentationPackage.PAPYRUS_TABLE__CONFIGURATION:
+ return getConfiguration();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case RepresentationPackage.PAPYRUS_TABLE__CONFIGURATION:
+ setConfiguration((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case RepresentationPackage.PAPYRUS_TABLE__CONFIGURATION:
+ setConfiguration(CONFIGURATION_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case RepresentationPackage.PAPYRUS_TABLE__CONFIGURATION:
+ return CONFIGURATION_EDEFAULT == null ? configuration != null : !CONFIGURATION_EDEFAULT.equals(configuration);
+ }
+ 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(" (configuration: ");
+ result.append(configuration);
+ result.append(')');
+ return result.toString();
+ }
+
+} //PapyrusTableImpl
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/impl/RepresentationFactoryImpl.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/impl/RepresentationFactoryImpl.java
new file mode 100644
index 00000000000..c41263447e5
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/impl/RepresentationFactoryImpl.java
@@ -0,0 +1,117 @@
+/**
+ * Copyright (c) 2017 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:
+ * Maged Elaasar - Initial API and implementation
+ *
+ *
+ */
+package org.eclipse.papyrus.infra.nattable.representation.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.nattable.representation.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class RepresentationFactoryImpl extends EFactoryImpl implements RepresentationFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static RepresentationFactory init() {
+ try {
+ RepresentationFactory theRepresentationFactory = (RepresentationFactory)EPackage.Registry.INSTANCE.getEFactory(RepresentationPackage.eNS_URI);
+ if (theRepresentationFactory != null) {
+ return theRepresentationFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new RepresentationFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public RepresentationFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case RepresentationPackage.PAPYRUS_SYNC_TABLE: return createPapyrusSyncTable();
+ case RepresentationPackage.PAPYRUS_TABLE: return createPapyrusTable();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrusSyncTable createPapyrusSyncTable() {
+ PapyrusSyncTableImpl papyrusSyncTable = new PapyrusSyncTableImpl();
+ return papyrusSyncTable;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public PapyrusTable createPapyrusTable() {
+ PapyrusTableImpl papyrusTable = new PapyrusTableImpl();
+ return papyrusTable;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public RepresentationPackage getRepresentationPackage() {
+ return (RepresentationPackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ @Deprecated
+ public static RepresentationPackage getPackage() {
+ return RepresentationPackage.eINSTANCE;
+ }
+
+} //RepresentationFactoryImpl
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/impl/RepresentationPackageImpl.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/impl/RepresentationPackageImpl.java
new file mode 100644
index 00000000000..ab8cf64fd75
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/impl/RepresentationPackageImpl.java
@@ -0,0 +1,217 @@
+/**
+ * Copyright (c) 2017 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:
+ * Maged Elaasar - Initial API and implementation
+ *
+ *
+ */
+package org.eclipse.papyrus.infra.nattable.representation.impl;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.eclipse.papyrus.infra.nattable.representation.PapyrusSyncTable;
+import org.eclipse.papyrus.infra.nattable.representation.PapyrusTable;
+import org.eclipse.papyrus.infra.nattable.representation.RepresentationFactory;
+import org.eclipse.papyrus.infra.nattable.representation.RepresentationPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class RepresentationPackageImpl extends EPackageImpl implements RepresentationPackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass papyrusSyncTableEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass papyrusTableEClass = 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.nattable.representation.RepresentationPackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private RepresentationPackageImpl() {
+ super(eNS_URI, RepresentationFactory.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 RepresentationPackage#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 RepresentationPackage init() {
+ if (isInited) return (RepresentationPackage)EPackage.Registry.INSTANCE.getEPackage(RepresentationPackage.eNS_URI);
+
+ // Obtain or create and register package
+ RepresentationPackageImpl theRepresentationPackage = (RepresentationPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof RepresentationPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new RepresentationPackageImpl());
+
+ isInited = true;
+
+ // Initialize simple dependencies
+ org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.eINSTANCE.eClass();
+
+ // Create package meta-data objects
+ theRepresentationPackage.createPackageContents();
+
+ // Initialize created meta-data
+ theRepresentationPackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theRepresentationPackage.freeze();
+
+
+ // Update the registry and return the package
+ EPackage.Registry.INSTANCE.put(RepresentationPackage.eNS_URI, theRepresentationPackage);
+ return theRepresentationPackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getPapyrusSyncTable() {
+ return papyrusSyncTableEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getPapyrusTable() {
+ return papyrusTableEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPapyrusTable_Configuration() {
+ return (EAttribute)papyrusTableEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public RepresentationFactory getRepresentationFactory() {
+ return (RepresentationFactory)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
+ papyrusSyncTableEClass = createEClass(PAPYRUS_SYNC_TABLE);
+
+ papyrusTableEClass = createEClass(PAPYRUS_TABLE);
+ createEAttribute(papyrusTableEClass, PAPYRUS_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
+ org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage theRepresentationPackage_1 = (org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage)EPackage.Registry.INSTANCE.getEPackage(org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.eNS_URI);
+
+ // Create type parameters
+
+ // Set bounds for type parameters
+
+ // Add supertypes to classes
+ papyrusSyncTableEClass.getESuperTypes().add(theRepresentationPackage_1.getPapyrusRepresentationKind());
+ papyrusTableEClass.getESuperTypes().add(theRepresentationPackage_1.getPapyrusRepresentationKind());
+
+ // Initialize classes, features, and operations; add parameters
+ initEClass(papyrusSyncTableEClass, PapyrusSyncTable.class, "PapyrusSyncTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+
+ initEClass(papyrusTableEClass, PapyrusTable.class, "PapyrusTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getPapyrusTable_Configuration(), ecorePackage.getEString(), "configuration", null, 1, 1, PapyrusTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Create resource
+ createResource(eNS_URI);
+ }
+
+} //RepresentationPackageImpl
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/util/RepresentationAdapterFactory.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/util/RepresentationAdapterFactory.java
new file mode 100644
index 00000000000..f47445a05bf
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/util/RepresentationAdapterFactory.java
@@ -0,0 +1,208 @@
+/**
+ * Copyright (c) 2017 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:
+ * Maged Elaasar - Initial API and implementation
+ *
+ *
+ */
+package org.eclipse.papyrus.infra.nattable.representation.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.EObject;
+
+import org.eclipse.papyrus.infra.core.architecture.ADElement;
+import org.eclipse.papyrus.infra.core.architecture.RepresentationKind;
+
+import org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind;
+
+import org.eclipse.papyrus.infra.nattable.representation.*;
+
+/**
+ * <!-- 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.nattable.representation.RepresentationPackage
+ * @generated
+ */
+public class RepresentationAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static RepresentationPackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public RepresentationAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = RepresentationPackage.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 RepresentationSwitch<Adapter> modelSwitch =
+ new RepresentationSwitch<Adapter>() {
+ @Override
+ public Adapter casePapyrusSyncTable(PapyrusSyncTable object) {
+ return createPapyrusSyncTableAdapter();
+ }
+ @Override
+ public Adapter casePapyrusTable(PapyrusTable object) {
+ return createPapyrusTableAdapter();
+ }
+ @Override
+ public Adapter caseADElement(ADElement object) {
+ return createADElementAdapter();
+ }
+ @Override
+ public Adapter caseRepresentationKind(RepresentationKind object) {
+ return createRepresentationKindAdapter();
+ }
+ @Override
+ public Adapter casePapyrusRepresentationKind(PapyrusRepresentationKind object) {
+ return createPapyrusRepresentationKindAdapter();
+ }
+ @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.nattable.representation.PapyrusSyncTable <em>Papyrus Sync 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.nattable.representation.PapyrusSyncTable
+ * @generated
+ */
+ public Adapter createPapyrusSyncTableAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.nattable.representation.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.nattable.representation.PapyrusTable
+ * @generated
+ */
+ public Adapter createPapyrusTableAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.core.architecture.ADElement <em>AD 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.papyrus.infra.core.architecture.ADElement
+ * @generated
+ */
+ public Adapter createADElementAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.core.architecture.RepresentationKind <em>Representation Kind</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.core.architecture.RepresentationKind
+ * @generated
+ */
+ public Adapter createRepresentationKindAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind <em>Papyrus Representation Kind</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.architecture.representation.PapyrusRepresentationKind
+ * @generated
+ */
+ public Adapter createPapyrusRepresentationKindAdapter() {
+ 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;
+ }
+
+} //RepresentationAdapterFactory
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/util/RepresentationSwitch.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/util/RepresentationSwitch.java
new file mode 100644
index 00000000000..1ac0e469c48
--- /dev/null
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/util/RepresentationSwitch.java
@@ -0,0 +1,198 @@
+/**
+ * Copyright (c) 2017 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:
+ * Maged Elaasar - Initial API and implementation
+ *
+ *
+ */
+package org.eclipse.papyrus.infra.nattable.representation.util;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.Switch;
+
+import org.eclipse.papyrus.infra.core.architecture.ADElement;
+import org.eclipse.papyrus.infra.core.architecture.RepresentationKind;
+
+import org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind;
+
+import org.eclipse.papyrus.infra.nattable.representation.*;
+
+/**
+ * <!-- 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.nattable.representation.RepresentationPackage
+ * @generated
+ */
+public class RepresentationSwitch<T> extends Switch<T> {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static RepresentationPackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public RepresentationSwitch() {
+ if (modelPackage == null) {
+ modelPackage = RepresentationPackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Checks whether this is a switch for the given package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param 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 RepresentationPackage.PAPYRUS_SYNC_TABLE: {
+ PapyrusSyncTable papyrusSyncTable = (PapyrusSyncTable)theEObject;
+ T result = casePapyrusSyncTable(papyrusSyncTable);
+ if (result == null) result = casePapyrusRepresentationKind(papyrusSyncTable);
+ if (result == null) result = caseRepresentationKind(papyrusSyncTable);
+ if (result == null) result = caseADElement(papyrusSyncTable);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case RepresentationPackage.PAPYRUS_TABLE: {
+ PapyrusTable papyrusTable = (PapyrusTable)theEObject;
+ T result = casePapyrusTable(papyrusTable);
+ if (result == null) result = casePapyrusRepresentationKind(papyrusTable);
+ if (result == null) result = caseRepresentationKind(papyrusTable);
+ if (result == null) result = caseADElement(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 Sync 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 Sync Table</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T casePapyrusSyncTable(PapyrusSyncTable object) {
+ return null;
+ }
+
+ /**
+ * 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>AD 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>AD Element</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseADElement(ADElement object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Representation Kind</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>Representation Kind</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseRepresentationKind(RepresentationKind object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Papyrus Representation Kind</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 Representation Kind</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T casePapyrusRepresentationKind(PapyrusRepresentationKind 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;
+ }
+
+} //RepresentationSwitch
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/plugin.xml b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/plugin.xml
index b7cd776889c..f839a12a8ec 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/plugin.xml
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/plugin.xml
@@ -2,14 +2,6 @@
<?eclipse version="3.4"?>
<plugin>
<extension
- point="org.eclipse.papyrus.infra.viewpoints.policy.custom">
- <contribution
- file="resources/viewpageTable.configuration"
- original="platform:/plugin/org.eclipse.papyrus.infra.viewpoints.policy/builtin/default.configuration">
- </contribution>
- </extension>
-
- <extension
point="org.eclipse.papyrus.infra.nattable.axismanager">
<axisManager
id="org.eclipse.papyrus.infra.nattable.pagelist.contents.axis.manager"
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/resources/viewpageTable.configuration b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/resources/viewpageTable.configuration
deleted file mode 100644
index b19d5966749..00000000000
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/resources/viewpageTable.configuration
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration:PapyrusConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:configuration="http://www.eclipse.org/papyrus/infra/viewpoints/configuration" xmi:id="_ko07IErbEeSdQKzSRatBjg">
- <viewpoints xsi:type="configuration:PapyrusViewpoint" xmi:id="_xogdoErbEeSdQKzSRatBjg" name="Default Papyrus Viewpoint">
- <modelKinds xsi:type="configuration:PapyrusSyncTable" xmi:id="_wXztQHDwEeWh-MssWmCB_A" name="View Table" icon="platform:/plugin/org.eclipse.papyrus.infra.nattable.views.config/icons/nattablepageeditor.png" implementationID="PapyrusViewsTable">
- <modelRules xmi:id="_wXztQXDwEeWh-MssWmCB_A">
- <element href="http://www.eclipse.org/uml2/5.0.0/UML#//NamedElement"/>
- </modelRules>
- <owningRules xmi:id="_wXztQnDwEeWh-MssWmCB_A">
- <element href="http://www.eclipse.org/uml2/5.0.0/UML#//NamedElement"/>
- </owningRules>
- <categories href="platform:/plugin/org.eclipse.papyrus.infra.viewpoints.policy/builtin/default.configuration#_7wNb5dxhEeOqHvRyiN87hA"/>
- </modelKinds>
- </viewpoints>
- <defaultStakeholder href="platform:/plugin/org.eclipse.papyrus.infra.viewpoints.policy/builtin/default.configuration#_7wLmkdxhEeOqHvRyiN87hA"/>
- <metamodel href="http://www.eclipse.org/uml2/5.0.0/UML#/"/>
-</configuration:PapyrusConfiguration>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF
index ce9f44af5fc..333f4502cf7 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/META-INF/MANIFEST.MF
@@ -63,7 +63,6 @@ Require-Bundle: org.eclipse.gmf.runtime.emf.type.core;bundle-version="[1.9.0,2.0
org.eclipse.papyrus.infra.services.decoration;bundle-version="[1.2.0,2.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.ui;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.ui.emf;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
- org.eclipse.papyrus.infra.viewpoints.configuration;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.viewpoints.policy;bundle-version="[1.2.0,2.0.0)",
org.eclipse.papyrus.infra.types.core;bundle-version="[3.0.0,4.0.0)",
org.eclipse.papyrus.editor;bundle-version="[2.0.0,3.0.0)",
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/plugin.xml b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/plugin.xml
index 39fa7384f28..e95f504da74 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/plugin.xml
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/plugin.xml
@@ -1734,18 +1734,4 @@
type="java.lang.Object">
</propertyTester>
</extension>
- <extension
- point="org.eclipse.papyrus.infra.types.core.elementTypeSetConfiguration">
- <elementTypeSet
- clientContextID="org.eclipse.papyrus.infra.services.edit.TypeContext"
- path="model/nattable-tablecontents.elementtypesconfigurations">
- </elementTypeSet>
- </extension>
- <extension
- point="org.eclipse.papyrus.infra.types.core.elementTypeSetConfiguration">
- <elementTypeSet
- clientContextID="org.eclipse.papyrus.infra.services.edit.TypeContext"
- path="model/nattable-tablecontext.elementtypesconfigurations">
- </elementTypeSet>
- </extension>
</plugin>
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/contentprovider/ContextFeatureContentProvider.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/contentprovider/ContextFeatureContentProvider.java
index 76eb927246d..71792958518 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/contentprovider/ContextFeatureContentProvider.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/contentprovider/ContextFeatureContentProvider.java
@@ -22,10 +22,10 @@ import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind;
import org.eclipse.papyrus.infra.nattable.messages.Messages;
import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
-import org.eclipse.papyrus.infra.viewpoints.configuration.PapyrusView;
-import org.eclipse.papyrus.infra.viewpoints.configuration.ui.ECoreModelContentProvider;
+import org.eclipse.papyrus.infra.ui.emf.utils.EcoreModelContentProvider;
import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
import org.eclipse.papyrus.infra.widgets.editors.AbstractEditor;
@@ -50,7 +50,7 @@ import org.eclipse.swt.widgets.Composite;
*
* @author Laurent Wouters
*/
-public class ContextFeatureContentProvider extends ECoreModelContentProvider implements IStaticContentProvider, IHierarchicContentProvider, IFlattenableContentProvider, IGraphicalContentProvider {
+public class ContextFeatureContentProvider extends EcoreModelContentProvider implements IStaticContentProvider, IHierarchicContentProvider, IFlattenableContentProvider, IGraphicalContentProvider {
/**
* The table
*/
@@ -104,11 +104,11 @@ public class ContextFeatureContentProvider extends ECoreModelContentProvider imp
if (!(element instanceof EObject)) {
return false;
}
- ViewPrototype prototype = ViewPrototype.get((PapyrusView) table.getPrototype());
+ ViewPrototype prototype = ViewPrototype.get((PapyrusRepresentationKind) table.getPrototype());
if (prototype == null) {
return false;
}
- return PolicyChecker.getCurrent().canHaveNewView((EObject) element, table.getOwner(), prototype);
+ return PolicyChecker.getFor((EObject)element).canHaveNewView((EObject) element, table.getOwner(), prototype);
}
/**
@@ -139,7 +139,7 @@ public class ContextFeatureContentProvider extends ECoreModelContentProvider imp
/**
* {@inheritDoc}
*
- * @see org.eclipse.papyrus.infra.viewpoints.configuration.ui.ECoreModelContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ * @see org.eclipse.papyrus.infra.ui.emf.utils.EcoreModelContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
@Override
public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput) {
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectTreeAxisInNattableCommandProvider.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectTreeAxisInNattableCommandProvider.java
index 3879b40e45d..f7fc3628ee1 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectTreeAxisInNattableCommandProvider.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectTreeAxisInNattableCommandProvider.java
@@ -634,7 +634,7 @@ public class PasteEObjectTreeAxisInNattableCommandProvider extends AbstractPaste
protected Object createElementInAttachedMode(final ExtendedCompoundCommand compoundCommand, final Map<Integer, EObject> contextMap, final int depth, final String valueAsString, final PasteEObjectConfiguration pasteConfToUse, final IProgressMonitor monitor,
final IAdaptable info)
throws ExecutionException {
- Object createdElement = null;
+ EObject createdElement = null;
// get the element type to use to create the element
final IElementType typeToCreate = ElementTypeRegistry.getInstance().getType(pasteConfToUse.getPastedElementId());
@@ -660,29 +660,25 @@ public class PasteEObjectTreeAxisInNattableCommandProvider extends AbstractPaste
final CommandResult res = commandCreation.getCommandResult();
// 3 we update the map
- createdElement = res.getReturnValue();
- contextMap.put(Integer.valueOf(depth), (EObject) createdElement);
+ createdElement = (EObject) res.getReturnValue();
+ contextMap.put(Integer.valueOf(depth), createdElement);
// 4. we use the label to do a set name command on the created element
- if (createdElement instanceof EObject) {
- // TODO : this past must be specific for EMF AND for UML
- final EObject eobject = (EObject) createdElement;
- // get the feature used as ID for the element
- final EStructuralFeature nameFeature = eobject.eClass().getEStructuralFeature("name"); //$NON-NLS-1$
- if (null != nameFeature) {
- final SetRequest setNameRequest = new SetRequest(contextEditingDomain, eobject, nameFeature, valueAsString);
- final IElementEditService createdElementCommandProvider = ElementEditServiceUtils.getCommandProvider(createdElement);
- if (null != createdElementCommandProvider) {
- final ICommand setName = createdElementCommandProvider.getEditCommand(setNameRequest);
- if (setName != null && setName.canExecute()) {
-
- // We create the set command
- final Command emfSetNameCommandCreation = GMFtoEMFCommandWrapper.wrap(setName);
- emfSetNameCommandCreation.execute();
-
- // Add the set name command to the compound command
- compoundCommand.append(emfSetNameCommandCreation);
- }
+ // get the feature used as ID for the element
+ final EStructuralFeature nameFeature = createdElement.eClass().getEStructuralFeature("name"); //$NON-NLS-1$
+ if (null != nameFeature) {
+ final SetRequest setNameRequest = new SetRequest(contextEditingDomain, createdElement, nameFeature, valueAsString);
+ final IElementEditService createdElementCommandProvider = ElementEditServiceUtils.getCommandProvider(createdElement);
+ if (null != createdElementCommandProvider) {
+ final ICommand setName = createdElementCommandProvider.getEditCommand(setNameRequest);
+ if (setName != null && setName.canExecute()) {
+
+ // We create the set command
+ final Command emfSetNameCommandCreation = GMFtoEMFCommandWrapper.wrap(setName);
+ emfSetNameCommandCreation.execute();
+
+ // Add the set name command to the compound command
+ compoundCommand.append(emfSetNameCommandCreation);
}
}
}
diff --git a/plugins/infra/nattable/pom.xml b/plugins/infra/nattable/pom.xml
index fdf93169c61..c0246c799bd 100755
--- a/plugins/infra/nattable/pom.xml
+++ b/plugins/infra/nattable/pom.xml
@@ -26,6 +26,8 @@
<module>org.eclipse.papyrus.infra.nattable.properties</module>
<module>org.eclipse.papyrus.infra.nattable.views.config</module>
<module>org.eclipse.papyrus.infra.nattable.views.editor</module>
+ <module>org.eclipse.papyrus.infra.nattable.representation</module>
+ <module>org.eclipse.papyrus.infra.nattable.representation.edit</module>
<!-- This one has a dependency also on Infra Diagram, so it is built outside of both modules. -->
<!--module>org.eclipse.papyrus.infra.nattable.gmfdiag</module-->

Back to the top