File->New menu contributions [message #467579] |
Tue, 08 May 2007 07:30 |
Eclipse User |
|
|
|
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 |
Paul E. Keyser 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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03585 seconds