Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » How to add my own wizards directly to the "new" menu
How to add my own wizards directly to the "new" menu [message #705965] Sat, 30 July 2011 17:07
Timotei Mising name is currently offline Timotei Mising nameFriend
Messages: 89
Registered: March 2010
Member
It is possible to add some custom wizards, directly to the "File"->"New" menu, and the "New" context menu when right clicking in project explorer/navigator.

For this, you need to do:

1) For the "File"->"New" menu, you need to add the wizard in the perspective, and then reset it, so changes will apply ( in case you've previously opened the perspective )



    @Override
    public void createInitialLayout(IPageLayout layout)
    {
        layout.addNewWizardShortcut( "org.eclipse.ui.wizards.new.file" ); //$NON-NLS-1$
    }

And you replace the string with the wizard id.

2) For the context menu, you need to add a new item in the "org.eclipse.ui.navigator.navigatorContent". A new commonWizard item type:

<commonWizard
            type="new"
            wizardId="my wizard id">
         <enablement></enablement>
      </commonWizard>

You could set some enablements but that's the general idea.
Previous Topic:How to add source lookup to my own launch configuration programmatically
Next Topic:Open TextEditor for filename
Goto Forum:
  


Current Time: Thu Apr 25 01:33:51 GMT 2024

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

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

Back to the top