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 Mising name is currently offline Annamalai Mising nameFriend
Messages: 124
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: Mon Sep 21 06:30:45 GMT 2020

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

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

Back to the top