簡體   English   中英

IContributionRoot類型中的方法addContributionItem(IContributionItem,Expression)引用缺少的Expression類型

[英]The method addContributionItem(IContributionItem, Expression) from the type IContributionRoot refers to the missing type Expression

我正在嘗試使用菜單和子菜單為eclipse編寫插件,但是當我寫:

additions.addContributionItem(item, null);

我有這個錯誤:

The method addContributionItem(IContributionItem, Expression) from the type IContributionRoot refers to the missing type Expression

我查看了互聯網,但找不到任何好的解決方案。 另外,我不完全理解這個錯誤。 如果有人可以向我解釋並幫助我,那就太好了!

您需要在MANIFEST.MF文件中的Require-Bundle部分下添加org.eclipse.core.expressions

您是否嘗試過使用IMenuManager?

IMenuManager manager = new MenuManager();
manager.add(contributionItem);
Menu menu = manager.createContextMenu(getControl());

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM