Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » File->New menu contributions
File->New menu contributions [message #467579] Tue, 08 May 2007 07:30 Go to next message
Eclipse UserFriend
Originally posted by: torbjorn.ghostwriter.no

Hi, I'm using the common navigator in my RCP application, and I have two
questions:
1. How can I make the New submenu appear under the file menu in the main
menu bar?

2. How can I add my own actions to the New submenu?

- Torbj
Re: File->New menu contributions [message #467590 is a reply to message #467579] Tue, 08 May 2007 13:32 Go to previous message
Paul E. Keyser is currently offline Paul E. KeyserFriend
Messages: 878
Registered: July 2009
Senior Member
My answer applies to an RCP, but I have not used the common nav., which may perhaps change things.

1) in your app's ActionBarAdvisor, method fillCoolBar(), include this code:
final IWorkbenchWindow window =
getActionBarConfigurer().getWindowConfigurer().getWindow();
register(ActionFactory.NEW_WIZARD_DROP_DOWN.create(window));
coolBar.add(getAction(ActionFactory.NEW_WIZARD_DROP_DOWN.get Id()));

and when you are creating your file-menu, in method fillMenuBar(), supply this code:
final String newId = ActionFactory.NEW.getId();
final MenuManager newMenu = new MenuManager("New...", newId);
newMenu.add(new Separator(newId));
final IContributionItem newWizards =
ContributionItemFactory.NEW_WIZARD_SHORTLIST.create(window);
newMenu.add(newWizards);
newMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(newMenu);

2) in the plugin.xml (of whichever component plug-in makes sense), extend
"org.eclipse.ui.newWizards", add a "wizard" child, and in its markup supply a class that extends
Wizard and implements INewWizard. I use for "category" the value "org.eclipse.ui.Basic/" (trailing
slash required, for some reason).

HTH,
Paul

Torbjørn G. Dahle wrote:
> Hi, I'm using the common navigator in my RCP application, and I have two
> questions:
> 1. How can I make the New submenu appear under the file menu in the main
> menu bar?
>
> 2. How can I add my own actions to the New submenu?
>
> - Torbjørn
>
>
Previous Topic:Hiding the basic folder in show view
Next Topic:How to open external file as resource in editor
Goto Forum:
  


Current Time: Thu Apr 25 09:43:14 GMT 2024

Powered by FUDForum. Page generated in 0.03585 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top