Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Making a Tool Item's Menu appear programmatically
Making a Tool Item's Menu appear programmatically [message #1726253] Thu, 10 March 2016 18:20
Andreas Sewe is currently offline Andreas SeweFriend
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
Previous Topic:MToolControl.setVisible(true) changes not immediately reflected in status bar
Next Topic:Dynamic Menu Contribution to PopupMenu
Goto Forum:
  


Current Time: Thu Apr 25 12:25:00 GMT 2024

Powered by FUDForum. Page generated in 0.03593 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top