Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Databinding text to model
Databinding text to model [message #486173] Wed, 16 September 2009 15:27 Go to next message
Eclipse UserFriend
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 #486196 is a reply to message #486173] Wed, 16 September 2009 17:13 Go to previous messageGo to next message
Matthew Hall is currently offline Matthew HallFriend
Messages: 368
Registered: July 2009
Senior Member
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.

> protected void doSetValue(Object source, Object value) {
> doSetStringValue(source, value == null ? "": value.toString());
> }

Would you file a bug for this?

https://bugs.eclipse.org/bugs/enter_bug.cgi?classification=E clipse&product=Platform&component=UI&short_desc=[DataBinding]&version=3.6

Matthew
Re: Databinding text to model [message #486318 is a reply to message #486196] Thu, 17 September 2009 08:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mirko.bernardoni.gmail.com

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.

>> protected void doSetValue(Object source, Object value) {
>> doSetStringValue(source, value == null ? "": value.toString());
>> }

> Would you file a bug for this?

>
https://bugs.eclipse.org/bugs/enter_bug.cgi?classification=E clipse&product=Platform&component=UI&short_desc=[DataBinding]&version=3.6

I have submit a bug for this:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=289700

Best regards,

Mirko B.
> Matthew
Re: Databinding text to model [message #486443 is a reply to message #486318] Thu, 17 September 2009 16:06 Go to previous message
Matthew Hall is currently offline Matthew HallFriend
Messages: 368
Registered: July 2009
Senior Member
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
Previous Topic:checkbox state change (checked-grayed-unchecked) logic in CheckboxTreeviewer
Next Topic:TreeViewer Partial update
Goto Forum:
  


Current Time: Thu Apr 25 22:45:44 GMT 2024

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

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

Back to the top