eclipse - Programmatically getting installed features -


I'm running the following code to iterate on the installed utility

  IBundleGroup [] Bundle Group = Platform.getBundleGroupProviders () [0] .getBundleGroups ();  

However, this code does not return features that were installed after the initial run of the product. I do not see these installed features under the "Features" tab in the Installation Details dialog (Help -> About -> Installation Details), but to see these features under the "Installed Software" tab Is there a separate API?

Use a better P2 API for it. This is an example of how it can work ( Untested, but you will get this idea):

  set & lt; IInstallableUnit & gt; FindFeatures () ProvisionException throws {set & lt; IInstallableUnit & gt; Results = Sets.newHashSet (); // 1. Start the necessary P2 services BundleContext ctx = FrameworkUtil.getBundle (getClass ()). GetBundleContext (); ServiceReference & LT; IProvisioningAgentProvider & gt; Ref = ctx.getServiceReference (IPRVinningEngentProject.class); IProvisioning Agent Spyware Agent Provider = CTX. Agate Service (Ref); String ProfilesID = IPR FileRegistry SLF; // Current running system URI location = Profile ID for tap; // Zero IPRVisioning for existing systems currently running Agent ProvisionAgent = Agent Provider Make (location); IProfileRegistry profileRegistry = (IProfileRegistry) ProvisionAgent .getService (IProfileRegistry.SERVICE_NAME); IProfile p2Profile = profileRegistry.getProfile (ProfileId); // 2. Create a query (check the query for options) IQuery & lt; IInstallableUnit & gt; Query = QueryUtil.createIUGroupQuery (); // 3. Query to IQueryResult & lt; IInstallableUnit & gt; QueryResult = p2Profile.query (query, empty); Results = Query Result.toSet (); Return result; }  

Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -