我只想在右键单击任何XML文件时在 New 类别中作为子项添加一个新条目。我的plugin.xml文件如下,
<plugin>
<extension point="org.eclipse.ui.popupMenus">
<objectContribution objectClass="org.eclipse.core.resources.IFile"
id="org.example.NewProject"
nameFilter="*.xml">
<action
label="New Fun Project"
icon="icons/sample.png"
class="org.example.TestFunAction"
id="org.example.NewProject">
</action>
</objectContribution>
</extension>
</plugin>
当前 New Fun Project 条目已出现在右键菜单中,我现在想将其添加到New category下。如何将其移动到 RightClick> New> New Fun Project ?
答案 0 :(得分:0)
通过以下方法解决问题
<extension
point="org.eclipse.ui.newWizards">
<wizard name="Template"
class="org.example.TestFunAction"
id="org.example.newtemplate"
icon="icons/template.png">
<description>template</description>
</wizard>
</extension>
<extension point="org.eclipse.ui.navigator.navigatorContent">
<commonWizard type="new"
wizardId="org.example.newtemplate">
<enablement>
<adapt type="org.eclipse.core.resources.IFile">
<test property="org.eclipse.core.resources.extension" value="xml">
</test>
</adapt>
</enablement>
</commonWizard>
</extension>