Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Implement plugin/feature toggle(Decide whether plugin should be loaded (or the fragment should be merged) on startup)
Implement plugin/feature toggle [message #1774236] Thu, 12 October 2017 04:35 Go to next message
Shane Mills is currently offline Shane MillsFriend
Messages: 9
Registered: May 2014
Junior Member
I have originally posted this in the wrong forum, so here a copy of my problem:

I would like to decide on startup of the eclipse application whether a certain plugin should be loaded or not based on a property from the config.ini.

The plugin contains a new feature for our eclipse 4 rcp application that is in a beta state. We would like to deactivate the plugin on default, but allow our customers to activate it using a special property in order to test it.

When the property is not set, the plugin should not contribute anything to the application.

What options do I have to realize this feature toggle mechanism?

I have looked into some functions like the BundleActivators for instance, but they do not seem to do what we desire in this case. I know, that throwing an Exception from within the BundleActivator.start() method should lead to the plugin being unloaded, but this also leads to a lot of Stacktraces in the logfiles.

Is there an existing mechanism that would help us with this requirement?
Or are there any ideas on how I could achieve the described behavior?

Thanks in advance for any help and/or ideas :)
Re: Implement plugin/feature toggle [message #1774399 is a reply to message #1774236] Fri, 13 October 2017 16:53 Go to previous messageGo to next message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 876
Registered: January 2012
Senior Member

Is this a pure E4 solution? If so, you could cause your UI additions to be installed via a model assembler which first checks for this property.
If this is an Eclipse RCP app, you can use a property tester on your UI additions and handlers.

Eclipse Platform committer. Ask me about Eclipse support, training, and consulting.
Re: Implement plugin/feature toggle [message #1774626 is a reply to message #1774399] Wed, 18 October 2017 06:51 Go to previous messageGo to next message
Shane Mills is currently offline Shane MillsFriend
Messages: 9
Registered: May 2014
Junior Member
Thank you very much for taking the time to suggest a solution :)

The software is an Eclipse RCP application.

In fact i did something similar to what you suggested with the property tester, although I had to implement it myself, since it seems to be impossible to define property testers for Model Fragment contributions.

And this is not exactly what I had in mind, since the fragment is still loaded and processed, which is what I actually would like to prevent from happening.

I don't like to force developers of the fragment to remember that they need o add according checks or testers to the model elements.

We need a solution to dynamically load the correct plugins/bundles based on conditions like properties to be sure that a plugin/bundle that is in beta state can easily just be "toggled on/off". A "toggled off" plugin/bundle should not have any impact on the application at all, which is required to make sure that issues in beta state features do not break anything when not explicitly toggled on.

Sometimes we develop pretty complex and big features that cannot be provided in a satisfactory completeness within a single release cycle, but still we would like to give our customers the opportunity to test their current beta state without the need to install a separate client.

In addition to the above mentioned our application contains "expert mode" features that we would like to hide on normal start up and only enable if the user explicitly wishes to.
Re: Implement plugin/feature toggle [message #1775071 is a reply to message #1774236] Tue, 24 October 2017 10:07 Go to previous messageGo to next message
Anton Nogaller is currently offline Anton NogallerFriend
Messages: 2
Registered: October 2017
Junior Member
Hello everyone, struggling with same problem here.
As I am new to a whole RCP development, would anybody be so kind to share a more elaborated example of how to achieve a toggling of Views and Perspectives please?
The examples I found on that matter yet have not worked out for me yet.
My base platform is an E4 RCP app.
Thanks in advance!
Re: Implement plugin/feature toggle [message #1775189 is a reply to message #1775071] Thu, 26 October 2017 05:37 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2787
Registered: July 2012
Senior Member
If you want a toggle at runtime, you need the property tester or similar (Core Expressions). This is because the bundles have to be loaded in order to change the states at runtime. If you want to avoid bundle loading on startup, which is what you typically would do in a licensing scenario, I think the OSGi resolver hook should be what you are looking for.
Previous Topic:Remove Perspectives
Next Topic:InterruptedException on Linux GTK
Goto Forum:

Current Time: Thu Oct 22 07:43:33 GMT 2020

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

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

Back to the top