Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Add a menucontribuion to Toolbar dynamically(Is it possible to dynamically add a new "button" to the Eclipse toolbar)
Add a menucontribuion to Toolbar dynamically [message #1736327] Tue, 28 June 2016 12:42
André Ramos is currently offline André RamosFriend
Messages: 11
Registered: April 2014
Junior Member
Is it possible to add menucontribution, basically a new button, to the toolbar:org.eclipse.ui.main.toolbar dynamically?

I tried with AbstractContributionFactory but it seems to be bugged. Since the createContributionItems is never called. (

My code so far tries to add a new button to the Eclipse toolbar after pressing another button, the thing is that createContributionItem is never called, so i never even see "HallelujAH"":

//If a certain button is pressed run will be executed
public void run(IAction action) {

"Hello, Eclipse world");

IMenuService menuService = (IMenuService) PlatformUI.getWorkbench().getService(IMenuService.class);

AbstractContributionFactory factory = new AbstractContributionFactory("toolbar:org.eclipse.ui.main.toolbar", null)

public void createContributionItems(IServiceLocator serviceLocator, IContributionRoot additions) {




Tks for your attention.

[Updated on: Tue, 28 June 2016 16:41]

Report message to a moderator

Next Topic:Product export error when using shared license for a feature
Goto Forum:

Current Time: Sun Aug 09 18:38:49 GMT 2020

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

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

Back to the top