diff options
author | Vincent Lorenzo | 2019-03-14 12:39:59 +0000 |
---|---|---|
committer | vincent lorenzo | 2019-03-14 12:46:33 +0000 |
commit | 9be1d47984e9aa9da4d7e0cf86a48c43eaeda9a1 (patch) | |
tree | 839b806d945f1d3e6a3bb419abc519948163b476 /plugins | |
parent | ee8c3e63f158ca17f0d6e7bc6a773bece8c2874a (diff) | |
download | org.eclipse.papyrus-9be1d47984e9aa9da4d7e0cf86a48c43eaeda9a1.tar.gz org.eclipse.papyrus-9be1d47984e9aa9da4d7e0cf86a48c43eaeda9a1.tar.xz org.eclipse.papyrus-9be1d47984e9aa9da4d7e0cf86a48c43eaeda9a1.zip |
Bug 545401: [Table] Cell representing a property of stereotype typed with a single reference are not editable
Change-Id: I20a9b66b7e4698223cf40798464c23b50acd2fed
Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
Diffstat (limited to 'plugins')
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); + } + } |