Radio buttons and Data Binding

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Radio buttons and Data Binding

Postby niklasskeppstedt » Mon Feb 25, 2008 5:38 am

How do you represent state stored in a single property with radio buttons and data binding.

Example: You have a model property called size that can hold two values, big or small.
In the UI you want to represent this with a button group(radios) with two radios, big and small.
Can this be accomplished with data binding and is it supported by Window Builder?
Regards,

Niklas Skeppstedt
niklasskeppstedt
 
Posts: 3
Joined: Mon Feb 04, 2008 6:50 am

Re: Radio buttons and Data Binding

Postby niklasskeppstedt » Wed Feb 27, 2008 1:05 am

Actually it was a really bad example, since the property only holds two values, you would implement a boolean isSmall() or isBig() method. But if you add a new value for the size attribute, say medium my question stands. What is normal implementation for this behaviour, I cant see that it would be a rare case? Please help. Now we have implemented this with listeners on each radio which sets the attribute to correct value, but i hove that there is a nicer way of doing this.

Regards,
Niklas Skeppstedt
niklasskeppstedt
 
Posts: 3
Joined: Mon Feb 04, 2008 6:50 am

Re: Radio buttons and Data Binding

Postby Eric Clayberg » Wed Feb 27, 2008 5:14 am

It doesn't appear that the Eclipse Data Binding API has support for groups of radio buttons.

Whether anyone has come with a creative solution to that problem, I don't know. General questions concerning the Eclipse DB API should be posted to the Eclipse Platform newsgroup.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to SWT Designer

Who is online

Users browsing this forum: No registered users and 2 guests