Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Dynamic Menu Contribution on View ToolBar thru plugin.xml
Dynamic Menu Contribution on View ToolBar thru plugin.xml [message #1778019] Fri, 08 December 2017 08:38
Annamalai Chockalingam is currently offline Annamalai ChockalingamFriend
Messages: 121
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.
Previous Topic:Resolve dependencies of an external jar
Next Topic:The appearance of markers depend on the editor.
Goto Forum:
  


Current Time: Thu Sep 20 02:21:12 GMT 2018

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

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

Back to the top