Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Neon: UpdateStrategy logs ERROR when binding Double to Text
Neon: UpdateStrategy logs ERROR when binding Double to Text [message #1739057] Wed, 27 July 2016 09:14 Go to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 189
Registered: July 2009
Senior Member
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 09:39 Go to previous message
Martin Jacob is currently offline Martin JacobFriend
Messages: 189
Registered: July 2009
Senior Member
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
Previous Topic:Additional Namespaces when saving an XMLResource
Next Topic:Improve XMLResourceImpl's URI Fragments upon serialization
Goto Forum:
  


Current Time: Tue Jun 22 14:36:38 GMT 2021

Powered by FUDForum. Page generated in 0.01767 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top