Skip to Main Content
Eclipse Cookbook
book

Eclipse Cookbook

by Steve Holzner
June 2004
Beginner to intermediate content levelBeginner to intermediate
364 pages
7h 38m
English
O'Reilly Media, Inc.
Content preview from Eclipse Cookbook

9.13. Creating Menu Separators

Problem

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

Solution

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

Discussion

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

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

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).

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Eclipse

Eclipse

Steve Holzner
Official Eclipse 3.0 FAQs

Official Eclipse 3.0 FAQs

John Arthorne, Chris Laffra

Publisher Resources

Supplemental ContentCatalog PageErrata