Results 1 to 4 of 4

Thread: Radio Buttons

  1. #1
    Join Date
    Apr 2006
    Location
    Joinville, Brazil
    Posts
    12

    Default Radio Buttons

    I have tried to find something about radio buttons, but it seems that currently RCP doesn't provide this.

    Is it true?

    If it is, can anyone give me some guidelines how to write one?

    Thanks in advance!

    Charles

  2. #2
    Join Date
    Jul 2005
    Location
    Austria
    Posts
    105

    Default

    You are right, radio buttons are not supported by the Rich Client at present. Central point for components are the ComponentFactory. CheckBox are already supported.

    At present I create JRadioButtons on the usual way, or receive it from my own factory. The radio buttons are then added to the TableFormBuilder.

    greetings

  3. #3
    Join Date
    Apr 2006
    Location
    Joinville, Brazil
    Posts
    12

    Default And about binding

    Thanks for the quick reply Demo!

    Ok, but how could I put the JRadioButton in the form using the binding?

    You mentioned your own factory. Could you show me some code?

    I'm starting using the framework and I think it is great, but I still don't known the inner details.

    Thanks!

    Charles

  4. #4
    Join Date
    Jul 2005
    Location
    Austria
    Posts
    105

    Default

    I've forgotten to say, that I use my JRadioButtons in a view, where the user can select between three options. Here is a snipped:
    Code:
    public class BookingView extends AbstractView{
        private JRadioButton rdbIdSearch = new JRadioButton();
        private JRadioButton rdbMultiSearch = new JRadioButton();
        private JRadioButton rdbDateSearch = new JRadioButton();
       ...
    These buttons are then added to a button group, to ensure that only one button can be active. As I don't use binding for this radio buttons I can use the TableLayoutBuilder:
    Code:
    TableLayoutBuilder b = new TableLayoutBuilder();
    b.cell(rdbIdSearch);
    b.cell(rdbMultiSearch);
    b.cell(rdbDateSearch);
    //some more work
    b.getPanel(); //Returns a JPanel with the buttons
    With component I mean, that I receive a predefined radio button with a configured design, like:
    Code:
    rdbDateSearch = myFactory.createRadioButton();
    Until now I've not used JRadioButtons for binding properties, because I prefer ComboBox instead of radio buttons. If you will offer your user a choice of different values a combo box is a good choice.

    But it will be an interesting feature to create a generic option group for a given collection.

    hope this helps a little bit
    markus

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •