How to display the command's drop-down menu after the command icon is clicked? [message #1062907] |
Tue, 11 June 2013 06:56  |
Eclipse User |
|
|
|
In Eclipse RCP application I have a custom view and a drop-down command contributed into that view's toolbar:
<menuContribution
allPopups="false"
locationURI="toolbar:test.ui.views.MyView">
<command
commandId="test.ui.commands.Command1"
icon="icons/Command1.png"
id="test.ui.commands.Command1.dropdown"
label="Command 1"
style="pulldown">
</command>
</menuContribution>
Then, I have a couple of other commands contributed into the Command1 drop-down menu like this:
<menuContribution
allPopups="false"
locationURI="menu:test.ui.commands.Command1.dropdown">
<command
commandId="test.ui.commands.Command2"
label="Command 2"
style="push">
</command>
<command
commandId="test.ui.commands.Command3"
label="Command 3"
style="push">
</command>
</menuContribution>
Until now everything works fine, I can see the Command1 icon on the view's toolbar and when I click the drop-down symbol next to it, the menu shows up with the Command2 and Command3 commands - as expected.
Problem:
What I would like to achieve now is to show the drop-down menu not only after the user clicks the drop-down symbol next to the Command1 icon, but also after the user clicks the Command1 icon itself.
(for example, this is how the Open Console command works in the Console view's toolbar in Eclipse)
I guess I need to programmatically trigger displaying the Command1 drop-down menu from within the Command1 handler but I couldn't find any examples on how to do that.
Thanks in advance for any help!
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.25335 seconds