diff options
author | Christian W. Damus | 2014-09-08 16:31:32 +0000 |
---|---|---|
committer | Christian W. Damus | 2014-09-08 19:13:19 +0000 |
commit | 4cbea3cfe159b0a8908bdd5f22c4bec58bee04d6 (patch) | |
tree | 3a80ae4c1682c7da7d3e46042652ad598b6dd525 /plugins | |
parent | 8665ff856d3289a435bd82df7c856c5db0fac80a (diff) | |
download | org.eclipse.papyrus-4cbea3cfe159b0a8908bdd5f22c4bec58bee04d6.tar.gz org.eclipse.papyrus-4cbea3cfe159b0a8908bdd5f22c4bec58bee04d6.tar.xz org.eclipse.papyrus-4cbea3cfe159b0a8908bdd5f22c4bec58bee04d6.zip |
443497: [Properties View] When editing a single reference from a Properties View dialog, pressing cancel unsets the current value
https://bugs.eclipse.org/bugs/show_bug.cgi?id=443497
Correct the handling of null return from the ReferenceValueFactory, not using it to unset the reference.
Change-Id: Ia8100c71482e021a834f12fda79ca0eee2429f9b
Diffstat (limited to 'plugins')
2 files changed, 10 insertions, 1 deletions
diff --git a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/ReferenceDialog.java b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/ReferenceDialog.java index 8f36b7985a7..1103051c9dc 100644 --- a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/ReferenceDialog.java +++ b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/ReferenceDialog.java @@ -10,6 +10,7 @@ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Thibault Le Ouay t.leouay@sherpa-eng.com - Add binding implementation
* Christian W. Damus (CEA) - bug 402525
+ * Christian W. Damus (CEA) - bug 443497
*
*****************************************************************************/
package org.eclipse.papyrus.infra.widgets.editors;
@@ -276,9 +277,13 @@ public class ReferenceDialog extends AbstractValueEditor implements SelectionLis @Override
public void run() {
Object newValue = valueFactory.edit(editInstanceButton, currentValue);
- if (newValue != currentValue) {
+
+ // Per the contract of ReferenceValueFactory::edit(), a null return means the object was edited "in place."
+ // In that case, there is nothing further to do
+ if ((newValue != null) && (newValue != currentValue)) {
setValue(newValue);
}
+
updateLabel();
}
}, NLS.bind(Messages.ReferenceDialog_editOperation, labelText));
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/creation/EcorePropertyEditorFactory.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/creation/EcorePropertyEditorFactory.java index 39adb30f9ba..730c42263b6 100644 --- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/creation/EcorePropertyEditorFactory.java +++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/creation/EcorePropertyEditorFactory.java @@ -10,6 +10,7 @@ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
* Christian W. Damus (CEA) - bug 402525
* Christian W. Damus (CEA) - bug 430077
+ * Christian W. Damus (CEA) - bug 443497
*
*****************************************************************************/
package org.eclipse.papyrus.views.properties.creation;
@@ -244,6 +245,9 @@ public class EcorePropertyEditorFactory extends PropertyEditorFactory { // Propagate to the caller if not in a nested edit dialog
throw e;
}
+
+ // Let the client think that there's nothing needing to be done, that the referenced object
+ // was edited "in place" instead of being replaced by some other object
result = null;
}
|