Click to See Complete Forum and Search --> : Eclipse Plugin Development Checkboxes and Grid Layout


ECnewbie
July 8th, 2009, 01:05 PM
I am really new to Plugin Development and kinda got tossed in the deep end.
I would appreciate any help.

I have a couple problems.
1. I am trying to add a checkbox group (2 checkboxes in the group) to an existing wizard screen. It is setup like this:

Composite composite = new Composite(parent, SWT.NULL);
composite.setFont(parent.getFont());
composite.setLayout(new GridLayout(3, false));
composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));

There is a Text box in the 1st and 3rd column with 2 bottoms in between. i want my checkbox group to appear below all of this. How do I get this to work? Nothing I have tried seems to make a difference, the checkboxes always end up on the very right-hand side.

2. How do I toggle the functionality of the checkboxes? When one is clicked i want the other to be false or unchecked. I have a listener that implements SelectionListener, but it doesn't seem to have access to the other box that wasn't selected so that I could set it to false. Will I need 2 listeners with each one setting the other's selection state (setSelection(false))?

Thanks for any help, I am so stuck here!

dlorde
July 8th, 2009, 06:28 PM
I don't know Eclipse plug-in development, but if you want a checkbox where only one item is selected at a time, you should be using a radio-button group.

Any programming problem can be solved by adding a level of indirection...
Anon.

ECnewbie
July 9th, 2009, 08:37 AM
Thanks for responding to my message. The radio buttons are making life so much easier! Like I said, I am totally new to all of this, I didn't even realize that the radio buttons would automatically toggle their state.
Thanks so much!