packagedev.equo;importorg.eclipse.swt.SWT;importorg.eclipse.swt.graphics.Rectangle;importorg.eclipse.swt.layout.FillLayout;importorg.eclipse.swt.widgets.Display;importorg.eclipse.swt.widgets.Shell;importorg.eclipse.swt.widgets.ToolBar;importorg.eclipse.swt.widgets.ToolItem;/** * Demonstrates the basic usage of ToolBar widget in SWT. * This example creates a simple toolbar with 8 push-style tool items. */publicclassToolBarSnippet{publicstaticvoidmain(String[]args){Displaydisplay=newDisplay();Shellshell=newShell(display);shell.setLayout(newFillLayout());shell.setText("ToolBarSnippet");shell.setSize(450,64);ToolBarbar=newToolBar(shell,SWT.BORDER);for(inti=0;i<8;i++){ToolItemitem=newToolItem(bar,SWT.PUSH);item.setText("Item "+i);}shell.open();while(!shell.isDisposed()){if(!display.readAndDispatch())display.sleep();}display.dispose();}}