![](/img/trans.png)
[英]filling CommandContributionItem for pulldown menu in eclipse
[英]Making a pulldown menu in the action menu in Eclipse plugin
我有以下菜單項,當指向時應具有其他2個項,但它僅具有指示其為下拉菜單的箭頭。 當我指向下圖中的菜單項“語言”時,我需要使其他兩個菜單項出現
這是菜單的代碼
<plugin>
<extension
point="org.eclipse.ui.actionSets">
<actionSet
id="Bachelor.actionSet"
label="New menu"
visible="true">
<menu
id="sampleMenu"
label="Localized">
<separator
name="sampleGroup">
</separator>
<groupMarker
name="content">
</groupMarker>
</menu>
<action
class="bachelor.actions.Compile"
icon="icons/sample.gif"
id="bachelor.actions.Compile"
label="&Compile"
menubarPath="sampleMenu/content"
toolbarPath="sampleGroup"
tooltip="Open the resource manager view">
</action>
<action
class="bachelor.actions.Run"
icon="icons/sample.gif"
id="bachelor.actions.Run"
label="&Run"
menubarPath="sampleMenu/content"
toolbarPath="sampleGroup"
tooltip="Open the resource manager view">
</action>
<action
class="language"
id="Bachelor.action1"
label="Language"
menubarPath="sampleMenu/content"
pulldown="true"
state="true"
style="pulldown"
visible="true">
<selection
class="bachelor.German"
name="German">
</selection>
</action>
</actionSet>
</extension>
</plugin>
首先,您應該使用命令和處理程序而不是actionSet,請參閱http://wiki.eclipse.org/Platform_Command_Framework
在這種情況下,您的下拉操作需要實現一個不同的I*ActionDelegate
並提供一個IMenuCreator
。 請參閱org.eclipse.ui.actionSets
的擴展點描述
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.