Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » "new" file menu item and button in an RCP application
"new" file menu item and button in an RCP application [message #264895] Sun, 01 August 2004 03:55 Go to next message
Eclipse UserFriend
Originally posted by: andykim78.hotmail.com

Hi group,

I'm developing an RCP application that works with an editor input that comes
from a database and not a file.
I'm having trouble with getting the "NEW" menu item and toolbar button to
appear.

Here are the things that I have done which I thought were right:

1. Declare an extension to "org.eclipse.ui.newWizards" in plugin.xml
2. Implement the wizard classes defined in 1.
3. Call "menu.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));" in a
WorkbenchAdvisor.
4. In the perspective code call
"layout.addNewWizardShortcut("dexter.wizards.SampleNewWizard "); " so that
the wizard gets added to the new list.

But so far I do not see the "new" menu item nor the toolbar button.

What am I missing here? Am I supposed to code this in manually?

Any help will be greatly appreciated since I have been pulling my hair out
on this one for the last couple of days.

Thank you in advance.

- Andy
Re: "new" file menu item and button in an RCP application [message #265013 is a reply to message #264895] Mon, 02 August 2004 09:11 Go to previous messageGo to next message
Michael Keppler is currently offline Michael KepplerFriend
Messages: 164
Registered: July 2009
Senior Member
Andy Kim schrieb:

> But so far I do not see the "new" menu item nor the toolbar button.

Maybe resetting the perspective containing the "new" menu item or
starting with a cleaned workspace (see Run->Debug...) could help.

Ciao, Michael.
Re: "new" file menu item and button in an RCP application [message #265126 is a reply to message #265013] Mon, 02 August 2004 22:02 Go to previous message
Eclipse UserFriend
Originally posted by: andykim78.hotmail.com

Thanks for your reply Michael,

I actually have found my answer while looking through the source of the IDE
itself.

What I was missing was not just the new menu item (which will display the
generic "Other..." under new) but the following code:

String newText = Messages.getString("menu.New");
String newId = ActionFactory.NEW.getId();
MenuManager newMenu = new MenuManager(newText, newId);
newMenu.add(new Separator(newId));
this.newWizardMenu = new NewWizardMenu(getWindow());
newMenu.add(this.newWizardMenu);
newMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(newMenu);

Basically, eclipse doesn't provide this functionality automatically as I
thought it would, but you have to implement your own "New" submenu. What it
does provide is however, is NewWizardMenu which I was missing.

If anybody runs into the same problem, the code for all this is in:

org.eclipse.ui.internal.ide.WorkbenchActionBuilder

"Michael Keppler" <michael.keppler@gmx.de> wrote in message
news:cel0cu$nuh$1@eclipse.org...
> Andy Kim schrieb:
>
> > But so far I do not see the "new" menu item nor the toolbar button.
>
> Maybe resetting the perspective containing the "new" menu item or
> starting with a cleaned workspace (see Run->Debug...) could help.
>
> Ciao, Michael.
Previous Topic:Mindset conversion: CodeWarrior to Eclipse
Next Topic:How to enable/disable a view's dock ability in runtime?
Goto Forum:
  


Current Time: Sat Jul 27 18:39:17 GMT 2024

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

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

Back to the top