Unfortunately, you need to iterate over all parameters. The first time your user interface appears, the BN_CLICKED event BN_CLICKED . If your Shell or Group or any switch container is not created using the SWT.NO_RADIO_GROUP option, the following method is called:
void selectRadio () { Control [] children = parent._getChildren (); for (int i=0; i<children.length; i++) { Control child = children [i]; if (this != child) child.setRadioSelection (false); } setSelection (true); }
Thus, the eclipse itself depends on the iteration of all the switches and their state switching.
Each time you manually select a radio button, the BN_CLICKED event BN_CLICKED and, therefore, automatic switching.
When you use button.setSelection(boolean) then the BN_CLICKED event is not BN_CLICKED . Therefore, automatic switching of the switches does not occur.
Read more in the org.eclipse.swt.widgets.Button class.
Favonius
source share