Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael ADAM2017-01-06 15:05:52 +0000
committerGerrit Code Review @ Eclipse.org2017-01-19 14:14:22 +0000
commitd72ee4c103fd6967eafe347ceb5711653dc1c936 (patch)
treeaf12b5b89861ad7710a31e20a1c2d207cda64005
parent8aa6e885a1c748556f2c024e8b14af522a0f8f77 (diff)
downloadorg.eclipse.papyrus-d72ee4c103fd6967eafe347ceb5711653dc1c936.tar.gz
org.eclipse.papyrus-d72ee4c103fd6967eafe347ceb5711653dc1c936.tar.xz
org.eclipse.papyrus-d72ee4c103fd6967eafe347ceb5711653dc1c936.zip
Bug 508278 - SWTException below CLabelObservableValue.doSetValue (thrown
in Widget.checkWidget) https://bugs.eclipse.org/bugs/show_bug.cgi?id=508278 - Add if test on label before set. Change-Id: Ic8f7fe999d092edaebc9d35fcbaf29b235d7d5c7 Signed-off-by: Mickael ADAM <mickael.adam@ALL4TEC.net>
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/CLabelObservableValue.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/CLabelObservableValue.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/CLabelObservableValue.java
index c653eedd906..1a06bfbe460 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/CLabelObservableValue.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/CLabelObservableValue.java
@@ -107,15 +107,17 @@ public class CLabelObservableValue extends AbstractObservableValue {
@Override
protected void doSetValue(Object value) {
this.currentValue = value;
- if (aggregated != null && aggregated.hasDifferentValues()) {
- label.setText(Messages.ReferenceDialogObservable_Unchanged);
- label.setImage(null);
- } else if (currentValue == null) {
- label.setText(Messages.ReferenceDialog_Unset);
- label.setImage(null);
- } else {
- label.setText(labelProvider.getText(value));
- label.setImage(labelProvider.getImage(value));
+ if (null != label && !label.isDisposed()) {
+ if (aggregated != null && aggregated.hasDifferentValues()) {
+ label.setText(Messages.ReferenceDialogObservable_Unchanged);
+ label.setImage(null);
+ } else if (currentValue == null) {
+ label.setText(Messages.ReferenceDialog_Unset);
+ label.setImage(null);
+ } else {
+ label.setText(labelProvider.getText(value));
+ label.setImage(labelProvider.getImage(value));
+ }
}
}
}

Back to the top