插件开发为Java透视图贡献新建向导时的一个bug(org.eclipse.ui.perspectiveExtensions)

来源:互联网 发布:淘宝站外活动大全 编辑:程序博客网 时间:2024/06/05 12:03
有前同事问到,想在新建向导中添加一个右键菜单,可能是这样:
 
 
这种需求通过org.eclipse.ui.perspectiveExtensions扩展点就能办到。eg:
step1:实现org.eclipse.ui.newWizards向导
 <extension         point="org.eclipse.ui.newWizards">      <category            id="CreateType"            name="Sample Wizards">      </category>      <wizard            category="CreateType"            class="createtype.wizards.SampleNewWizard"            icon="icons/sample.gif"            id="createtype.wizards.SampleNewWizard11"            name="我的新建向导菜单">      </wizard>   </extension>

 
step2:扩展org.eclipse.ui.perspectiveExtensions。
 <extension         point="org.eclipse.ui.perspectiveExtensions">     <perspectiveExtension            targetID="org.eclipse.jdt.ui.JavaPerspective">         <newWizardShortcut               id="createtype.wizards.SampleNewWizard11">         </newWizardShortcut>     </perspectiveExtension>  </extension>

说明:targetID为java透视图的id
<newWizardShortcut  id="createtype.wizards.SampleNewWizard11">   </newWizardShortcut>里面的id为我们要添加到new新建菜单下的新建向导的id
 
小bug为:run或debug时,并没有显示出来。清除一下缓存(Run Configurations--->Clear Workspace Data),就显示出来了。不知道这是不是pde的一个bug。
原创粉丝点击