这是plugin.xml工作上下文菜单的一部分,现在我想要它适用于ProjectExplorer,所以我尝试将其重写为ProjectExplorer,但它不起作用...我搜索了网络,并发现有问题,但我找不到可行的解决方案。有谁有经验如何修复它吗?
<extension point="org.eclipse.ui.menus">
<menuContribution locationURI="popup:org.eclipse.jdt.ui.PackageExplorer">
<command commandId="app.LoadXml"
label="Load plan" style="push" mnemonic="L">
<visibleWhen>
<with variable="activeMenuSelection">
<iterate ifEmpty="false">
<adapt type="org.eclipse.core.resources.IResource">
<test property="org.eclipse.core.resources.name" value="*.xml" />
</adapt>
</iterate>
</with>
</visibleWhen>
</command>
</menuContribution>
</extension>
我的解决方案不起作用 - 将PackageExplorer重命名为ProjectExplorer => 现在没有上下文菜单。
<extension point="org.eclipse.ui.menus">
<menuContribution locationURI="popup:org.eclipse.jdt.ui.ProjectExplorer">
<command commandId="app.LoadXml"
label="Load plan" style="push" mnemonic="L">
<visibleWhen>
<with variable="activeMenuSelection">
<iterate ifEmpty="false">
<adapt type="org.eclipse.core.resources.IResource">
<test property="org.eclipse.core.resources.name" value="*.xml" />
</adapt>
</iterate>
</with>
</visibleWhen>
</command>
</menuContribution>
</extension>