Skip to content

Commit

Permalink
Set recommended start-levels only for (transitively) included bundles
Browse files Browse the repository at this point in the history
In the configuration section of the Product editor only add a
recommended auto-start configuration for a bundle, if it is
(transitively) included into the product. Before this change a
recommended configuration was always added, even if the bundle was not
part of a launched product.
  • Loading branch information
HannesWell committed Jun 24, 2023
1 parent 48c75fb commit 33bef87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.eclipse.osgi.util.NLS;
import org.eclipse.pde.core.IModelChangedEvent;
import org.eclipse.pde.core.plugin.IFragmentModel;
import org.eclipse.pde.core.plugin.IPluginBase;
import org.eclipse.pde.core.plugin.IPluginModelBase;
import org.eclipse.pde.core.plugin.PluginRegistry;
import org.eclipse.pde.internal.core.iproduct.IPluginConfiguration;
Expand Down Expand Up @@ -232,10 +233,12 @@ private void handleRemoveAll() {
private void handleAddDefaults() {
IProduct product = getProduct();
Set<String> configuredPluginIDs = getConfiguredPlugins(product);
Set<String> allPlugins = LaunchAction.getAllLaunchedPlugins(product) //
.map(IPluginModelBase::getPluginBase).map(IPluginBase::getId).collect(Collectors.toSet());
// Build a user-presentable description of the plugins and start levels.
StringBuilder bundlesList = new StringBuilder();
RECOMMENDED_AUTOSTART_BUNDLES.forEach((pluginID, autoStartLevel) -> {
if (!configuredPluginIDs.contains(pluginID)) {
if (!configuredPluginIDs.contains(pluginID) && allPlugins.contains(pluginID)) {
bundlesList.append('\t');
bundlesList.append(pluginID);
bundlesList.append(", "); //$NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2034,7 +2034,7 @@ Product_PluginSection_newPlugin=New Plug-in...
Product_PluginSection_recommended=Add Re&commended...
Product_PluginSection_RecommendedBundles_title=Add Recommended Start Levels
Product_PluginSection_RecommendedBundles_message=The following Plug-ins will be auto-started with recommended start levels:\n\n{0}\nContinue?
Product_PluginSection_NoRecommendedBundles_message=Custom start levels already exist for plug-ins with recommended start levels. Nothing will be added to the list.
Product_PluginSection_NoRecommendedBundles_message=For each included Plug-in with a recommended start level an entry already exists (Possibly with different level).\n\nNothing will be added to the list.
Product_DependenciesPage_title=Contents
ProductFileWizadPage_groupTitle=Initialize the file content
Product_PluginSection_newFragment=New Fragment...
Expand Down

0 comments on commit 33bef87

Please sign in to comment.