Neon: UpdateStrategy logs ERROR when binding Double to Text [message #1739057] |
Wed, 27 July 2016 05:14  |
Eclipse User |
|
|
|
Hi,
since update to NEON I found a new behaviour of the UpdateStrategy which
results in an ERROR entry into the log file.
I am binding a property from an EMF model class to a swt Text. During
the binding the conversion from an empty string causes an exception.
This was also the case prior to Neon. But since Neon the
org.eclipse.databinding.UpdateStrategy::convert catches the Exception
and writes it to the log file.
It seams the default implementation of EMFUpdateValueStrategy() does not
handle well the conversion from an Empty String to e.g. Double.
IObservableValue observeTextTextObserveWidget =
WidgetProperties.text(SWT.Modify).observeDelayed(400, text);
IObservableValue gearTypeRatioObserveValue =
EMFEditProperties.value(editingDomain,
Literals.GEAR_TYPE__RATIO).observe(gearType);
UpdateValueStrategy stratagy = new EMFUpdateValueStrategy();
Binding bindValue =
bindingContext.bindValue(observeTextTextObserveWidget,
gearTypeRatioObserveValue, stratagy, null);
Does any one have a solution to avoid this ERROR log entry?
I am also confused why first the update goes from the Text to the model.
I would expect to have first the update from the model to the Text. May
I did some thing wrong in general?
Any hints are appreciated, Martin
|
|
|
Re: Neon: UpdateStrategy logs ERROR when binding Double to Text [message #1739064 is a reply to message #1739057] |
Wed, 27 July 2016 05:39  |
Eclipse User |
|
|
|
Hi,
it was my mistake, the observed EMF model object (gearType) was null......
Thanks to the log entry I found my mistake ;) .
sorry to bother, Martin
Am 27.07.2016 um 11:14 schrieb Martin Jacob:
> Hi,
>
> since update to NEON I found a new behaviour of the UpdateStrategy which
> results in an ERROR entry into the log file.
>
> I am binding a property from an EMF model class to a swt Text. During
> the binding the conversion from an empty string causes an exception.
> This was also the case prior to Neon. But since Neon the
> org.eclipse.databinding.UpdateStrategy::convert catches the Exception
> and writes it to the log file.
>
> It seams the default implementation of EMFUpdateValueStrategy() does not
> handle well the conversion from an Empty String to e.g. Double.
>
>
> IObservableValue observeTextTextObserveWidget =
> WidgetProperties.text(SWT.Modify).observeDelayed(400, text);
> IObservableValue gearTypeRatioObserveValue =
> EMFEditProperties.value(editingDomain,
> Literals.GEAR_TYPE__RATIO).observe(gearType);
> UpdateValueStrategy stratagy = new EMFUpdateValueStrategy();
> Binding bindValue =
> bindingContext.bindValue(observeTextTextObserveWidget,
> gearTypeRatioObserveValue, stratagy, null);
>
>
> Does any one have a solution to avoid this ERROR log entry?
>
> I am also confused why first the update goes from the Text to the model.
> I would expect to have first the update from the model to the Text. May
> I did some thing wrong in general?
>
> Any hints are appreciated, Martin
|
|
|
Powered by
FUDForum. Page generated in 0.05851 seconds