【发布时间】:2014-06-22 08:37:39
【问题描述】:
这是 PackageExplorer 的 plugin.xml 工作上下文菜单的一部分,现在我想要它用于 ProjecExplorer,所以我尝试将其重写为 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>
我不工作的解决方案 - 将 PackageExploer 重命名为 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>
【问题讨论】:
标签: eclipse eclipse-plugin contextmenu