我已經遵循了我在幾個論壇上找到的所有可能的解決方案(也是這樣的:Eclipse plugin menu item is not visible)。但是,他們都沒有解決我的問題。我也按照這個教程http://www.vogella.com/tutorials/EclipsePlugIn/article.html。無論如何,該標籤沒有顯示在菜單中。這是我的plugin.xml:popup:org.eclipse.jdt.ui.PackageExplorer不可見
<extension
point="org.eclipse.ui.commands">
<command
defaultHandler="pr.handlers.SampleHandler3"
id="pr.commands.rightclick"
name="Analyze">
</command>
.....
<menuContribution
locationURI="popup:org.eclipse.jdt.ui.PackageExplorer">
<command
commandId="pr.commands.rightclick"
label="Analyze"
style="push">
<visibleWhen>
<with variable="activeMenuSelection">
<iterate
ifEmpty="false">
<adapt type="org.eclipse.core.resources.IFile">
<test property="org.eclipse.core.resources.name" value="*java" />
</adapt>
</iterate>
</with>
</visibleWhen>
</command>
</menuContribution>
爲我工作。你確定你正在查看Package Explorer視圖(例如不是Project Explorer)? –
是的,它會是什麼?無論如何,該命令存在,因爲如果我在「快速訪問」中搜索它,它在命令列表中。 – Modfoo
我計算出了測試中的不同之處。見答案。 –