Dynamic Menu Contribution on View ToolBar thru plugin.xml [message #1778019] |
Fri, 08 December 2017 08:38 |
Annamalai Mising name Messages: 126 Registered: July 2009 |
Senior Member |
|
|
Hi
We are trying to fill the Toolbar of the View using MenuService as documented in this tutorial
http://appddeevvmeanderings.blogspot.in/2007/10/eclipse-defining-your-own-toolbar-menu.html
In the above tutorial, he creates a Toolbar in a View and reads the Commands from the plugin.xml
toolbar = new ToolBarManager(SWT.FLAT);
getMenuService().populateContributionManager(toolbar, "toolbar:yourapp.toolbarX");
toolbar.createControl(p);
In our code instead of creating a ToolBarManager we take the ToolBarManager of the View.
toolbar = getViewSite().getActionBars().getToolBarManager();
getMenuService().populateContributionManager((ToolBarManager)toolbar, "toolbar:YourID?after=additions");
// ((ToolBarManager)toolbar).createControl(parent);
toolbar.update(true);
getViewSite().getActionBars().updateActionBars();
This doesn't work. Any help would be highly appreciated. I would want to add this to the Toolbar of the View and not to my own custom ToolBar. It seems to be working in Eclipse 3.8 and not in Eclipse 4x onwards.
|
|
|
Powered by
FUDForum. Page generated in 0.02529 seconds