Summary: | Need to compute the list of new installed features. | ||
---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Eduardo Pereira <eduardo_pereira> |
Component: | Update (deprecated - use Eclipse>Equinox>p2) | Assignee: | Platform-Update-Inbox <platform-update-inbox> |
Status: | RESOLVED WORKSFORME | QA Contact: | |
Severity: | blocker | ||
Priority: | P3 | ||
Version: | 2.0.2 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: | |||
Bug Depends on: | |||
Bug Blocks: | 21347 |
Description
Eduardo Pereira
2002-10-07 11:01:57 EDT
You called the wrong API. This is what you need to call: try { // get the local site handle ILocalSite localSite = SiteManager.getLocalSite(); // get the current configuration IInstallConfiguration config = localSite.getCurrentConfiguration(); // loop through the configured sites IConfiguredSite [] csites = config.getConfiguredSites(); for (int i=0; i<csites.length; i++) { IConfiguredSite csite = csites[i]; // get handles to the configured features in the site IFeatureReference [] crefs = csite.getConfiguredFeatures(); for (j=0; j<crefs.length; j++) { IFeatureReference cref = crefs[j]; try { // get the feature from the handle IFeature feature = cref.getFeature(); } catch (CoreException ex) { // cannot load the feature } } } } catch (CoreException e) { } Configured sites are sites that are known to the configuration. In a simple product installation, there will be only one (default) configured site containing all the features. In a complex product installation where there is the initial product and links to product extensions, there will be a configured site for the product itself and a site for each linked extension. A very important point in the code above is that we called 'IConfiguredSite.getConfiguredFeatures'. If we called 'IConfiguredSite.getFeatureReferences', we would get references to ALL the features in the site, both configured and unconfigured. Released change using proposed code and it worked. I will resolve this bug since the required API exists and the sample code has been provided. |