Button b = (Button) e.widget; GridData data = (GridData) bHidden.getLayoutData(); data.exclude = b.getSelection(); bHidden.setVisible(!data.exclude); shell.layout(false);
Set<String> Groups = getData(Contents); final List<Button> buttons = new ArrayList<Button>(); for(String group : contentGroups) { Button newButton = new Button(fComposite, SWT.CHECK); newButton.setText(group); // save the button buttons.add(newButton); } Button okButton = new Button(lowComposite, SWT.PUSH); okButton.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event e) { // iterate over saved buttons for(Button button : buttons) { System.out.println(button.getText() + ": " + button.getSelection()); } } }
checkValue = checkButton.getSelection(); close();
@Override public void focusGained(FocusEvent e) { final boolean selection1 = radioButton1.getSelection(); final boolean selection2 = radioButton2.getSelection(); radioButton1.setFocus(); radioButton1.setSelection(selection1);
public void run() if(runButton.getSelection()) return; public void handleEvent(Event arg0) if(!runButton.getSelection()) display.timerExec(1000, run);
public void handleEvent(Event arg0) b.setEnabled(!a.getSelection());
} else if ((!ans4NoBtn.getSelection() && !ans4YesBtn.getSelection()) || (!ans5NoBtn.getSelection() && !ans5YesBtn.getSelection())) { MessageDialog.openWarning(shell, "Warning", "Please answer all questions."); } else if (!isNumeric(ans1txt.getText()) || !isNumeric(ans2txt.getText()) || !isNumeric(ans3txt.getText())) {
case SWT.Selection: final boolean selection = (boolean) button.getData("selection"); if (selection != button.getSelection()) { button.setSelection(selection);
public void widgetSelected(SelectionEvent event) button.setEnabled(!cb.getSelection()); if (button.isEnabled()) button.setImage(image1);
final boolean asc = source.getSelection();
@Override public void widgetSelected(SelectionEvent arg0) { boolean chkRpmFilter = buttonA.getSelection(); buttonB.setEnabled(!chkRpmFilter); System.out.println("Button A clicked state is " + chkRpmFilter); @Override public void widgetSelected(SelectionEvent arg0) { boolean sWinddirections = buttonB.getSelection(); buttonA.setEnabled(!sWinddirections); System.out.println("Button B clicked state is "