[英]eclipse plugin: how to add checkboxes dropdownlist
我需要將復選框dropdownlist添加到eclipse插件中,我想添加與eclipse ide“定制透視圖按鈕” dropdownlist相同的復選框dropdownlist,它看起來像這樣http://s15.postimg.org/vwr4wk77f/dropdown巴紐
我已經使用plugin.xml創建了我的eclipse插件,我對xml真的很陌生,因此我設法通過下拉列表創建了該插件,但是我在xml中找不到可以幫助我使用復選框的元素
我幾乎在每個網站上都搜索過有關信息或幫助的信息,但是我找不到任何可以幫助您的信息,因此,如果您能向我提供建議,我將非常感謝
我的插件代碼如下所示:
<plugin>
<extension point="org.eclipse.ui.menus">
<menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
<toolbar id="my.Toolbar">
</toolbar>
</menuContribution>
</extension>
<extension point="org.eclipse.ui.commands">
<category
id="TRE.projects.commands.category"
name="%category.name.0">
</category>
<category
id="TRE.projects.commands.MultiCategory"
name="MultiCategory">
</category>
<command
name="Configuration1"
categoryId="TRE.projects.commands.MultiCategory"
id="my.command1">
</command>
<command
name="Configuration2"
categoryId="TRE.projects.commands.MultiCategory"
id="my.command2">
</command>
</extension>
<extension point="org.eclipse.ui.handlers">
<handler
commandId="my.command1"
class="TRE.projects.handlers.SampleHandler">
</handler>
<handler
commandId="my.command2"
class="TRE.projects.handlers.SampleHandler">
</handler>
</extension>
<extension point="org.eclipse.ui.menus">
<menuContribution locationURI="toolbar:my.Toolbar?after=additions">
<command
commandId="my.command1"
icon="icons/sample.gif"
id="my.Toolbar.command1"
style="pulldown"
tooltip="TRE Plugin">
</command>
</menuContribution>
<menuContribution
locationURI="menu:org.eclipse.ui.main.popup?after=additions">
<menu
id="TRE.projects.menus.sampleMenu"
label="%menu.label.0"
mnemonic="%menu.mnemonic.0">
<command
commandId="TRE.projects.commands.sampleCommand"
id="TRE.projects.menus.sampleCommand"
mnemonic="%command.mnemonic.0"
style="toggle">
</command>
</menu>
</menuContribution>
您需要將command
元素添加到menuContribution
並使用style=toggle
屬性。
<menuContribution
locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
<command
commandId="my.command1"
label="Simple Item"
style="toggle">
</command>
</menuContribution>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.