Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsBinding a set of radio buttons to an int property
https://www.eclipse.org/forums/index.php/mv/msg/157633/497090/#msg_497090
I am trying to bind a set of radio buttons to an int property. Is there a short way of doing that? Every solution I have found on the Web was quite long.
Damien
]]>Damien Mising name2009-11-12T13:50:36-00:00Re: Binding a set of radio buttons to an int property
https://www.eclipse.org/forums/index.php/mv/msg/157633/497146/#msg_497146
> Hello everybody,
>
> I am trying to bind a set of radio buttons to an int property. Is there
> a short way of doing that? Every solution I have found on the Web was
> quite long.
>
> Damien
RadioGroup is a good fit for this, although I have not written any
databinding properties for that widget yet. If you will file a bugzilla
I can get that done within a day or two.
Otherwise you can use SelectObservableValue:
SelectObservableValue select = new SelectObservableValue(int.class);
IValueProperty selectionProp = WidgetProperties.selection();
for (int i = 0; i < buttons.length; i++)
select.addOption(
Integer.valueOf(i),
selectionProp.observe(buttons[i]) );
Matthew]]>Matthew Hall2009-11-12T16:03:30-00:00Re: Binding a set of radio buttons to an int property
https://www.eclipse.org/forums/index.php/mv/msg/157633/497155/#msg_497155
Damien]]>Damien Mising name2009-11-12T17:24:04-00:00