From 18800c23e6f91d8f56db694b4ac743ab7de28e43 Mon Sep 17 00:00:00 2001 From: Nicolas FAUVERGUE Date: Fri, 8 Jul 2016 09:40:12 +0200 Subject: Bug 456841: [Table 2] Copy/paste from Excel in "attached mode" can fail for cells corresponding to stereotype property typed by an Enum https://bugs.eclipse.org/bugs/show_bug.cgi?id=456841 It was not need to check if the stereotype was already applied and throw exception in this case. We ust have to aply stereotype if this is not the case, and do nothing otherwise. Change-Id: I3510f1d020225ce5a185cf6b1e29ebe09957df3c Signed-off-by: Nicolas FAUVERGUE --- .../cell/StereotypePropertyCellManager.java | 36 ++++++++++------------ 1 file changed, 16 insertions(+), 20 deletions(-) (limited to 'plugins/uml/nattable') 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 da45c521858..5aa07900270 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 @@ -227,16 +227,14 @@ public class StereotypePropertyCellManager extends UMLFeatureCellManager { @Override protected void doExecute() { - if (!applyRequiredStereotype(domain, el, id)) { + // This may apply the required stereotype if needed + applyRequiredStereotype(domain, el, id); + // Now recursively execute the set-string-value command + Command command = getSetValueCommand(domain, columnElement, rowElement, newValue, tableManager); + if (command == null || !command.canExecute()) { throw new OperationCanceledException(); } else { - // Now recursively execute the set-string-value command - Command command = getSetValueCommand(domain, columnElement, rowElement, newValue, tableManager); - if (command == null || !command.canExecute()) { - throw new OperationCanceledException(); - } else { - domain.getCommandStack().execute(command); - } + domain.getCommandStack().execute(command); } } }; @@ -285,20 +283,18 @@ public class StereotypePropertyCellManager extends UMLFeatureCellManager { @Override protected void doExecute() { - if (!applyRequiredStereotype(domain, el, id)) { - throw new OperationCanceledException(); - } else { - // Now recursively execute the set-string-value command - Command command = getSetStringValueCommand(domain, columnElement, rowElement, newValue, valueSolver, tableManager); - if (command != null) { - if (!command.canExecute()) { - throw new OperationCanceledException(); - } else { - domain.getCommandStack().execute(command); - } + // 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); + if (command != null) { + if (!command.canExecute()) { + throw new OperationCanceledException(); } else { - // A null command is not an error, it just means there's nothing to set because the value is already correct. + domain.getCommandStack().execute(command); } + } else { + // A null command is not an error, it just means there's nothing to set because the value is already correct. } } }; -- cgit v1.2.3