Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2013-04-15 11:50:54 -0400
committervlorenzo2013-04-15 11:50:54 -0400
commita6874d9c564a97627aae7a4ff720977ff25cba0b (patch)
treec483655bf081f2f8fa5880f9a0109cefa169cf48 /sandbox
parentbb99ae798caa101cf03c05b06b5a120c25b2088b (diff)
downloadorg.eclipse.papyrus-a6874d9c564a97627aae7a4ff720977ff25cba0b.tar.gz
org.eclipse.papyrus-a6874d9c564a97627aae7a4ff720977ff25cba0b.tar.xz
org.eclipse.papyrus-a6874d9c564a97627aae7a4ff720977ff25cba0b.zip
404531: [Table 2] Metamodel must be refactored
https://bugs.eclipse.org/bugs/show_bug.cgi?id=404531 second part of the update commit
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/META-INF/MANIFEST.MF4
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/icons/nattablepageeditor.gifbin138 -> 0 bytes
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/icons/nattablepageeditor.pngbin194 -> 0 bytes
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/plugin.xml64
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/resources/viewpage.nattableconfiguration45
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/Activator.java71
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/NattablePageEditor.java41
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/celleditor/ModelViewsCellEditorConfiguration.java76
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/factory/NattablePageEditorFactory.java37
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/handlers/CreateNattablePageEditorHandler.java43
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/manager/axis/EditorContextSynchronizerAxisManager.java130
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/manager/axis/EditorFeatureAxisManager.java43
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/manager/cell/ModelViewsCellManager.java270
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/provider/ModelViewsHeaderLabelProvider.java144
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/utils/Utils.java98
-rw-r--r--sandbox/TableV3/org.eclipse.papyrus.sysml.nattable/src/org/eclipse/papyrus/sysml/nattable/manager/axis/RequirementAxisManager.java58
16 files changed, 58 insertions, 1066 deletions
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/META-INF/MANIFEST.MF b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/META-INF/MANIFEST.MF
index 41325a2e449..963fb96cfd1 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/META-INF/MANIFEST.MF
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/META-INF/MANIFEST.MF
@@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.papyrus.infra.nattable.views.editor;singleton:=true
Bundle-Version: 0.10.0.qualifier
-Bundle-Activator: org.eclipse.papyrus.infra.nattable.views.editor.Activator
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
@@ -20,6 +19,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.gmf.runtime.emf.type.core,
org.eclipse.papyrus.infra.services.edit,
org.eclipse.papyrus.infra.gmfdiag.commands,
- org.eclipse.papyrus.infra.widgets;bundle-version="0.10.0"
+ org.eclipse.papyrus.infra.widgets;bundle-version="0.10.0",
+ org.eclipse.papyrus.infra.nattable.views.config;bundle-version="0.10.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/icons/nattablepageeditor.gif b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/icons/nattablepageeditor.gif
deleted file mode 100644
index 20416f02be0..00000000000
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/icons/nattablepageeditor.gif
+++ /dev/null
Binary files differ
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/icons/nattablepageeditor.png b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/icons/nattablepageeditor.png
deleted file mode 100644
index 3eb64f31e36..00000000000
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/icons/nattablepageeditor.png
+++ /dev/null
Binary files differ
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/plugin.xml b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/plugin.xml
index 7fa891be33d..7dc76a983f3 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/plugin.xml
+++ b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/plugin.xml
@@ -4,23 +4,22 @@
<extension
point="org.eclipse.papyrus.infra.core.papyrusDiagram">
<editorDiagram
- factoryClass="org.eclipse.papyrus.infra.nattable.views.editor.factory.NattablePageEditorFactory"
- icon="icons/nattablepageeditor.png">
+ factoryClass="org.eclipse.papyrus.infra.nattable.common.factory.NattableEditorFactory"
+ icon="platform:/plugin/org.eclipse.papyrus.infra.nattable.views.config/icons/nattablepageeditor.png">
</editorDiagram>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
categoryId="org.eclipse.papyrus.editor.category"
- description="Create a View NatTable Editor"
+ description="Create a new Views Table"
id="org.eclipse.papyrus.infra.nattable.page.editor.create.command"
- name="Create a View NatTable Editor">
+ name="Create a new Views Table">
</command>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
- class="org.eclipse.papyrus.infra.nattable.views.editor.handlers.CreateNattablePageEditorHandler"
commandId="org.eclipse.papyrus.infra.nattable.page.editor.create.command">
<activeWhen>
<or>
@@ -32,6 +31,13 @@
</with>
</or>
</activeWhen>
+ <class
+ class="org.eclipse.papyrus.infra.nattable.common.handlers.CreateNatTableEditorHandler">
+ <parameter
+ name="tableType"
+ value="PapyrusTableViewsEditor">
+ </parameter>
+ </class>
</handler>
</extension>
<extension
@@ -43,8 +49,6 @@
locationURI="popup:org.eclipse.papyrus.infra.nattable.popupmenu.createnattable">
<command
commandId="org.eclipse.papyrus.infra.nattable.page.editor.create.command"
- icon="icons/nattablepageeditor.png"
- label="Papyrus View Editor"
style="push">
<visibleWhen>
<with
@@ -61,8 +65,6 @@
locationURI="menu:org.eclipse.papyrus.infra.nattable.menu.createnattable">
<command
commandId="org.eclipse.papyrus.infra.nattable.page.editor.create.command"
- icon="icons/nattablepageeditor.png"
- label="Papyrus View Editor"
style="push">
<visibleWhen>
<with
@@ -79,8 +81,6 @@
locationURI="toolbar:org.eclipse.papyrus.infra.nattable.toolbar.createnattable">
<command
commandId="org.eclipse.papyrus.infra.nattable.page.editor.create.command"
- icon="icons/nattablepageeditor.png"
- label="Papyrus View Editor"
style="push">
<visibleWhen>
<with
@@ -94,42 +94,10 @@
</menuContribution>
</extension>
<extension
- point="org.eclipse.papyrus.infra.nattable.axismanager">
- <axisManager
- id="org.eclipse.papyrus.infra.nattable.page.editor.contents.axis.manager"
- manager="org.eclipse.papyrus.infra.nattable.views.editor.manager.axis.EditorContextSynchronizerAxisManager">
- </axisManager>
- <axisManager
- id="org.eclipse.papyrus.infra.nattable.page.editor.view.feature.axis.manager"
- manager="org.eclipse.papyrus.infra.nattable.views.editor.manager.axis.EditorFeatureAxisManager">
- </axisManager>
- </extension>
- <extension
- point="org.eclipse.papyrus.infra.nattable.cellmanager">
- <cellManager
- id="org.eclipse.papyrus.infra.nattable.page.editor.modelviewscellmanager"
- manager="org.eclipse.papyrus.infra.nattable.views.editor.manager.cell.ModelViewsCellManager"
- order="50">
- </cellManager>
- </extension>
- <extension
- point="org.eclipse.papyrus.infra.services.labelprovider.labelProvider">
- <labelProvider
- priority="1000"
- provider="org.eclipse.papyrus.infra.nattable.views.editor.provider.ModelViewsHeaderLabelProvider">
- <labelProviderContext
- context="org.eclipse.papyrus.infra.nattable.header.feature.labelprovider">
- </labelProviderContext>
- <labelProviderContext
- context="org.eclipse.papyrus.infra.nattable.header.labelprovider">
- </labelProviderContext>
- </labelProvider>
- </extension>
- <extension
- point="org.eclipse.papyrus.infra.nattable.celleditor.configuration">
- <configuration
- class="org.eclipse.papyrus.infra.nattable.views.editor.celleditor.ModelViewsCellEditorConfiguration"
- order="50">
- </configuration>
+ point="org.eclipse.ui.commandImages">
+ <image
+ commandId="org.eclipse.papyrus.infra.nattable.page.editor.create.command"
+ icon="platform:/plugin/org.eclipse.papyrus.infra.nattable.views.config/icons/nattablepageeditor.png">
+ </image>
</extension>
</plugin>
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/resources/viewpage.nattableconfiguration b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/resources/viewpage.nattableconfiguration
deleted file mode 100644
index da3b4c48135..00000000000
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/resources/viewpage.nattableconfiguration
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<nattableconfiguration:TableConfiguration
- xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:nattable="http://www.eclipse.org/papyrus/nattable/model"
- xmlns:nattableaxisconfiguration="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisconfiguration"
- xmlns:nattableaxisprovider="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisprovider"
- xmlns:nattableconfiguration="http://www.eclipse.org/papyrus/nattable/model/nattableconfiguration"
- xmlns:nattablelabelprovider="http://www.eclipse.org/papyrus/nattable/model/table/nattablecontentprovider"
- type="PapyruNattableViewsEditor">
- <columnAxisProvider
- xsi:type="nattableaxisprovider:DefaultAxisProvider">
- <javaAxisManagerIds>org.eclipse.papyrus.infra.nattable.page.editor.view.feature.axis.manager</javaAxisManagerIds>
- <axisConfiguration
- xsi:type="nattableaxisconfiguration:DefaultAxisConfiguration"
- indexStyle="ALPHABETIC">
- <labelConfiguration
- xsi:type="nattablelabelprovider:FeatureLabelProviderConfiguration"
- labelProviderContext="org.eclipse.papyrus.infra.nattable.header.feature.labelprovider"/>
- </axisConfiguration>
- <axis xsi:type="nattable:IdAxis"
- element="nattable_editor_pages:/name"/>
- <axis xsi:type="nattable:IdAxis"
- element="nattable_editor_pages:/context"/>
- <axis xsi:type="nattable:IdAxis"
- element="nattable_editor_pages:/isOpen"/>
- <axis xsi:type="nattable:IdAxis"
- element="nattable_editor_pages:/type"/>
- </columnAxisProvider>
- <rowAxisProvider
- xsi:type="nattableaxisprovider:EMFFeatureValueAxisProvider">
- <javaAxisManagerIds>org.eclipse.papyrus.infra.nattable.page.editor.contents.axis.manager</javaAxisManagerIds>
- <axisConfiguration
- xsi:type="nattableaxisconfiguration:DefaultAxisConfiguration">
- <labelConfiguration
- xsi:type="nattablelabelprovider:ObjectLabelProviderConfiguration"
- labelProviderContext="org.eclipse.papyrus.infra.nattable.header.labelprovider"/>
- </axisConfiguration>
- <listenFeature
- xsi:type="ecore:EReference"
- href="platform:/plugin/org.eclipse.papyrus.infra.core.sasheditor.di/model/di.ecore#//PageList/availablePage"/>
- </rowAxisProvider>
-</nattableconfiguration:TableConfiguration>
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/Activator.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/Activator.java
deleted file mode 100644
index 169f41471a6..00000000000
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/Activator.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*****************************************************************************
- * 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
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.nattable.views.editor;
-
-import org.eclipse.papyrus.infra.core.log.LogHelper;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.nattable.page.editor"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- public static LogHelper log;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- log = new LogHelper(this);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
-}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/NattablePageEditor.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/NattablePageEditor.java
deleted file mode 100644
index 0c045702774..00000000000
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/NattablePageEditor.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.nattable.views.editor;
-
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.infra.nattable.common.editor.AbstractEMFNattableEditor;
-import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
-
-public class NattablePageEditor extends AbstractEMFNattableEditor {
-
- /** the type of the editor */
- public static final String EDITOR_TYPE = "PapyruNattableViewsEditor"; //$NON-NLS-1$
-
- /** the default name for this table */
- public static final String DEFAULT_NAME = "ViewTable"; //$NON-NLS-1$
-
- /**
- *
- * Constructor.
- *
- * @param servicesRegistry
- * @param rawModel
- */
- public NattablePageEditor(ServicesRegistry servicesRegistry, final Table rawModel) {
- super(servicesRegistry, rawModel);
- }
-
-
-
-}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/celleditor/ModelViewsCellEditorConfiguration.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/celleditor/ModelViewsCellEditorConfiguration.java
deleted file mode 100644
index 92caa5f862c..00000000000
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/celleditor/ModelViewsCellEditorConfiguration.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*****************************************************************************
- * 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
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.nattable.views.editor.celleditor;
-
-import org.eclipse.papyrus.infra.emf.nattable.celleditor.config.EStructuralFeatureEditorConfig;
-import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
-import org.eclipse.papyrus.infra.nattable.views.editor.NattablePageEditor;
-import org.eclipse.papyrus.infra.nattable.views.editor.utils.Utils;
-
-
-/**
- * The cell editor configuration for the table model views
- *
- * @author Vincent Lorenzo
- *
- */
-public class ModelViewsCellEditorConfiguration extends EStructuralFeatureEditorConfig {
-
- public static final String CONFIG_EDITOR_ID = "MODEL_VIEW_CELL_EDITOR_ID";
-
- /**
- *
- * @see org.eclipse.papyrus.infra.emf.nattable.celleditor.config.EStructuralFeatureEditorConfig#getFeatureIdentifier(org.eclipse.papyrus.infra.nattable.model.nattable.Table,
- * java.lang.Object)
- *
- * @param table
- * @param axisElement
- * @return
- */
- @Override
- protected int getFeatureIdentifier(Table table, Object axisElement) {
- if(((String)axisElement).equals(Utils.NATTABLE_EDITOR_PAGE_ID + Utils.VIEW_CONTEXT)) {
- return SINGLE_EMF_REFERENCE;
- } else if(((String)axisElement).equals(Utils.NATTABLE_EDITOR_PAGE_ID + Utils.VIEW_IS_OPEN)) {
- return SINGLE_BOOLEAN;
- } else if(((String)axisElement).equals(Utils.NATTABLE_EDITOR_PAGE_ID + Utils.VIEW_NAME)) {
- return SINGLE_STRING;
- } else if(((String)axisElement).equals(Utils.NATTABLE_EDITOR_PAGE_ID + Utils.VIEW_EDITOR_TYPE)) {
- return SINGLE_STRING;
- }
- return UNKNOWN_TYPE;
- }
-
- /**
- *
- * @see org.eclipse.papyrus.infra.emf.nattable.celleditor.config.EStructuralFeatureEditorConfig#handles(org.eclipse.papyrus.infra.nattable.model.nattable.Table,
- * java.lang.Object)
- *
- * @param table
- * @param axisElement
- * @return
- */
- @Override
- public boolean handles(Table table, Object axisElement) {
- if(table.getEditorConfiguration().getType().equals(NattablePageEditor.EDITOR_TYPE)) {
- return axisElement instanceof String && ((String)axisElement).startsWith(Utils.NATTABLE_EDITOR_PAGE_ID);
- }
- return false;
- }
-
- @Override
- public String getEditorId() {
- return CONFIG_EDITOR_ID;
- }
-}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/factory/NattablePageEditorFactory.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/factory/NattablePageEditorFactory.java
deleted file mode 100644
index c5d8c1ec55d..00000000000
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/factory/NattablePageEditorFactory.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 LIFL & CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cedric Dumoulin (LIFL) cedric.dumoulin@lifl.fr - Initial API and implementation
- * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr
- *****************************************************************************/
-
-package org.eclipse.papyrus.infra.nattable.views.editor.factory;
-
-import org.eclipse.papyrus.infra.nattable.common.factory.AbstractNattableEditorFactory;
-import org.eclipse.papyrus.infra.nattable.views.editor.NattablePageEditor;
-
-
-
-
-public class NattablePageEditorFactory extends AbstractNattableEditorFactory {
-
-
- /**
- * Constructor.
- *
- * @param diagramClass
- * @param expectedType
- */
- public NattablePageEditorFactory() {
- super(NattablePageEditor.class, NattablePageEditor.EDITOR_TYPE);
- }
-
-
-}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/handlers/CreateNattablePageEditorHandler.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/handlers/CreateNattablePageEditorHandler.java
deleted file mode 100644
index 308c62ceab8..00000000000
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/handlers/CreateNattablePageEditorHandler.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-
-package org.eclipse.papyrus.infra.nattable.views.editor.handlers;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.papyrus.infra.nattable.common.handlers.AbstractCreateNattableEditorHandler;
-import org.eclipse.papyrus.infra.nattable.views.editor.Activator;
-import org.eclipse.papyrus.infra.nattable.views.editor.NattablePageEditor;
-
-
-public class CreateNattablePageEditorHandler extends AbstractCreateNattableEditorHandler {
-
- private static final String CONFIGURATION_PATH = "/resources/viewpage.nattableconfiguration";
-
- /**
- *
- * Constructor.
- *
- */
- public CreateNattablePageEditorHandler() {
- super(NattablePageEditor.EDITOR_TYPE, NattablePageEditor.DEFAULT_NAME);
- }
-
- @Override
- protected URI getTableEditorConfigurationURI() {
- final String symbolicName = Activator.getDefault().getBundle().getSymbolicName();
- final URI uri = URI.createPlatformPluginURI(symbolicName + CONFIGURATION_PATH, true);
- return uri;
- }
-}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/manager/axis/EditorContextSynchronizerAxisManager.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/manager/axis/EditorContextSynchronizerAxisManager.java
deleted file mode 100644
index 95e0145a22b..00000000000
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/manager/axis/EditorContextSynchronizerAxisManager.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*****************************************************************************
- * 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
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.nattable.views.editor.manager.axis;
-
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.infra.core.sashwindows.di.DiPackage;
-import org.eclipse.papyrus.infra.core.sashwindows.di.PageList;
-import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef;
-import org.eclipse.papyrus.infra.nattable.manager.axis.AbstractSynchronizedOnFeatureAxisManager;
-import org.eclipse.papyrus.infra.nattable.manager.cell.CellManagerFactory;
-import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
-import org.eclipse.papyrus.infra.nattable.manager.table.NattableModelManager;
-import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
-import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisprovider.AbstractAxisProvider;
-import org.eclipse.papyrus.infra.nattable.views.editor.utils.Utils;
-
-/**
- *
- * @author Vincent Lorenzo
- *
- */
-public class EditorContextSynchronizerAxisManager extends AbstractSynchronizedOnFeatureAxisManager {
-
- /**
- *
- * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractSynchronizedOnFeatureAxisManager#init(org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager,
- * java.lang.String, org.eclipse.papyrus.infra.nattable.model.nattable.Table,
- * org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisprovider.AbstractAxisProvider, boolean)
- *
- * @param manager
- * @param managerId
- * @param table
- * @param provider
- * @param mustRefreshOnAxisChanges
- */
- @Override
- public void init(final INattableModelManager manager, final String managerId, final Table table, final AbstractAxisProvider provider, boolean mustRefreshOnAxisChanges) {
- super.init(manager, managerId, table, provider, mustRefreshOnAxisChanges);
- final PageList pageList = Utils.getPageList(getTable());
- this.featureListener = new AdapterImpl() {
-
- @Override
- public void notifyChanged(Notification msg) {
- if(msg.getFeature() == DiPackage.eINSTANCE.getPageList_AvailablePage()) {
- updateAxisContents();
- ((NattableModelManager)getTableManager()).refreshNattable();
- }
- }
- };
- pageList.eAdapters().add(this.featureListener);
- }
-
- /**
- *
- * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractSynchronizedOnFeatureAxisManager#verifyCoupleContextFeature()
- *
- */
- @Override
- protected void verifyCoupleContextFeature() {
- //nothing to do
- }
-
- /**
- *
- * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#updateAxisContents()
- *
- */
- @Override
- public synchronized void updateAxisContents() {
- final PageList pageList = Utils.getPageList(getTable());
- final List<Object> elements = getTableManager().getElementsList(getRepresentedContentProvider());
- elements.clear();//FIXME risk of blinking with the glazed list!
- for(final PageRef ref : pageList.getAvailablePage()) {
- final Object page = ref.getPageIdentifier();
- if(mustBeDisplayedInThisTable(page)) {
- elements.add(page);
- }
- }
- }
-
-
- /**
- *
- * @param page
- * a page
- * @return
- * <code>true</code> if the page is referenced by a child of the context of the table or by the context itself
- */
- private boolean mustBeDisplayedInThisTable(final Object page) {
- final Object value = CellManagerFactory.INSTANCE.getCrossValue(page, Utils.NATTABLE_EDITOR_PAGE_ID + Utils.VIEW_CONTEXT);
- if(value instanceof EObject) {
- final EObject tableContext = getTable().getContext();
- EObject container = (EObject)value;
- while(container != null) {
- if(container == tableContext) {
- return true;
- }
- container = container.eContainer();
- }
- }
- return false;
- }
-
- /**
- *
- * @see org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager#dispose()
- *
- */
- @Override
- public void dispose() {
- final PageList pageList = Utils.getPageList(getTable());
- pageList.eAdapters().remove(this.featureListener);
- }
-
-}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/manager/axis/EditorFeatureAxisManager.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/manager/axis/EditorFeatureAxisManager.java
deleted file mode 100644
index e45febc6f9d..00000000000
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/manager/axis/EditorFeatureAxisManager.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*****************************************************************************
- * 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
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.nattable.views.editor.manager.axis;
-
-import java.util.List;
-
-import org.eclipse.papyrus.infra.nattable.manager.axis.AbstractAxisManager;
-import org.eclipse.papyrus.infra.nattable.model.nattable.IAxis;
-import org.eclipse.papyrus.infra.nattable.model.nattable.IdAxis;
-import org.eclipse.papyrus.infra.nattable.views.editor.utils.Utils;
-
-/**
- * The feature axis content provider for the ModelViews table
- *
- * @author Vincent Lorenzo
- *
- */
-public class EditorFeatureAxisManager extends AbstractAxisManager {
-
- @Override
- public synchronized void updateAxisContents() {
- final List<Object> elements = getTableManager().getElementsList(getRepresentedContentProvider());
- for(final IAxis current : getRepresentedContentProvider().getAxis()) {
- if(current instanceof IdAxis) {
- final String id = (String)current.getElement();
- if(id.startsWith(Utils.NATTABLE_EDITOR_PAGE_ID) && !elements.contains(id)) {
- elements.add(id);
- }
- }
- }
- }
-}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/manager/cell/ModelViewsCellManager.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/manager/cell/ModelViewsCellManager.java
deleted file mode 100644
index 94370e6bb63..00000000000
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/manager/cell/ModelViewsCellManager.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*****************************************************************************
- * 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
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.nattable.views.editor.manager.cell;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.emf.type.core.requests.AbstractEditCommandRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForResource;
-import org.eclipse.papyrus.infra.nattable.manager.cell.AbstractCellManager;
-import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
-import org.eclipse.papyrus.infra.nattable.views.editor.Activator;
-import org.eclipse.papyrus.infra.nattable.views.editor.utils.Utils;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-
-/**
- * The Cell manager for the ModelViews table
- *
- * @author Vincent Lorenzo
- *
- */
-public class ModelViewsCellManager extends AbstractCellManager {
-
- /**
- * the name of the feature which references the context of a diagram
- */
- private static final String DIAGRAM_CONTEXT_FEATURE_NAME = "element"; //$NON-NLS-1$
-
- /**
- * the name of the feature which references the EMF-Facet table in the PapyrusTableInstance
- */
- private static final String PAPYRUS_TABLE_INSTANCE__TABLE_INSTANCE2_FEATURE_NAME = "table"; //$NON-NLS-1$
-
- /**
- *
- * @param obj1
- * @param obj2
- * @return
- */
- protected List<Object> organizeObject(final Object obj1, final Object obj2) {
- final List<Object> objects = new ArrayList<Object>();
- if(obj1 instanceof String && ((String)obj1).startsWith(Utils.NATTABLE_EDITOR_PAGE_ID)) {
- objects.add(obj2);
- objects.add(obj1);
- } else if(obj2 instanceof String && ((String)obj2).startsWith(Utils.NATTABLE_EDITOR_PAGE_ID)) {
- objects.add(obj1);
- objects.add(obj2);
- }
- if(objects.size() == 2) {
- final Object first = objects.get(0);
- if(first instanceof EObject) {
- final IPageManager mngr = Utils.getIPagneManager((EObject)first);
- if(mngr != null && !mngr.allPages().contains(first)) {
- return Collections.emptyList();
- }
- }
- }
-
- return objects;
- }
-
- /**
- *
- * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#handles(java.lang.Object, java.lang.Object)
- *
- * @param obj1
- * @param obj2
- * @return
- */
- public boolean handles(Object obj1, Object obj2) {
- return organizeObject(obj1, obj2).size() == 2;
- }
-
- /**
- *
- * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#handlersAxisElement(java.lang.Object)
- *
- * @param obj
- * @return
- */
- public boolean handlersAxisElement(Object obj) {
- return false;
- }
-
- /**
- *
- * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#getValue(java.lang.Object, java.lang.Object)
- *
- * @param obj1
- * @param obj2
- * @return
- */
- public Object getValue(Object obj1, Object obj2) {
- final List<Object> objects = organizeObject(obj1, obj2);
- final String featureName = ((String)objects.get(1)).replace(Utils.NATTABLE_EDITOR_PAGE_ID, ""); //$NON-NLS-1$
- final Object editor = objects.get(0);
- if(Utils.VIEW_NAME.equals(featureName)) {
- return getEditorName(editor);
- }
- if(Utils.VIEW_CONTEXT.equals(featureName)) {
- return getEditorContext(editor);
- }
- if(Utils.VIEW_IS_OPEN.equals(featureName)) {
- return getEditorIsOpen(editor);
- }
- if(Utils.VIEW_EDITOR_TYPE.equals(featureName)) {
- return getEditorType(editor);
- }
- return NOT_AVALAIBLE;
- }
-
-
- /**
- *
- * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#isCellEditable(java.lang.Object, java.lang.Object)
- *
- * @param obj1
- * @param obj2
- * @return
- * <code>true</code> excepted if the edited feature is isOpen
- */
- public boolean isCellEditable(Object obj1, Object obj2) {
- final List<Object> objects = organizeObject(obj1, obj2);
- final String featureName = ((String)objects.get(1)).replace(Utils.NATTABLE_EDITOR_PAGE_ID, ""); //$NON-NLS-1$
- return featureName.equals(Utils.VIEW_NAME);
- }
-
- /**
- *
- * @see org.eclipse.papyrus.infra.nattable.manager.cell.ICellManager#getSetValueCommand(org.eclipse.emf.edit.domain.EditingDomain,
- * java.lang.Object, java.lang.Object, java.lang.Object)
- *
- * @param domain
- * @param obj1
- * @param obj2
- * @param newValue
- * @return
- */
- public Command getSetValueCommand(EditingDomain domain, Object obj1, Object obj2, Object newValue) {
- final List<Object> objects = organizeObject(obj1, obj2);
- if(objects.get(0) instanceof EObject) {
- final EObject editor = (EObject)objects.get(0);
- final String featureName = ((String)objects.get(1)).replace(Utils.NATTABLE_EDITOR_PAGE_ID, ""); //$NON-NLS-1$
- if(Utils.VIEW_NAME.equals(featureName)) {
- EStructuralFeature feature = editor.eClass().getEStructuralFeature(Utils.VIEW_NAME);
- final AbstractEditCommandRequest request = new SetRequest((TransactionalEditingDomain)domain, editor, feature, newValue);
- final IElementEditService provider = ElementEditServiceUtils.getCommandProvider(editor);
- return new GMFtoEMFCommandWrapper(provider.getEditCommand(request));
- }
- }
- return null;
- }
-
- /**
- *
- * @param editor
- * an editor
- * @return
- * the type of the editor
- */
- protected Object getEditorType(final Object editor) {
- if(editor instanceof EObject) {
- if(editor instanceof Table) {
- return ((Table)editor).getEditorConfiguration().getType();
- } else {
- EStructuralFeature feature = ((EObject)editor).eClass().getEStructuralFeature(Utils.VIEW_EDITOR_TYPE);
- if(feature != null) {
- return ((EObject)editor).eGet(feature);
- }
- }
- }
- return NOT_AVALAIBLE;
- }
-
- /**
- *
- * @param editor
- * the editor
- * @return
- * <code>true</code> if the current editor is open
- */
- protected Object getEditorIsOpen(final Object editor) {
- if(editor instanceof EObject) {
- IPageManager mngr = null;
- try {
- mngr = ServiceUtilsForResource.getInstance().getIPageManager(((EObject)editor).eResource());
- return mngr.isOpen(editor);
- } catch (ServiceException e) {
- Activator.log.error(e);
- }
- }
-
- return NOT_AVALAIBLE;
- }
-
- /**
- *
- * @param editor
- * an editor
- * @return
- * the name of the editor
- */
- protected Object getEditorName(final Object editor) {
- if(editor instanceof EObject) {
- if(editor instanceof EObject) {
- final EObject eobject = (EObject)editor;
- EStructuralFeature feature = eobject.eClass().getEStructuralFeature(Utils.VIEW_NAME);
- if(feature != null) {
- return eobject.eGet(feature);
- }
- }
- }
- return NOT_AVALAIBLE;
- }
-
- /**
- *
- * @param editor
- * the editor
- * @return
- * the context of this editor
- */
- protected Object getEditorContext(final Object editor) {
- if(editor instanceof EObject) {
- EObject eobject = (EObject)editor;
- EStructuralFeature feature = eobject.eClass().getEStructuralFeature(Utils.VIEW_CONTEXT);
- if(feature == null) {//it is maybe a diagram
- //workaround for the diagram
- feature = eobject.eClass().getEStructuralFeature(DIAGRAM_CONTEXT_FEATURE_NAME);
- }
- if(feature != null) {
- return eobject.eGet(feature);
- }
- //its maybe an old table
- EStructuralFeature tmp = eobject.eClass().getEStructuralFeature(PAPYRUS_TABLE_INSTANCE__TABLE_INSTANCE2_FEATURE_NAME);
- if(tmp != null) {
- final EObject tableinstance2 = (EObject)eobject.eGet(tmp);
- if(tableinstance2 != null) {
- feature = tableinstance2.eClass().getEStructuralFeature(Utils.VIEW_CONTEXT);
- return tableinstance2.eGet(feature);
- }
-
- }
- }
- return NOT_AVALAIBLE;
- }
-
-}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/provider/ModelViewsHeaderLabelProvider.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/provider/ModelViewsHeaderLabelProvider.java
deleted file mode 100644
index 079bf55dd63..00000000000
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/provider/ModelViewsHeaderLabelProvider.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*****************************************************************************
- * 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
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.nattable.views.editor.provider;
-
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry;
-import org.eclipse.nebula.widgets.nattable.grid.GridRegion;
-import org.eclipse.nebula.widgets.nattable.layer.LabelStack;
-import org.eclipse.nebula.widgets.nattable.style.DisplayMode;
-import org.eclipse.papyrus.infra.emf.nattable.provider.EMFFeatureHeaderLabelProvider;
-import org.eclipse.papyrus.infra.emf.nattable.registry.EStructuralFeatureImageRegistry;
-import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
-import org.eclipse.papyrus.infra.nattable.model.nattable.nattablelabelprovider.FeatureLabelProviderConfiguration;
-import org.eclipse.papyrus.infra.nattable.model.nattable.nattablelabelprovider.ILabelConfiguration;
-import org.eclipse.papyrus.infra.nattable.model.nattable.nattablelabelprovider.ObjectLabelProviderConfiguration;
-import org.eclipse.papyrus.infra.nattable.utils.AxisUtils;
-import org.eclipse.papyrus.infra.nattable.utils.ILabelProviderContextElement;
-import org.eclipse.papyrus.infra.nattable.utils.LabelProviderCellContextElement;
-import org.eclipse.papyrus.infra.nattable.utils.NattableConfigAttributes;
-import org.eclipse.papyrus.infra.nattable.views.editor.utils.Utils;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * The label provider used for ModelView header
- *
- * @author Vincent Lorenzo
- *
- */
-public class ModelViewsHeaderLabelProvider extends EMFFeatureHeaderLabelProvider {
-
- /**
- *
- * @see org.eclipse.papyrus.infra.emf.nattable.provider.EMFFeatureHeaderLabelProvider#accept(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- public boolean accept(final Object element) {
- if(element instanceof ILabelProviderContextElement) {
- final Object object = ((ILabelProviderContextElement)element).getObject();
- final String id = AxisUtils.getPropertyId(object);
- if(id != null) {
- return id.startsWith(Utils.NATTABLE_EDITOR_PAGE_ID);
- }
- }
- return false;
- }
-
- /**
- *
- * @see org.eclipse.papyrus.infra.emf.nattable.provider.EMFFeatureHeaderLabelProvider#getText(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- public String getText(final Object element) {
- final Object object = ((ILabelProviderContextElement)element).getObject();
- final IConfigRegistry configRegistry = ((ILabelProviderContextElement)element).getConfigRegistry();
- final String id = AxisUtils.getPropertyId(object);
- final String name = id.replaceFirst(Utils.NATTABLE_EDITOR_PAGE_ID, ""); //$NON-NLS-1$
- Object type = null;
- boolean isDerived = false;
- int lowerBounds = 1;
- int upperBounds = 1;
- if(Utils.VIEW_NAME.equals(name)) {
- lowerBounds = 0;
- type = EcorePackage.eINSTANCE.getEString();
- } else if(Utils.VIEW_IS_OPEN.equals(name)) {
- isDerived = true;
- type = EcorePackage.eINSTANCE.getEBoolean();
- } else if(Utils.VIEW_CONTEXT.equals(name)) {
- isDerived = true;
- type = EcorePackage.eINSTANCE.getEObject();
- } else if(Utils.VIEW_EDITOR_TYPE.equals(name)) {
- type = EcorePackage.eINSTANCE.getEString();
- }
- ILabelConfiguration conf = null;
- if(element instanceof LabelProviderCellContextElement) {
- INattableModelManager manager = configRegistry.getConfigAttribute(NattableConfigAttributes.NATTABLE_MODEL_MANAGER_CONFIG_ATTRIBUTE, DisplayMode.NORMAL, NattableConfigAttributes.NATTABLE_MODEL_MANAGER_ID);
- LabelStack labels = ((LabelProviderCellContextElement)element).getCell().getConfigLabels();
- if(labels.hasLabel(GridRegion.COLUMN_HEADER)) {
- conf = manager.getColumnAxisConfiguration().getLabelConfiguration();
- } else if(labels.hasLabel(GridRegion.ROW_HEADER)) {
- conf = manager.getRowAxisConfiguration().getLabelConfiguration();
- }
- }
- if(conf instanceof ObjectLabelProviderConfiguration && !((ObjectLabelProviderConfiguration)conf).isDisplayLabel()) {
- return "";
- }
- if(conf instanceof FeatureLabelProviderConfiguration) {
- return getText((FeatureLabelProviderConfiguration)conf, configRegistry, name, type, isDerived, lowerBounds, upperBounds);
- } else {
- return super.getText(element);
- }
- }
-
- /**
- *
- * @see org.eclipse.papyrus.infra.emf.nattable.provider.EMFFeatureHeaderLabelProvider#getImage(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- public Image getImage(final Object element) {
- ILabelConfiguration conf = null;
- if(element instanceof LabelProviderCellContextElement) {
- final IConfigRegistry configRegistry = ((ILabelProviderContextElement)element).getConfigRegistry();
- INattableModelManager manager = configRegistry.getConfigAttribute(NattableConfigAttributes.NATTABLE_MODEL_MANAGER_CONFIG_ATTRIBUTE, DisplayMode.NORMAL, NattableConfigAttributes.NATTABLE_MODEL_MANAGER_ID);
- LabelStack labels = ((LabelProviderCellContextElement)element).getCell().getConfigLabels();
- if(labels.hasLabel(GridRegion.COLUMN_HEADER)) {
- conf = manager.getColumnAxisConfiguration().getLabelConfiguration();
- } else if(labels.hasLabel(GridRegion.ROW_HEADER)) {
- conf = manager.getRowAxisConfiguration().getLabelConfiguration();
- }
-
- }
- if(conf instanceof ObjectLabelProviderConfiguration && !((ObjectLabelProviderConfiguration)conf).isDisplayIcon()) {
- return null;
- }
- final Object object = ((ILabelProviderContextElement)element).getObject();
- final String id = AxisUtils.getPropertyId(object);
- final String columnName = id.replaceFirst(Utils.NATTABLE_EDITOR_PAGE_ID, ""); //$NON-NLS-1$
- if(Utils.VIEW_NAME.equals(columnName) || Utils.VIEW_IS_OPEN.equals(columnName) || Utils.VIEW_EDITOR_TYPE.equals(columnName)) {
- return EStructuralFeatureImageRegistry.getAttributeIcon();
- } else if(Utils.VIEW_CONTEXT.equals(columnName)) {
- return EStructuralFeatureImageRegistry.getLinkIcon();
- }
- return null;
- }
-}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/utils/Utils.java b/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/utils/Utils.java
deleted file mode 100644
index d1f04cc76c7..00000000000
--- a/sandbox/TableV3/org.eclipse.papyrus.infra.nattable.views.editor/src/org/eclipse/papyrus/infra/nattable/views/editor/utils/Utils.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*****************************************************************************
- * 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
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.nattable.views.editor.utils;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.papyrus.infra.core.resource.ModelSet;
-import org.eclipse.papyrus.infra.core.resource.sasheditor.DiModel;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
-import org.eclipse.papyrus.infra.core.sashwindows.di.PageList;
-import org.eclipse.papyrus.infra.core.sashwindows.di.SashWindowsMngr;
-import org.eclipse.papyrus.infra.core.sashwindows.di.util.DiUtils;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForResource;
-import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
-import org.eclipse.papyrus.infra.nattable.views.editor.Activator;
-
-/**
- *
- * @author Vincent Lorenzo
- *
- */
-public class Utils {
-
- private Utils() {
- //to prevent instanciation
- }
-
- /**
- * the prefix used for the editor
- */
- public static final String NATTABLE_EDITOR_PAGE_ID = "nattable_editor_pages:/"; //$NON-NLS-1$
-
- /**
- * the name column
- */
- public static final String VIEW_NAME = "name"; //$NON-NLS-1$
-
- /**
- * the context column
- */
- public static final String VIEW_CONTEXT = "context"; //$NON-NLS-1$
-
- /**
- * the isOpen column
- */
- public static final String VIEW_IS_OPEN = "isOpen"; //$NON-NLS-1$
-
- /**
- * the type column
- */
- public static final String VIEW_EDITOR_TYPE = "type"; //$NON-NLS-1$
-
- /**
- *
- * @return
- * the page list used for this model
- */
- public static final PageList getPageList(final Table table) {
- final Resource resource = table.eResource();
- final ModelSet modelSet = (ModelSet)resource.getResourceSet();
- final Resource diResource = modelSet.getAssociatedResource(resource, DiModel.DI_FILE_EXTENSION, false);
- final SashWindowsMngr windowMngr = DiUtils.lookupSashWindowsMngr(diResource);
- final PageList pageList = windowMngr.getPageList();
- assert pageList != null;
- return pageList;
- }
-
- /**
- *
- * @param eobject
- * an eobject
- * @return
- * the IPageMngr found thanks to this eobject or <code>null</code> if not found
- */
- public static final IPageManager getIPagneManager(final EObject eobject) {
- IPageManager mngr = null;
- try {
- mngr = ServiceUtilsForResource.getInstance().getIPageManager(eobject.eResource());
- } catch (ServiceException e) {
- Activator.log.error(e);
- }
- return mngr;
- }
-
-
-}
diff --git a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable/src/org/eclipse/papyrus/sysml/nattable/manager/axis/RequirementAxisManager.java b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable/src/org/eclipse/papyrus/sysml/nattable/manager/axis/RequirementAxisManager.java
index 7cd0b4b0d58..5b5ef1d5d1a 100644
--- a/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable/src/org/eclipse/papyrus/sysml/nattable/manager/axis/RequirementAxisManager.java
+++ b/sandbox/TableV3/org.eclipse.papyrus.sysml.nattable/src/org/eclipse/papyrus/sysml/nattable/manager/axis/RequirementAxisManager.java
@@ -12,10 +12,13 @@ import org.eclipse.papyrus.infra.nattable.manager.axis.AbstractSynchronizedOnFea
import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
import org.eclipse.papyrus.infra.nattable.manager.table.NattableModelManager;
import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.AxisManagerRepresentation;
+import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisconfiguration.EStructuralFeatureValueFillingConfiguration;
+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.model.nattable.nattableaxisprovider.EMFFeatureValueAxisProvider;
import org.eclipse.papyrus.sysml.service.types.matcher.RequirementMatcher;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.uml2.uml.UMLPackage;
@@ -25,11 +28,21 @@ public class RequirementAxisManager extends AbstractSynchronizedOnFeatureAxisMan
private boolean isRefreshing = false;
+
+
@Override
- public void init(INattableModelManager manager, String managerId, Table table, AbstractAxisProvider provider, boolean mustRefreshOnAxisChanges) {
- super.init(manager, managerId, table, provider, false);//false, with this axis manager, the contents is derived of the feature
+ public void init(INattableModelManager manager, AxisManagerRepresentation rep, Table table, AbstractAxisProvider provider, boolean mustRefreshOnAxisChanges) {
+ super.init(manager, rep, table, provider, false);//false, with this axis manager, the contents is derived of the feature
updateAxisContents();
- final EStructuralFeature listenFeature = ((EMFFeatureValueAxisProvider)getRepresentedContentProvider()).getListenFeature();
+
+ EStructuralFeatureValueFillingConfiguration config = null;
+ for(final IAxisConfiguration current : this.rep.getSpecificAxisConfiguration()) {
+ if(current instanceof EStructuralFeatureValueFillingConfiguration) {
+ config = (EStructuralFeatureValueFillingConfiguration)current;
+ break;
+ }
+ }
+ final EStructuralFeature listenFeature = config.getListenFeature();
// this.featureListener = new UMLDerivedUnionAdapter() {
//
@@ -48,20 +61,20 @@ public class RequirementAxisManager extends AbstractSynchronizedOnFeatureAxisMan
@Override
public void notifyChanged(Notification msg) {
- // if(msg.getFeature() == ((EMFFeatureValueAxisProvider)getRepresentedContentProvider()).getListenFeature() || msg.getFeature() == UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute()) {
- // //FIXME : add test
- if(!RequirementAxisManager.this.isRefreshing) {//to avoid to many thread
- RequirementAxisManager.this.isRefreshing = true;
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- updateAxisContents();
- ((NattableModelManager)getTableManager()).refreshNattable();
- RequirementAxisManager.this.isRefreshing = false;
- }
- });
+ if(msg.getFeature() == listenFeature || msg.getFeature() == UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute()) {
+ //FIXME : add test
+ if(!RequirementAxisManager.this.isRefreshing) {//to avoid to many thread
+ RequirementAxisManager.this.isRefreshing = true;
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ updateAxisContents();
+ ((NattableModelManager)getTableManager()).refreshNattable();
+ RequirementAxisManager.this.isRefreshing = false;
+ }
+ });
+ }
}
- // }
}
};
getTable().getContext().eAdapters().add(this.featureListener);
@@ -80,7 +93,16 @@ public class RequirementAxisManager extends AbstractSynchronizedOnFeatureAxisMan
@Override
public synchronized void updateAxisContents() {
final EObject context = getTable().getContext();
- final EStructuralFeature ref = ((EMFFeatureValueAxisProvider)getRepresentedContentProvider()).getListenFeature();
+ //FIXME
+ EStructuralFeatureValueFillingConfiguration config = null;
+ for(final IAxisConfiguration current : this.rep.getSpecificAxisConfiguration()) {
+ if(current instanceof EStructuralFeatureValueFillingConfiguration) {
+ config = (EStructuralFeatureValueFillingConfiguration)current;
+ break;
+ }
+ }
+ final EStructuralFeature ref = config.getListenFeature();
+
Object value = context.eGet(ref);
assert value instanceof List<?>;

Back to the top