Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2014-09-08 16:31:32 +0000
committerChristian W. Damus2014-09-08 19:13:19 +0000
commit4cbea3cfe159b0a8908bdd5f22c4bec58bee04d6 (patch)
tree3a80ae4c1682c7da7d3e46042652ad598b6dd525 /plugins/infra
parent8665ff856d3289a435bd82df7c856c5db0fac80a (diff)
downloadorg.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/infra')
-rw-r--r--plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/ReferenceDialog.java7
1 files changed, 6 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));

Back to the top