Databinding text to model [message #486173] |
Wed, 16 September 2009 11:27  |
Eclipse User |
|
|
|
Originally posted by: mirko.bernardoni.gmail.com
Hi,
I have converted a rcp application from eclipse 3.4 to eclipse 3.5.
In my application I bind some text widget to model object. My model's
object aren't of type String.
When the class ValueBinding set the converted value to text widget, I have
an Exception.
The reason is class WidgetStringValueProperty, method:
protected void doSetValue(Object source, Object value) {
doSetStringValue(source, (String) value);
}
It's possibile to change to
protected void doSetValue(Object source, Object value) {
doSetStringValue(source, value == null ? "": value.toString());
}
Or exists another solution?
|
|
|
|
|
Re: Databinding text to model [message #486443 is a reply to message #486318] |
Thu, 17 September 2009 12:06  |
Eclipse User |
|
|
|
Mirko B. wrote:
> Matthew Hall wrote:
>
>> Mirko B. wrote:
>>> Hi,
>>> I have converted a rcp application from eclipse 3.4 to eclipse 3.5.
>>> In my application I bind some text widget to model object. My model's
>>> object aren't of type String.
>>> When the class ValueBinding set the converted value to text widget, I
>>> have an Exception.
>
>> Are you setting an explicit converter? Typically UpdateValueStrategy
>> will provide an object-to-string converter automatically for you if
>> you do not set a converter yourself.
>
> Yes, I have setting an explicit converter.
This being the case, your converter should be returning a String instead
of some other Object.
Matthew
|
|
|
Powered by
FUDForum. Page generated in 0.17449 seconds