Recipe 9.13 Creating Menu Separators

     

9.13.1 Problem

You want to separate menu items into groups using horizontal lines.

9.13.2 Solution

Create a new menu item that will act as a separator by setting its style to SWT.SEPARATOR .

9.13.3 Discussion

Here's an example that creates a menu separator and adds it to the File menu:

 fileMenuSeparator = new MenuItem(fileMenu, SWT.SEPARATOR); 

9.13.4 See Also

Recipe 9.7 on creating a menu system; Recipe 9.8 on creating text menu items; Recipe 9.9 on creating image menu items; Recipe 9.10 on creating radio menu items; Recipe 9.11 on creating menu item accelerators and mnemonics ; Chapter 8 in Eclipse (O'Reilly).



Eclipse Cookbook
Inside XML (Inside (New Riders))
ISBN: 596007108
EAN: 2147483647
Year: 2006
Pages: 232
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net