Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbblajer2007-04-04 17:06:10 +0000
committerbblajer2007-04-04 17:06:10 +0000
commit77fab23ec529e256bea62879f08c71acfedfbaa6 (patch)
tree8925fee7e6cb600b0b6c9024228f513717e3e317 /plugins/org.eclipse.gmf.runtime.lite/src/org
parent54dbfe6482a7c873fbfdacf4907a770304c94bd3 (diff)
downloadorg.eclipse.gmf-tooling-77fab23ec529e256bea62879f08c71acfedfbaa6.tar.gz
org.eclipse.gmf-tooling-77fab23ec529e256bea62879f08c71acfedfbaa6.tar.xz
org.eclipse.gmf-tooling-77fab23ec529e256bea62879f08c71acfedfbaa6.zip
[180967]: Change of a multi-valued property via property sheet should be undone correctly
Diffstat (limited to 'plugins/org.eclipse.gmf.runtime.lite/src/org')
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/ResetValueCommand.java7
-rw-r--r--plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/SetValueCommand.java7
2 files changed, 14 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/ResetValueCommand.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/ResetValueCommand.java
index 6e1436746..99095924c 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/ResetValueCommand.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/ResetValueCommand.java
@@ -11,6 +11,8 @@
*/
package org.eclipse.gmf.runtime.lite.properties;
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.gef.commands.Command;
import org.eclipse.ui.views.properties.IPropertySource;
@@ -61,6 +63,11 @@ class ResetValueCommand extends Command {
undoValue = ((IPropertySource) undoValue).getEditableValue();
} else if (undoValue instanceof IItemPropertySource) {
undoValue = ((IItemPropertySource) undoValue).getEditableValue(propertyName);
+ if (undoValue instanceof EList) {
+ EList theValue = new BasicEList();
+ theValue.addAll((EList) undoValue);
+ undoValue = theValue;
+ }
}
redo();
}
diff --git a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/SetValueCommand.java b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/SetValueCommand.java
index 3831e2b0d..49f7c9f36 100644
--- a/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/SetValueCommand.java
+++ b/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/properties/SetValueCommand.java
@@ -13,6 +13,8 @@ package org.eclipse.gmf.runtime.lite.properties;
import java.text.MessageFormat;
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.gef.commands.Command;
import org.eclipse.ui.views.properties.IPropertySource;
@@ -56,6 +58,11 @@ class SetValueCommand extends Command {
undoValue = ((IPropertySource) undoValue).getEditableValue();
} else if (undoValue instanceof IItemPropertySource) {
undoValue = ((IItemPropertySource) undoValue).getEditableValue(propertyName);
+ if (undoValue instanceof EList) {
+ EList theValue = new BasicEList();
+ theValue.addAll((EList) undoValue);
+ undoValue = theValue;
+ }
}
if (propertyValue instanceof IPropertySource) {
propertyValue = ((IPropertySource) propertyValue).getEditableValue();

Back to the top