diff options
author | Christian W. Damus | 2014-02-14 12:44:53 +0000 |
---|---|---|
committer | Christian W. Damus | 2014-02-14 12:44:53 +0000 |
commit | 2deb3d461ab42c1770909276362ad2c24c8d2e13 (patch) | |
tree | b81359461774d31f8572aa3d1acc866e1aec4a06 /plugins | |
parent | bf2d15d3c0ae4f0f42d8589d9da7a3a321109a12 (diff) | |
download | org.eclipse.papyrus-2deb3d461ab42c1770909276362ad2c24c8d2e13.tar.gz org.eclipse.papyrus-2deb3d461ab42c1770909276362ad2c24c8d2e13.tar.xz org.eclipse.papyrus-2deb3d461ab42c1770909276362ad2c24c8d2e13.zip |
402525: [Widgets / Transactions] Papyrus dialogs should be transactional
https://bugs.eclipse.org/bugs/show_bug.cgi?id=402525
Fix determination of context element from AbstractValueEditor's observable.
Diffstat (limited to 'plugins')
2 files changed, 6 insertions, 1 deletions
diff --git a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/AbstractListEditor.java b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/AbstractListEditor.java index be85ee8dc6c..857a0d72062 100644 --- a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/AbstractListEditor.java +++ b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/AbstractListEditor.java @@ -147,6 +147,8 @@ public abstract class AbstractListEditor extends AbstractEditor { }
protected Object getContextElement() {
+ // Our observables for features of EMF objects are expected to implement IObserving because
+ // the observe the value of the object's feature
return (modelProperty instanceof IObserving) ? ((IObserving)modelProperty).getObserved() : null;
}
}
diff --git a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/AbstractValueEditor.java b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/AbstractValueEditor.java index 1f1315796a6..150eb611907 100644 --- a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/AbstractValueEditor.java +++ b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/AbstractValueEditor.java @@ -17,6 +17,7 @@ import org.eclipse.core.databinding.UpdateValueStrategy; import org.eclipse.core.databinding.conversion.IConverter;
import org.eclipse.core.databinding.observable.ChangeEvent;
import org.eclipse.core.databinding.observable.IChangeListener;
+import org.eclipse.core.databinding.observable.IObserving;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.swt.widgets.Composite;
@@ -177,6 +178,8 @@ public abstract class AbstractValueEditor extends AbstractEditor { @Override
protected Object getContextElement() {
- return (modelProperty != null) ? modelProperty.getValue() : getValue();
+ // Our observables for features of EMF objects are expected to implement IObserving because
+ // the observe the value of the object's feature
+ return (modelProperty instanceof IObserving) ? ((IObserving)modelProperty).getObserved() : null;
}
}
|