Making a Tool Item's Menu appear programmatically [message #1726253] |
Thu, 10 March 2016 18:20 |
Andreas Sewe Messages: 111 Registered: June 2013 |
Senior Member |
|
|
Hi,
I have the following construction:
Toolbar -> Direct Tool Item -> Menu -> ... Tool Items
Now, I want the Direct Tool Item's handler to opens the tool item's menu -- just as if the user had clicked on the small triangle. I suspect a solution starts like this
public class OpenMenuHandler {
@Execute
public void execute(MDirectToolItem toolItem) {
toolItem.getMenu()...
}
}
but I haven't made much progress beyond that; I can set the MMenu to be visible or be rendered, but that doesn't make the menu appear. Also, I can use toolItem.getWidget() and a cast to get at the underlying SWT widget, but that certainly doesn't seem like the right direction, as it would tie me to a specific renderer.
Any pointers are greatly appreciated.
Andreas
|
|
|
Powered by
FUDForum. Page generated in 0.03593 seconds