Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/nattable/org.eclipse.papyrus.uml.nattable')
-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/SingleUMLReferenceCellEditorConfiguration.java7
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/config/UMLStereotypeSingleUMLReferenceCellEditorConfiguration.java5
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/cell/StereotypePropertyCellManager.java22
5 files changed, 28 insertions, 10 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 f67e788cae2..896ecca5f47 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.100.qualifier
+Bundle-Version: 5.2.200.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 7c3f2fd7938..5f56d6e11cf 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.100-SNAPSHOT</version>
+ <version>5.2.200-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/SingleUMLReferenceCellEditorConfiguration.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/config/SingleUMLReferenceCellEditorConfiguration.java
index 09cc8f8ab2b..0b430520522 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/config/SingleUMLReferenceCellEditorConfiguration.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/config/SingleUMLReferenceCellEditorConfiguration.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2015, 2017 CEA LIST and others.
+ * Copyright (c) 2015, 2017, 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
@@ -11,6 +11,7 @@
* Contributors:
* Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Initial API and implementation
* Thanh Liem PHAN (ALL4TEC) thanhliem.phan@all4tec.net - Bug 517374
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Bug 545575
*****************************************************************************/
package org.eclipse.papyrus.uml.nattable.config;
@@ -20,7 +21,6 @@ import org.eclipse.emf.ecore.EStructuralFeature;
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.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.nattable.celleditor.config.ICellAxisConfiguration;
@@ -28,6 +28,7 @@ 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.config.utils.CellEditorConfigurationUtils;
import org.eclipse.papyrus.uml.nattable.converter.SingleUMLReferenceDisplayConverter;
import org.eclipse.papyrus.uml.nattable.editor.SingleReferenceValueCellEditor;
import org.eclipse.uml2.uml.UMLPackage;
@@ -89,7 +90,7 @@ public class SingleUMLReferenceCellEditorConfiguration implements ICellAxisConfi
*/
@Override
public void configureCellEditor(final IConfigRegistry configRegistry, final Object axis, final String configLabel) {
- configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, new TextPainter(), DisplayMode.NORMAL, configLabel);
+ CellEditorConfigurationUtils.configureCellPainter(configRegistry, axis, configLabel);
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(axis, modelManager.getTableAxisElementProvider()), DisplayMode.EDIT, configLabel);
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 38dfba8220e..42e06791003 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
@@ -11,6 +11,7 @@
* Contributors:
* Vincent LORENZO (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
* Vincent LORENZO (CEA LIST) vincent.lorenzo@cea.fr - Bug 545401
+ * Vincent LORENZO (CEA LIST) vincent.lorenzo@cea.fr - Bug 545575
*****************************************************************************/
package org.eclipse.papyrus.uml.nattable.config;
@@ -18,12 +19,12 @@ 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.config.utils.CellEditorConfigurationUtils;
import org.eclipse.papyrus.uml.nattable.converter.SingleUMLReferenceDisplayConverter;
import org.eclipse.papyrus.uml.nattable.editor.SingleReferenceValueCellEditor;
import org.eclipse.papyrus.uml.nattable.utils.UMLTableUtils;
@@ -81,7 +82,7 @@ public class UMLStereotypeSingleUMLReferenceCellEditorConfiguration extends Sing
*/
@Override
public void configureCellEditor(final IConfigRegistry configRegistry, final Object axis, final String configLabel) {
- configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, new TextPainter(), DisplayMode.NORMAL, configLabel);
+ CellEditorConfigurationUtils.configureCellPainter(configRegistry, axis, 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);
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/cell/StereotypePropertyCellManager.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/cell/StereotypePropertyCellManager.java
index f82f30fcb26..117aa7148b7 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/cell/StereotypePropertyCellManager.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/cell/StereotypePropertyCellManager.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2012, 2017 CEA LIST and others.
+ * Copyright (c) 2012, 2017, 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
@@ -12,6 +12,7 @@
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - bug 402525
* Thanh Liem PHAN (ALL4TEC) thanhliem.phan@all4tec.net - Bug 515806
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Bug 545575
*****************************************************************************/
package org.eclipse.papyrus.uml.nattable.manager.cell;
@@ -21,6 +22,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.emf.common.command.Command;
@@ -34,6 +36,7 @@ import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
import org.eclipse.osgi.util.NLS;
import org.eclipse.papyrus.infra.emf.gmf.command.EMFtoGMFCommandWrapper;
import org.eclipse.papyrus.infra.emf.gmf.command.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.nattable.manager.cell.CellManagerFactory;
import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
import org.eclipse.papyrus.infra.nattable.paste.PastePostActionRegistry;
import org.eclipse.papyrus.infra.nattable.utils.AxisUtils;
@@ -281,6 +284,16 @@ public class StereotypePropertyCellManager extends UMLFeatureCellManager {
// Don't apply the stereotype if there's no value to set.
return null;
}
+
+ //Clone the converter, because it will be disposed too early for this usecase
+ Object tmpConverted = null;
+ try {
+ tmpConverted = valueSolver.clone();
+ } catch (CloneNotSupportedException e) {
+ Activator.log.error(e);
+ }
+ Assert.isNotNull(tmpConverted, "The value converter is null");//$NON-NLS-1$
+ final AbstractStringValueConverter clonedConverter = (AbstractStringValueConverter) tmpConverted;
// Must first apply the stereotype
return new RecordingCommand(domain, "Set Value") { //$NON-NLS-1$
@@ -288,8 +301,9 @@ public class StereotypePropertyCellManager extends UMLFeatureCellManager {
protected void doExecute() {
// This may apply the required stereotype if needed
applyRequiredStereotype(domain, el, id);
- // Now recursively execute the set-string-value command
- Command command = getSetStringValueCommand(domain, columnElement, rowElement, newValue, valueSolver, tableManager);
+
+ // we need to call the CellManagerFactory to get the StringResolutionProblemWrapperCellManager when required
+ Command command = CellManagerFactory.INSTANCE.getSetStringValueCommand(domain, columnElement, rowElement, newValue, clonedConverter, tableManager);
if (command != null) {
if (!command.canExecute()) {
throw new OperationCanceledException();
@@ -299,6 +313,8 @@ public class StereotypePropertyCellManager extends UMLFeatureCellManager {
} else {
// A null command is not an error, it just means there's nothing to set because the value is already correct.
}
+ //we dispose the cloned converter
+ clonedConverter.dispose();
}
};
}

Back to the top