How to add menus with SWT Designer?

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

How to add menus with SWT Designer?

Postby P38 » Thu Mar 10, 2011 11:31 am

We have a JFace ApplicationWindow in a standalone SWT/JFace app designed with SWT Designer.

We have a top level menu that appears OK. It is generated by this code:

Code: Select all
   protected MenuManager createMenuManager() {
      MenuManager topLevelMenuManager = new MenuManager();

      MenuManager fileMenu = new MenuManager("&File");

      MenuManager editMenu = new MenuManager("&Edit");

      MenuManager helpMenu = new MenuManager("&Help");

      return topLevelMenuManager;

How do we add menu items to this?
Posts: 8
Joined: Wed Feb 09, 2011 11:35 am

Re: How to add menus with SWT Designer?

Postby Eric Clayberg » Thu Mar 10, 2011 12:14 pm

All menus in a JFace App Windows are Actions, so use the JFace Actions palette. This is described in the docs...

Eric Clayberg
Software Engineering Manager

Author: "Eclipse Plug-ins"
Eric Clayberg
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Return to SWT Designer

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest