From 7a1e61e4203fcf468a2635b80dd94182a95b588b Mon Sep 17 00:00:00 2001 From: Maged Elaasar Date: Tue, 21 Feb 2017 00:19:48 -0800 Subject: 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 --- .../.classpath | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 11 +- .../META-INF/MANIFEST.MF | 2 +- ...ynchronizedOnEStructuralFeatureAxisManager.java | 23 +- .../META-INF/MANIFEST.MF | 5 +- .../plugin.xml | 9 +- .../schema/tableReconciler.exsd | 116 ++++++ .../common/api/TableEditorCreationHelper.java | 18 +- .../common/editor/AbstractEMFNattableEditor.java | 15 + .../handlers/CreateNatTableFromCatalogHandler.java | 12 +- .../handlers/DynamicTablesMenuContribution.java | 8 +- .../common/handlers/PolicyDefinedTableHandler.java | 162 ++++----- .../common/helper/SyncTableCommandHelper.java | 252 ++++++------- .../nattable/common/helper/TableCommandHelper.java | 156 ++++---- .../common/helper/TableReconcileHelper.java | 135 +++++++ .../nattable/common/helper/TableViewPrototype.java | 254 ++++++------- .../common/reconciler/TableReconciler.java | 131 +++++++ .../common/reconciler/TableReconcilersReader.java | 164 +++++++++ .../common/reconciler/TableVersioningUtils.java | 204 +++++++++++ .../wizards/ChooseNattableConfigWizardPage.java | 20 +- .../commands/CreateAndOpenTableEditorCommand.java | 5 +- .../modelexplorer/queries/GetTableIcon.java | 7 +- .../model/ui/EObjectInFlatTable.xwt | 2 +- .../model/ui/EObjectInTreeTable.xwt | 2 +- .../model/ui/SingleTable.xwt | 2 +- .../model/ui/SingleTreeTable.xwt | 2 +- .../modelelement/NatTableModelElement.java | 10 +- .../.classpath | 7 + .../.project | 28 ++ .../META-INF/MANIFEST.MF | 23 ++ .../about.html | 28 ++ .../build.properties | 20 ++ ...nguage_representationKinds_PapyrusSyncTable.gif | Bin 0 -> 223 bytes ...onLanguage_representationKinds_PapyrusTable.gif | Bin 0 -> 223 bytes .../icons/full/obj16/PapyrusSyncTable.gif | Bin 0 -> 304 bytes .../icons/full/obj16/PapyrusTable.gif | Bin 0 -> 235 bytes .../plugin.properties | 33 ++ .../plugin.xml | 40 +++ .../pom.xml | 12 + .../provider/PapyrusSyncTableItemProvider.java | 118 ++++++ .../provider/PapyrusTableItemProvider.java | 150 ++++++++ .../provider/RepresentationEditPlugin.java | 110 ++++++ .../RepresentationItemProviderAdapterFactory.java | 343 ++++++++++++++++++ .../.classpath | 7 + .../.project | 28 ++ .../META-INF/MANIFEST.MF | 19 + .../about.html | 28 ++ .../build.properties | 20 ++ .../model/NattableRepresentation.ecore | 10 + .../model/NattableRepresentation.genmodel | 20 ++ .../plugin.properties | 14 + .../plugin.xml | 28 ++ .../pom.xml | 12 + .../nattable/representation/PapyrusSyncTable.java | 29 ++ .../nattable/representation/PapyrusTable.java | 61 ++++ .../representation/RepresentationFactory.java | 62 ++++ .../representation/RepresentationPackage.java | 399 +++++++++++++++++++++ .../representation/impl/PapyrusSyncTableImpl.java | 50 +++ .../representation/impl/PapyrusTableImpl.java | 175 +++++++++ .../impl/RepresentationFactoryImpl.java | 117 ++++++ .../impl/RepresentationPackageImpl.java | 217 +++++++++++ .../util/RepresentationAdapterFactory.java | 208 +++++++++++ .../representation/util/RepresentationSwitch.java | 198 ++++++++++ .../plugin.xml | 8 - .../resources/viewpageTable.configuration | 16 - .../META-INF/MANIFEST.MF | 1 - .../org.eclipse.papyrus.infra.nattable/plugin.xml | 14 - ...lipse.papyrus.infra.nattable.configuration.exsd | 134 ------- .../ContextFeatureContentProvider.java | 12 +- ...teEObjectTreeAxisInNattableCommandProvider.java | 40 +-- plugins/infra/nattable/pom.xml | 2 + 71 files changed, 3903 insertions(+), 667 deletions(-) create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/schema/tableReconciler.exsd create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableReconcileHelper.java create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/reconciler/TableReconciler.java create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/reconciler/TableReconcilersReader.java create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/reconciler/TableVersioningUtils.java create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/.classpath create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/.project create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/META-INF/MANIFEST.MF create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/about.html create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/build.properties create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/ctool16/CreateArchitectureDescriptionLanguage_representationKinds_PapyrusSyncTable.gif create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/ctool16/CreateArchitectureDescriptionLanguage_representationKinds_PapyrusTable.gif create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/obj16/PapyrusSyncTable.gif create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/obj16/PapyrusTable.gif create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/plugin.properties create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/plugin.xml create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/pom.xml create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/src-gen/org/eclipse/papyrus/infra/nattable/representation/provider/PapyrusSyncTableItemProvider.java create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/src-gen/org/eclipse/papyrus/infra/nattable/representation/provider/PapyrusTableItemProvider.java create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/src-gen/org/eclipse/papyrus/infra/nattable/representation/provider/RepresentationEditPlugin.java create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/src-gen/org/eclipse/papyrus/infra/nattable/representation/provider/RepresentationItemProviderAdapterFactory.java create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/.classpath create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/.project create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/META-INF/MANIFEST.MF create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/about.html create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/build.properties create mode 100755 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/model/NattableRepresentation.ecore create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/model/NattableRepresentation.genmodel create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/plugin.properties create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/plugin.xml create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/pom.xml create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/PapyrusSyncTable.java create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/PapyrusTable.java create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/RepresentationFactory.java create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/RepresentationPackage.java create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/impl/PapyrusSyncTableImpl.java create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/impl/PapyrusTableImpl.java create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/impl/RepresentationFactoryImpl.java create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/impl/RepresentationPackageImpl.java create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/util/RepresentationAdapterFactory.java create mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation/src-gen/org/eclipse/papyrus/infra/nattable/representation/util/RepresentationSwitch.java delete mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.config/resources/viewpageTable.configuration delete mode 100644 plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/schema/org.eclipse.papyrus.infra.nattable.configuration.exsd (limited to 'plugins/infra/nattable') 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 @@ - + 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 @@ + + @@ -271,11 +273,4 @@ - - - - diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/schema/tableReconciler.exsd b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/schema/tableReconciler.exsd new file mode 100644 index 00000000000..eebd998baae --- /dev/null +++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/schema/tableReconciler.exsd @@ -0,0 +1,116 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + 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 prototypes = PolicyChecker.getCurrent().getPrototypesFor(tableContext); + Collection prototypes = PolicyChecker.getFor(tableContext).getPrototypesFor(tableContext); Iterator 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 null 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 data = new ArrayList(); - 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 implementations; - - /** - * The cache of prototypes - */ - private Map cache; - - - - @Override - public ViewPrototype getPrototypeFor(PapyrusView configuration) { - if (!(configuration instanceof PapyrusSyncTable)) { - return null; - } - if (implementations == null) { - buildImplementationCache(); - } - if (cache == null) { - cache = new HashMap(); - } - 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(); - 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 implementations; + + /** + * The cache of prototypes + */ + private Map cache; + + + + @Override + public ViewPrototype getPrototypeFor(PapyrusRepresentationKind configuration) { + if (!(configuration instanceof PapyrusSyncTable)) { + return null; + } + if (implementations == null) { + buildImplementationCache(); + } + if (cache == null) { + cache = new HashMap(); + } + 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(); + 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 cache; - - @Override - public ViewPrototype getPrototypeFor(PapyrusView configuration) { - if (!(configuration instanceof PapyrusTable)) { - return null; - } - if (cache == null) { - cache = new HashMap(); - } - 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 cache; + + @Override + public ViewPrototype getPrototypeFor(PapyrusRepresentationKind configuration) { + if (!(configuration instanceof PapyrusTable)) { + return null; + } + if (cache == null) { + cache = new HashMap(); + } + 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. + *

+ * 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 null if the table is already of the current Papyrus version based on {@link TableVersioningUtils#isOfCurrentPapyrusVersion(Table)} check. + *

+ * If one of the reconcilers returns un-executable command, this method logs the problem and returns null + * + * @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 reconcilers = TableReconcilersReader.getInstance().load(); + + boolean someFailed = false; + Iterator 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. + *

+ * 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}. + *

+ * 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)}. + *

+ * 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. + *

+ */ +public abstract class TableReconciler implements IExecutableExtension { + + /** + * Extension point attribute passed to {@link IConfigurationElement#createExecutableExtension(String)}, so value should be FQN of reconciler to + * instantiate. + *

+ * 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. + *

+ * 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. + *

+ * 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. + *

+ * This value should pass the {@link TableVersioningUtils#isCurrentPapyrusVersion(String)} check for reconciler to be considered. + *

+ * 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 false value returned from this method means that the table is unsuitable for this reconciler, and does not assume any error. + *

+ * 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 false 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 false, and editor implementation will log an + * erroneous reconcile attempt. + *

+ * If the reconciler wants to ignore the instance it can either return false from {@link TableReconciler#canReconcileFrom(Table, String)} or return null from this method + * + * @param table + * @return the command or null 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 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 load() { + if (myReconcilers == null) { + myReconcilers = new ArrayList(); + 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. + *

+ * 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 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 null 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. + *

+ * The current value returned by this method is "1.3.0". + *

+ * 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)}. + *

+ * 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. + *

+ * 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. + *

+ * 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(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. + *

+ * 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 null. + */ + 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 viewPrototypes = new ArrayList(); // 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 null 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 @@ + customLabel="Table Kind"> + customLabel="Table Kind"> + property="nattable:Table:prototype" readOnly="true" customLabel="Table Kind"> + property="nattable:Table:prototype" readOnly="true" customLabel="Table Kind"> + + + + + + 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 @@ + + + org.eclipse.papyrus.infra.nattable.representation.edit + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + 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 @@ + + + + +About + + +

About This Content

+ +

June 1, 2017

+

License

+ +

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

+ + + \ 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 Binary files /dev/null and b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/ctool16/CreateArchitectureDescriptionLanguage_representationKinds_PapyrusSyncTable.gif 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 Binary files /dev/null and b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/ctool16/CreateArchitectureDescriptionLanguage_representationKinds_PapyrusTable.gif 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 Binary files /dev/null and b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/obj16/PapyrusSyncTable.gif 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 Binary files /dev/null and b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.representation.edit/icons/full/obj16/PapyrusTable.gif 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 @@ + + + + + + + + + + + + + + + + + + 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 @@ + + + 4.0.0 + + org.eclipse.papyrus.infra-nattable + org.eclipse.papyrus + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.infra.nattable.representation.edit + 1.0.0-SNAPSHOT + eclipse-plugin + \ 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. + * + * + * @generated + */ +public class PapyrusSyncTableItemProvider + extends PapyrusRepresentationKindItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public PapyrusSyncTableItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This returns PapyrusSyncTable.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/PapyrusSyncTable")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @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}. + * + * + * @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. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @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. + * + * + * @generated + */ +public class PapyrusTableItemProvider extends PapyrusRepresentationKindItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public PapyrusTableItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addConfigurationPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Configuration feature. + * + * + * @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. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/PapyrusTable")); + } + + /** + * This returns the label text for the adapted class. + * + * + * @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}. + * + * + * @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. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @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. + * + * + * @generated + */ +public final class RepresentationEditPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * @generated + */ + public static final RepresentationEditPlugin INSTANCE = new RepresentationEditPlugin(); + + /** + * Keep track of the singleton. + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * @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. + * + * + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() { + return plugin; + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() { + return plugin; + } + + /** + * The actual implementation of the Eclipse Plugin. + * + * + * @generated + */ + public static class Implementation extends EclipsePlugin { + /** + * Creates an instance. + * + * + * @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. + * + * + * @generated + */ +public class RepresentationItemProviderAdapterFactory extends RepresentationAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { + /** + * This keeps track of the root adapter factory that delegates to this adapter factory. + * + * + * @generated + */ + protected ComposedAdapterFactory parentAdapterFactory; + + /** + * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. + * + * + * @generated + */ + protected IChangeNotifier changeNotifier = new ChangeNotifier(); + + /** + * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. + * + * + * @generated + */ + protected Collection supportedTypes = new ArrayList(); + + /** + * This constructs an instance. + * + * + * @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. + * + * + * @generated + */ + protected PapyrusSyncTableItemProvider papyrusSyncTableItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.infra.nattable.representation.PapyrusSyncTable}. + * + * + * @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. + * + * + * @generated + */ + protected PapyrusTableItemProvider papyrusTableItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.infra.nattable.representation.PapyrusTable}. + * + * + * @generated + */ + @Override + public Adapter createPapyrusTableAdapter() { + if (papyrusTableItemProvider == null) { + papyrusTableItemProvider = new PapyrusTableItemProvider(this); + } + + return papyrusTableItemProvider; + } + + /** + * This returns the root adapter factory that contains this factory. + * + * + * @generated + */ + public ComposeableAdapterFactory getRootAdapterFactory() { + return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); + } + + /** + * This sets the composed adapter factory that contains this factory. + * + * + * @generated + */ + public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { + this.parentAdapterFactory = parentAdapterFactory; + } + + /** + * + * + * @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. + * + * + * @generated + */ + @Override + public Adapter adapt(Notifier notifier, Object type) { + return super.adapt(notifier, this); + } + + /** + * + * + * @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. + * + * + * @generated + */ + public void addListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.addListener(notifyChangedListener); + } + + /** + * This removes a listener. + * + * + * @generated + */ + public void removeListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.removeListener(notifyChangedListener); + } + + /** + * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. + * + * + * @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. + * + * + * @generated + */ + public void dispose() { + if (papyrusSyncTableItemProvider != null) papyrusSyncTableItemProvider.dispose(); + if (papyrusTableItemProvider != null) papyrusTableItemProvider.dispose(); + } + + /** + * A child creation extender for the {@link ArchitecturePackage}. + * + * + * @generated + */ + public static class ArchitectureChildCreationExtender implements IChildCreationExtender { + /** + * The switch for creating child descriptors specific to each extended class. + * + * + * @generated + */ + protected static class CreationSwitch extends ArchitectureSwitch { + /** + * The child descriptors being populated. + * + * + * @generated + */ + protected List newChildDescriptors; + + /** + * The domain in which to create the children. + * + * + * @generated + */ + protected EditingDomain editingDomain; + + /** + * Creates the a switch for populating child descriptors in the given domain. + * + * + * @generated + */ + CreationSwitch(List newChildDescriptors, EditingDomain editingDomain) { + this.newChildDescriptors = newChildDescriptors; + this.editingDomain = editingDomain; + } + /** + * + * + * @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; + } + + /** + * + * + * @generated + */ + protected CommandParameter createChildParameter(Object feature, Object child) { + return new CommandParameter(null, feature, child); + } + + } + + /** + * + * + * @generated + */ + public Collection getNewChildDescriptors(Object object, EditingDomain editingDomain) { + ArrayList result = new ArrayList(); + new CreationSwitch(result, editingDomain).doSwitch((EObject)object); + return result; + } + + /** + * + * + * @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 @@ + + + + + + + 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 @@ + + + org.eclipse.papyrus.infra.nattable.representation + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + 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 @@ + + + + +About + + +

About This Content

+ +

June 1, 2017

+

License

+ +

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

+ + + \ 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 @@ + + + + + + + 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 @@ + + + NattableRepresentation.ecore + + + + + + + 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 @@ + + + + + + + + + + + + + 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 @@ + + + 4.0.0 + + org.eclipse.papyrus.infra-nattable + org.eclipse.papyrus + 0.0.1-SNAPSHOT + + org.eclipse.papyrus.infra.nattable.representation + 1.0.0-SNAPSHOT + eclipse-plugin + \ 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; + +/** + * + * A representation of the model object 'Papyrus Sync Table'. + * + * + * + * @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; + +/** + * + * A representation of the model object 'Papyrus Table'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.papyrus.infra.nattable.representation.PapyrusTable#getConfiguration Configuration}
  • + *
+ * + * @see org.eclipse.papyrus.infra.nattable.representation.RepresentationPackage#getPapyrusTable() + * @model + * @generated + */ +public interface PapyrusTable extends PapyrusRepresentationKind { + /** + * Returns the value of the 'Configuration' attribute. + * + *

+ * If the meaning of the 'Configuration' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Configuration' 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 Configuration}' attribute. + * + * + * @param value the new value of the 'Configuration' 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; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @see org.eclipse.papyrus.infra.nattable.representation.RepresentationPackage + * @generated + */ +public interface RepresentationFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + RepresentationFactory eINSTANCE = org.eclipse.papyrus.infra.nattable.representation.impl.RepresentationFactoryImpl.init(); + + /** + * Returns a new object of class 'Papyrus Sync Table'. + * + * + * @return a new object of class 'Papyrus Sync Table'. + * @generated + */ + PapyrusSyncTable createPapyrusSyncTable(); + + /** + * Returns a new object of class 'Papyrus Table'. + * + * + * @return a new object of class 'Papyrus Table'. + * @generated + */ + PapyrusTable createPapyrusTable(); + + /** + * Returns the package supported by this factory. + * + * + * @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; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each operation of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @see org.eclipse.papyrus.infra.nattable.representation.RepresentationFactory + * @model kind="package" + * @generated + */ +public interface RepresentationPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "representation"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://www.eclipse.org/papyrus/infra/nattable/representation"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "nattablerepresentation"; + + /** + * The singleton instance of the package. + * + * + * @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 Papyrus Sync Table}' class. + * + * + * @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 'Name' attribute. + * + * + * @generated + * @ordered + */ + int PAPYRUS_SYNC_TABLE__NAME = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__NAME; + + /** + * The feature id for the 'Desciption' attribute. + * + * + * @generated + * @ordered + */ + int PAPYRUS_SYNC_TABLE__DESCIPTION = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__DESCIPTION; + + /** + * The feature id for the 'Qualified Name' attribute. + * + * + * @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 'Language' container reference. + * + * + * @generated + * @ordered + */ + int PAPYRUS_SYNC_TABLE__LANGUAGE = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__LANGUAGE; + + /** + * The feature id for the 'Concerns' reference list. + * + * + * @generated + * @ordered + */ + int PAPYRUS_SYNC_TABLE__CONCERNS = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__CONCERNS; + + /** + * The feature id for the 'Icon' attribute. + * + * + * @generated + * @ordered + */ + int PAPYRUS_SYNC_TABLE__ICON = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__ICON; + + /** + * The feature id for the 'Parent' reference. + * + * + * @generated + * @ordered + */ + int PAPYRUS_SYNC_TABLE__PARENT = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__PARENT; + + /** + * The feature id for the 'Model Rules' containment reference list. + * + * + * @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 'Owning Rules' containment reference list. + * + * + * @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 'Implementation ID' attribute. + * + * + * @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 'Papyrus Sync Table' class. + * + * + * @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 'Papyrus Sync Table' class. + * + * + * @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 Papyrus Table}' class. + * + * + * @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 'Name' attribute. + * + * + * @generated + * @ordered + */ + int PAPYRUS_TABLE__NAME = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__NAME; + + /** + * The feature id for the 'Desciption' attribute. + * + * + * @generated + * @ordered + */ + int PAPYRUS_TABLE__DESCIPTION = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__DESCIPTION; + + /** + * The feature id for the 'Qualified Name' attribute. + * + * + * @generated + * @ordered + */ + int PAPYRUS_TABLE__QUALIFIED_NAME = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__QUALIFIED_NAME; + + /** + * The feature id for the 'Language' container reference. + * + * + * @generated + * @ordered + */ + int PAPYRUS_TABLE__LANGUAGE = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__LANGUAGE; + + /** + * The feature id for the 'Concerns' reference list. + * + * + * @generated + * @ordered + */ + int PAPYRUS_TABLE__CONCERNS = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__CONCERNS; + + /** + * The feature id for the 'Icon' attribute. + * + * + * @generated + * @ordered + */ + int PAPYRUS_TABLE__ICON = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__ICON; + + /** + * The feature id for the 'Parent' reference. + * + * + * @generated + * @ordered + */ + int PAPYRUS_TABLE__PARENT = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__PARENT; + + /** + * The feature id for the 'Model Rules' containment reference list. + * + * + * @generated + * @ordered + */ + int PAPYRUS_TABLE__MODEL_RULES = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__MODEL_RULES; + + /** + * The feature id for the 'Owning Rules' containment reference list. + * + * + * @generated + * @ordered + */ + int PAPYRUS_TABLE__OWNING_RULES = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__OWNING_RULES; + + /** + * The feature id for the 'Implementation ID' attribute. + * + * + * @generated + * @ordered + */ + int PAPYRUS_TABLE__IMPLEMENTATION_ID = org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__IMPLEMENTATION_ID; + + /** + * The feature id for the 'Configuration' attribute. + * + * + * @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 'Papyrus Table' class. + * + * + * @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 'Papyrus Table' class. + * + * + * @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 Papyrus Sync Table}'. + * + * + * @return the meta object for class 'Papyrus Sync Table'. + * @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 Papyrus Table}'. + * + * + * @return the meta object for class 'Papyrus Table'. + * @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 Configuration}'. + * + * + * @return the meta object for the attribute 'Configuration'. + * @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. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + RepresentationFactory getRepresentationFactory(); + + /** + * + * Defines literals for the meta objects that represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each operation of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link org.eclipse.papyrus.infra.nattable.representation.impl.PapyrusSyncTableImpl Papyrus Sync Table}' class. + * + * + * @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 Papyrus Table}' class. + * + * + * @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 'Configuration' attribute feature. + * + * + * @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; + +/** + * + * An implementation of the model object 'Papyrus Sync Table'. + * + * + * @generated + */ +public class PapyrusSyncTableImpl extends PapyrusRepresentationKindImpl implements PapyrusSyncTable { + /** + * + * + * @generated + */ + protected PapyrusSyncTableImpl() { + super(); + } + + /** + * + * + * @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; + +/** + * + * An implementation of the model object 'Papyrus Table'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.papyrus.infra.nattable.representation.impl.PapyrusTableImpl#getConfiguration Configuration}
  • + *
+ * + * @generated + */ +public class PapyrusTableImpl extends PapyrusRepresentationKindImpl implements PapyrusTable { + /** + * The default value of the '{@link #getConfiguration() Configuration}' attribute. + * + * + * @see #getConfiguration() + * @generated + * @ordered + */ + protected static final String CONFIGURATION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getConfiguration() Configuration}' attribute. + * + * + * @see #getConfiguration() + * @generated + * @ordered + */ + protected String configuration = CONFIGURATION_EDEFAULT; + + /** + * + * + * @generated + */ + protected PapyrusTableImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return RepresentationPackage.Literals.PAPYRUS_TABLE; + } + + /** + * + * + * @generated + */ + public String getConfiguration() { + return configuration; + } + + /** + * + * + * @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)); + } + + /** + * + * + * @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); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case RepresentationPackage.PAPYRUS_TABLE__CONFIGURATION: + setConfiguration((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case RepresentationPackage.PAPYRUS_TABLE__CONFIGURATION: + setConfiguration(CONFIGURATION_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @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); + } + + /** + * + * + * @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.*; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class RepresentationFactoryImpl extends EFactoryImpl implements RepresentationFactory { + /** + * Creates the default factory implementation. + * + * + * @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. + * + * + * @generated + */ + public RepresentationFactoryImpl() { + super(); + } + + /** + * + * + * @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"); + } + } + + /** + * + * + * @generated + */ + public PapyrusSyncTable createPapyrusSyncTable() { + PapyrusSyncTableImpl papyrusSyncTable = new PapyrusSyncTableImpl(); + return papyrusSyncTable; + } + + /** + * + * + * @generated + */ + public PapyrusTable createPapyrusTable() { + PapyrusTableImpl papyrusTable = new PapyrusTableImpl(); + return papyrusTable; + } + + /** + * + * + * @generated + */ + public RepresentationPackage getRepresentationPackage() { + return (RepresentationPackage)getEPackage(); + } + + /** + * + * + * @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; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class RepresentationPackageImpl extends EPackageImpl implements RepresentationPackage { + /** + * + * + * @generated + */ + private EClass papyrusSyncTableEClass = null; + + /** + * + * + * @generated + */ + private EClass papyrusTableEClass = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

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. + * + * + * @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); + } + + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

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. + * + * + * @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; + } + + /** + * + * + * @generated + */ + public EClass getPapyrusSyncTable() { + return papyrusSyncTableEClass; + } + + /** + * + * + * @generated + */ + public EClass getPapyrusTable() { + return papyrusTableEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getPapyrusTable_Configuration() { + return (EAttribute)papyrusTableEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public RepresentationFactory getRepresentationFactory() { + return (RepresentationFactory)getEFactoryInstance(); + } + + /** + * + * + * @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. + * + * + * @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); + } + + /** + * + * + * @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. + * + * + * @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.*; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see org.eclipse.papyrus.infra.nattable.representation.RepresentationPackage + * @generated + */ +public class RepresentationAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static RepresentationPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public RepresentationAdapterFactory() { + if (modelPackage == null) { + modelPackage = RepresentationPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * @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 createXXX methods. + * + * + * @generated + */ + protected RepresentationSwitch modelSwitch = + new RepresentationSwitch() { + @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 target. + * + * + * @param target the object to adapt. + * @return the adapter for the target. + * @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 Papyrus Sync Table}'. + * + * 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. + * + * @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 Papyrus Table}'. + * + * 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. + * + * @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 AD Element}'. + * + * 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. + * + * @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 Representation Kind}'. + * + * 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. + * + * @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 Papyrus Representation Kind}'. + * + * 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. + * + * @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. + * + * This default implementation returns null. + * + * @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.*; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the caseXXX 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. + * + * @see org.eclipse.papyrus.infra.nattable.representation.RepresentationPackage + * @generated + */ +public class RepresentationSwitch extends Switch { + /** + * The cached model package + * + * + * @generated + */ + protected static RepresentationPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public RepresentationSwitch() { + if (modelPackage == null) { + modelPackage = RepresentationPackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * + * + * @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 caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX 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 'Papyrus Sync Table'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Papyrus Sync Table'. + * @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 'Papyrus Table'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Papyrus Table'. + * @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 'AD Element'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'AD Element'. + * @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 'Representation Kind'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Representation Kind'. + * @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 'Papyrus Representation Kind'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Papyrus Representation Kind'. + * @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 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @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 @@ -1,14 +1,6 @@ - - - - - - - - - - - - - - - - - - - - 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"> - - - - - - - - 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/schema/org.eclipse.papyrus.infra.nattable.configuration.exsd deleted file mode 100644 index e2551c85634..00000000000 --- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/schema/org.eclipse.papyrus.infra.nattable.configuration.exsd +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - - - 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. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The file must be an EMF Model, with only one root. This root must be a TableConfiguration and its extension must be ".nattableconfiguration". - - - - - - - a file with the extension .nattableconfiguration - - - - - - - - - - The unique type identifier of the table as a string - - - - - - - - - - - - MDT papyrus 0.10.0 - - - - - - - - - See Papyrus nattable plugins - - - - - - - - - one - - - - - - - - - none - - - - - - - - - /***************************************************************************** - * 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 - * - *****************************************************************************/ - - - - 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 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 @@ org.eclipse.papyrus.infra.nattable.properties org.eclipse.papyrus.infra.nattable.views.config org.eclipse.papyrus.infra.nattable.views.editor + org.eclipse.papyrus.infra.nattable.representation + org.eclipse.papyrus.infra.nattable.representation.edit -- cgit v1.2.3