Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » fetching all feature bundles in platform
fetching all feature bundles in platform [message #1777867] Tue, 05 December 2017 13:20 Go to next message
Zakir Meer is currently offline Zakir MeerFriend
Messages: 31
Registered: February 2016
Member
Hello Experts,

I am trying to programatically fetch all features and the corresponding plugins which are part of them. I am using below code snippet as a part of command handler -> which will be invoked on click of a button in runtime.

When I launch the runtime instance, I select an option to consider all the Features from both the workspace and target. But to my surprise all the "feature Bundles" are not available when I programatically fetch the contents using the below API. Can you let me know if I am missing something here.

As a part of my implementation, I want to extract all the Feature bundles which are part of the runtime environment.

  IBundleGroupProvider[] providers = org.eclipse.core.runtime.Platform.getBundleGroupProviders();

	    if (providers != null) {

	     for (int i = 0; i < providers.length; ++i) {

	      IBundleGroup[] featureBundleGroups = providers[i].getBundleGroups(); // should return all the features in Runtime

	      for (int j = 0; j < featureBundleGroups.length; ++j) {

	    	  IBundleGroup featureBundleGroup = featureBundleGroups[j];
	    	  
			logData(">>> Feature name: " + featureBundleGroup.getIdentifier() + " version: "+ featureBundleGroup.getVersion());

	    	  Bundle[] pluginBundles = featureBundleGroup.getBundles();


					for (int k = 0; k < pluginBundles.length; ++k) {

						Bundle pluginBundle_L1 = pluginBundles[k];
						
						logData("\tFirst level Plugin : "+pluginBundle_L1);
						
						logPluginDetails_Level_1(state, pluginBundle_L1);
					}

	      }

	     }

	    }
Re: fetching all feature bundles in platform [message #1777893 is a reply to message #1777867] Tue, 05 December 2017 16:39 Go to previous messageGo to next message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 772
Registered: January 2012
Senior Member

Just to be clear, you're seeing nothing when launching in the debugger right? That's to be expected: PDE's default launch configurations are plug-in-based and do not install features. You can change your launch to be feature-based in which case you should have some bundle-group providers.

Brian.


Eclipse Platform committer. Ask me about Eclipse support, training, and consulting.
Re: fetching all feature bundles in platform [message #1777944 is a reply to message #1777893] Wed, 06 December 2017 15:27 Go to previous messageGo to next message
Zakir Meer is currently offline Zakir MeerFriend
Messages: 31
Registered: February 2016
Member
Hi Brian,
Thanks for your response !!
In run configuration, I have changed it to select all the features from target and workspace. Based on this configuration I expected features from my workspace also to be available in the runtime. Unfortunately they don't appear there..but I can see all the plugins from my workspace are considered as a part of runtime
Re: fetching all feature bundles in platform [message #1777959 is a reply to message #1777944] Wed, 06 December 2017 19:18 Go to previous message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 772
Registered: January 2012
Senior Member

Oops, sorry. I should have added an "I think". I've had to add special-case code for handling situations where there are no IBundleGroupProvider or IBundleGroup. This does seem to be something that has to be built and run outside of Eclipse to be tested.

Eclipse Platform committer. Ask me about Eclipse support, training, and consulting.
Previous Topic:eclipse + glassfish on Ubuntu 16.04 fall
Next Topic:auto correct capitalizing wrong character
Goto Forum:
  


Current Time: Thu Sep 20 06:54:32 GMT 2018

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

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

Back to the top