Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Ribbon-like menu/toolbar in E4 RCP application - guidance needed(Getting guidance to find the "right" way to achieve such custom toolbar grouping/layout similar to Ribbons)
Ribbon-like menu/toolbar in E4 RCP application - guidance needed [message #1802187] Sun, 03 February 2019 13:51
Daniel Matheis is currently offline Daniel MatheisFriend
Messages: 2
Registered: February 2019
Junior Member
Hi community!
In good ol e3.x RCP times we created a Ribbon-like toolbar implementation which arranges toolbar items (commands as push buttons) in a CTabFolder with separators etc. to group such items nicely. Internally we used WorkbenchWindowAdvisor#createWindowContents, AbstractContributionFactory, Command Contribution Items etc. to make such toolbar like enablement and disablement for the buttons according to Handler active/enabled state. (This is clearly not functional anymore with e4.)
An own extension point was defined for the grouping, button size etc. meta data. Thus, the content of the toolbar was configurable by different plugins defining such extensions and was filled/built during application "initialization time" - so it was not hard coded.

Now, I am curious how to implement this kind of Ribbon-like toolbar / menu with e4 means.

To get a grasp of the new concepts i have done some resarch and trials with e4 RCP examples. I have studied some tutorials / comments etc. of Tom Schindl and have read the e4 RCP book by Lars Vogel. Now I am at a point where I would like to get some guidance from the others how to achieve my goal. I understood that e4 is very flexible and nicely extensible if you know where and how! :)

If Tom is reading this it might be nice to make his old source code example available again - or just point me to it - which he mentioned in the forum /mailing list some years ago:
(this is not available anymore)
Also he has shown something similar in his blog post:
How was this achieved, Tom?

So what I think could be a plan - please correct me - mainly it is inspired by [u] [/u]:
- extend e4 application EMF model to add ribbons, groups and size for toolbar items model
- implement own renderer & renderer factory to consume such model and to build and layout the stuff correctly

questions to this plan:

a) is it right to extend classes with discourage access warning? The examples i have found all extend renderer classes from org.eclipse.e4.ui.workbench.renderers.swt. Are those examples deprecated?
b) even if it might be the right plan, how does it look actually in more details, where should i start, which classes to extend etc.

Thanks in advance for any comments!

really noone with a best practice?

[Updated on: Mon, 14 October 2019 08:46]

Report message to a moderator

Previous Topic:Problem with combination of restoring state + processing fragments with placeholders
Next Topic:How to determine the enabled state of a command programmatically?
Goto Forum:

Current Time: Fri Apr 23 13:45:50 GMT 2021

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

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

Back to the top