How to add my own wizards directly to the "new" menu [message #705965] |
Sat, 30 July 2011 13:07 |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.03039 seconds