Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF Databinding with double values
EMF Databinding with double values [message #1019206] Fri, 15 March 2013 08:38 Go to next message
Bastian Wagenfeld is currently online Bastian WagenfeldFriend
Messages: 163
Registered: January 2013
Senior Member
Hi,

in my RCP I use EMF databinding. In this case an SWT Text should be bind to an field that is a double. Therefore I use:
IObservableValue observeTextObserveWidget = WidgetProperties.text(SWT.FocusOut).observe(text);
		IObservableValue currentSelectionObserveValue = EMFEditObservables.observeValue(editingDomain, currentSelection, Literals.USER__VALUE);
		bindingContext.bindValue(observeTextObserveWidget, currentSelectionObserveValue, null, null);

But this text field doesn't show anything. And if I type in a value, it isn't set in the model.
Do I miss something in the usage of EMF databinding with double values?
The databinding of this double works within a TableViewer and also works with this text field, when I use Bean Databinding.

Best regards
Bastian
Re: EMF Databinding with double values [message #1019338 is a reply to message #1019206] Fri, 15 March 2013 13:28 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
you don't show use the DatabindingContext you create but my guess is
that it is *NOT* an EMFDatabindingContext which is *has to be* to make
conversions work!

Tom

Am 15.03.13 09:38, schrieb Bastian Wagenfeld:
> Hi,
>
> in my RCP I use EMF databinding. In this case an SWT Text should be bind
> to an field that is a double. Therefore I use:
> IObservableValue observeTextObserveWidget =
> WidgetProperties.text(SWT.FocusOut).observe(text);
> IObservableValue currentSelectionObserveValue =
> EMFEditObservables.observeValue(editingDomain, currentSelection,
> Literals.USER__VALUE);
> bindingContext.bindValue(observeTextObserveWidget,
> currentSelectionObserveValue, null, null);
> But this text field doesn't show anything. And if I type in a value, it
> isn't set in the model.
> Do I miss something in the usage of EMF databinding with double values?
> The databinding of this double works within a TableViewer and also works
> with this text field, when I use Bean Databinding.
>
> Best regards
> Bastian
Re: EMF Databinding with double values [message #1020536 is a reply to message #1019338] Mon, 18 March 2013 12:02 Go to previous message
Bastian Wagenfeld is currently online Bastian WagenfeldFriend
Messages: 163
Registered: January 2013
Senior Member
Hi Tom,

that was exactly what happened... that was a very needless mistake. Thank you for your fast answer.

Bastian
Previous Topic:createResource() returns null, what am I missing?
Next Topic:[Teneo] Table name conflict with imported package
Goto Forum:
  


Current Time: Fri Dec 19 14:30:43 GMT 2014

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

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