Skip to main content



      Home
Home » Eclipse Projects » Eclipse 4 » How to contribute to main toolbar using Eclipse 4?(E4 Eclipse4 Toolbar ToolItem ToolbarContribution)
How to contribute to main toolbar using Eclipse 4? [message #1781324] Tue, 06 February 2018 00:53 Go to next message
Eclipse UserFriend
How to add toolitem to main toolbar (eclipses toolbar) using Eclipse 4 (Application.e4xmi/Fragment.e4xmi)?

I am trying to add a toolbar button using Eclipse 4 but I cannot figure out how to do it. I searched a lot and I could only find examples on RCP toolbar.

I tried many combinations of Extended Element ID (org.eclipse.ui.main.toolbar, org.eclipse.e4.legacy.ide.application) and Feature (children, menuContributions), also tried giving parent ID to Menu Contribution but nothing works. Can anybody please help me? Thanks in advance.

I am using Version: Neon.3 (4.6.3) Build id: M20170301-0400

In eclipse 3 I did it with
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="toolbar:org.eclipse.ui.main.toolbar">
<toolbar
id="com.example.toolbar">
<command
commandId="com.example.mycommand"
icon="src/main/resources/icons/toolbar.png"
style="push"
tooltip="MyToolTip">
</command>
</toolbar>
</menuContribution>
</extension>
Re: How to contribute to main toolbar using Eclipse 4? [message #1834154 is a reply to message #1781324] Tue, 03 November 2020 19:47 Go to previous message
Eclipse UserFriend
It is easy and straightforward.

In the fragment add a model fragment for Toolbar, set as parent the id of the toolbar in the part and add a handled toolitem
Previous Topic:Adding Menu Contribute to Perspective
Next Topic:Adding 3.x ViewParts to E4XMI
Goto Forum:
  


Current Time: Sat Jul 05 02:47:36 EDT 2025

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

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

Back to the top