Eclipse DLTK: Adding wizards to the 'New'

2020-07-22 10:09发布

I'm trying to add a wizard entry to a ScriptExplorerPart of the Dynamic Languages ToolKit for Eclipse.

The wizards are accessible from File->New->Other..., so at least I know they work. They are added using the extension point org.eclipse.ui.newWizards. What I would like is to have them added as indicated on this screenshot.

To start with I figured it should probably be done using the extension point org.eclipse.ui.navigator.navigatorContent, as suggested in this eclipse newslist. This does not work however, as it seems like DLTK does not honor that extension point.

So, if anyone could point me in the right direction with regards to the correct extension point to use, or if there is another (better) way to add wizard shortcuts, I would much appreciate it.

2条回答
▲ chillily
2楼-- · 2020-07-22 10:33

although this question is a bit old: perspectives control the shortcuts in the menus. you can use the extension point org.eclipse.ui.perspectiveExtensions to add your wizard to new. it should look something like this:

<extension
     point="org.eclipse.ui.perspectiveExtensions">
  <perspectiveExtension targetID="yourPerspective">
    ....
     <newWizardShortcut
           id="idOfYourNewWizard">
     </newWizardShortcut>
  </perspectiveExtension>
</extension>

your wizard will then show up under File > New.
for more information, consult those two links:

http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fworkbench_advext_perspectiveExtension.htm
and
http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fextension-points%2Forg_eclipse_ui_perspectiveExtensions.html

查看更多
来,给爷笑一个
3楼-- · 2020-07-22 10:50

Found this answer but it no longer works in the new eclipse plugin. Just want to provide a working solution for the current version:

go to plugin.xml –> Extensions –> org.eclipse.ui.navigator.navigatorContent (create if not existing) –> New –> commonWizard

and then

type: new for the New submenu and import for Import submenu

wizardId: the id of your wizard for new/import

查看更多
登录 后发表回答