Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/META-INF/MANIFEST.MF2
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/pom.xml2
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/config/UMLStereotypeSingleUMLReferenceCellEditorConfiguration.java35
3 files changed, 32 insertions, 7 deletions
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/META-INF/MANIFEST.MF b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/META-INF/MANIFEST.MF
index c297f8a0798..f67e788cae2 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/META-INF/MANIFEST.MF
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/META-INF/MANIFEST.MF
@@ -20,7 +20,7 @@ Require-Bundle: org.eclipse.papyrus.uml.tools;bundle-version="[4.0.0,5.0.0)";vis
org.eclipse.papyrus.infra.properties.ui;bundle-version="[3.0.0,4.0.0)"
Bundle-Vendor: %Bundle-Vendor
Bundle-ActivationPolicy: lazy
-Bundle-Version: 5.2.0.qualifier
+Bundle-Version: 5.2.100.qualifier
Bundle-Name: %Bundle-Name
Bundle-Localization: plugin
Bundle-Activator: org.eclipse.papyrus.uml.nattable.Activator
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/pom.xml b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/pom.xml
index 6f3c6915b5d..7c3f2fd7938 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/pom.xml
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/pom.xml
@@ -9,6 +9,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.uml.nattable</artifactId>
- <version>5.2.0-SNAPSHOT</version>
+ <version>5.2.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/config/UMLStereotypeSingleUMLReferenceCellEditorConfiguration.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/config/UMLStereotypeSingleUMLReferenceCellEditorConfiguration.java
index d7d0d87d112..38dfba8220e 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/config/UMLStereotypeSingleUMLReferenceCellEditorConfiguration.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/config/UMLStereotypeSingleUMLReferenceCellEditorConfiguration.java
@@ -1,6 +1,6 @@
/*****************************************************************************
- * Copyright (c) 2015 CEA LIST and others.
- *
+ * Copyright (c) 2015, 2019 CEA LIST and others.
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,13 +10,22 @@
*
* Contributors:
* Vincent LORENZO (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
+ * Vincent LORENZO (CEA LIST) vincent.lorenzo@cea.fr - Bug 545401
*****************************************************************************/
package org.eclipse.papyrus.uml.nattable.config;
+import org.eclipse.nebula.widgets.nattable.config.CellConfigAttributes;
+import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry;
+import org.eclipse.nebula.widgets.nattable.edit.EditConfigAttributes;
+import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter;
+import org.eclipse.nebula.widgets.nattable.style.DisplayMode;
+import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
import org.eclipse.papyrus.infra.nattable.utils.AxisUtils;
+import org.eclipse.papyrus.infra.nattable.utils.NattableConfigAttributes;
+import org.eclipse.papyrus.uml.nattable.converter.SingleUMLReferenceDisplayConverter;
+import org.eclipse.papyrus.uml.nattable.editor.SingleReferenceValueCellEditor;
import org.eclipse.papyrus.uml.nattable.utils.UMLTableUtils;
import org.eclipse.uml2.uml.DataType;
import org.eclipse.uml2.uml.Element;
@@ -36,7 +45,7 @@ public class UMLStereotypeSingleUMLReferenceCellEditorConfiguration extends Sing
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.papyrus.uml.nattable.config.SingleUMLReferenceCellEditorConfiguration#getConfigurationId()
*/
@Override
@@ -46,7 +55,7 @@ public class UMLStereotypeSingleUMLReferenceCellEditorConfiguration extends Sing
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.papyrus.uml.nattable.config.SingleUMLReferenceCellEditorConfiguration#handles(org.eclipse.papyrus.infra.nattable.model.nattable.Table, java.lang.Object)
*/
@Override
@@ -64,4 +73,20 @@ public class UMLStereotypeSingleUMLReferenceCellEditorConfiguration extends Sing
}
return result;
}
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.infra.nattable.celleditor.config.ICellAxisConfiguration#configureCellEditor(org.eclipse.nebula.widgets.nattable.config.IConfigRegistry, java.lang.Object, java.lang.String)
+ */
+ @Override
+ public void configureCellEditor(final IConfigRegistry configRegistry, final Object axis, final String configLabel) {
+ configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, new TextPainter(), DisplayMode.NORMAL, configLabel);
+ final Object axisElement = AxisUtils.getRepresentedElement(axis);
+
+ final INattableModelManager modelManager = configRegistry.getConfigAttribute(NattableConfigAttributes.NATTABLE_MODEL_MANAGER_CONFIG_ATTRIBUTE, DisplayMode.NORMAL, NattableConfigAttributes.NATTABLE_MODEL_MANAGER_ID);
+ configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, new SingleReferenceValueCellEditor(axisElement, modelManager.getTableAxisElementProvider()), DisplayMode.EDIT, configLabel);
+ configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, new SingleUMLReferenceDisplayConverter(), DisplayMode.EDIT, configLabel);
+ }
+
}

Back to the top