packagedev.equo;importorg.eclipse.swt.SWT;importorg.eclipse.swt.layout.RowLayout;importorg.eclipse.swt.widgets.*;import staticorg.eclipse.swt.events.SelectionListener.widgetSelectedAdapter;/** * Demonstrates different types of SWT buttons including push, toggle, and check buttons. * This example creates a shell with three different button types arranged vertically: * - Push button: Standard clickable button * - Toggle button: Button that maintains pressed/unpressed state * - Check button: Checkbox with text label * Each button prints a message to the console when clicked. */publicclassButtonSnippet{publicstaticvoidmain(String[]args){Displaydisplay=newDisplay();Shellshell=newShell(display);shell.setText("ButtonSnippet");ButtonpushButton=newButton(shell,SWT.PUSH);pushButton.setText("This is a push button");pushButton.addSelectionListener(widgetSelectedAdapter(e->System.out.println("Push button clicked")));ButtontoggleButton=newButton(shell,SWT.TOGGLE);toggleButton.setText("This is a toggle button");toggleButton.addSelectionListener(widgetSelectedAdapter(e->System.out.println("Toggle button clicked")));ButtoncheckButton=newButton(shell,SWT.CHECK);checkButton.setText("This is a check button");checkButton.addSelectionListener(widgetSelectedAdapter(e->System.out.println("Check button clicked")));shell.setLayout(newRowLayout(SWT.VERTICAL));shell.setSize(250,150);shell.open();while(!shell.isDisposed()){if(!display.readAndDispatch())display.sleep();}display.dispose();}}