From 3a11ebb3e502941611fc16a0e26194a764b0fc95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Wed, 20 Aug 2025 20:19:36 +0200 Subject: [PATCH] Always consider fragments that specify a platform filter A fragment can declare a Eclipse-PlatformFilter to be only installed on a given platform. If such fragment is currently wired to a host bundle, it is quite likely that fragment is needed but the host usually do not declare an Eclipse-ExtensibleAPI so we currently miss to add such fragment making the native code loading fails. This now adds some code to store the platform filter and if one is given the fragment is always included. Fix https://github.com/eclipse-pde/eclipse.pde/issues/1929 --- .../pde/internal/core/ClasspathUtilCore.java | 11 +++ .../pde/internal/core/DependencyManager.java | 34 ++++++- .../pde/internal/core/PDEAuxiliaryState.java | 2 + .../internal/core/bundle/BundleFragment.java | 4 + .../internal/core/bundle/BundlePlugin.java | 4 + .../ILaunchingPreferenceConstants.java | 2 + .../launching/PreferenceInitializer.java | 2 + .../launcher/BundleLauncherHelper.java | 35 +++++-- .../pde/internal/ui/PDEUIMessages.java | 14 +++ .../ui/launcher/AbstractPluginBlock.java | 91 ++++++++++++++++--- .../pde/internal/ui/pderesources.properties | 7 ++ .../preferences/LaunchingPreferencePage.java | 23 +++++ 12 files changed, 203 insertions(+), 26 deletions(-) diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ClasspathUtilCore.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ClasspathUtilCore.java index 179e137d0b6..84e08c81840 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ClasspathUtilCore.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ClasspathUtilCore.java @@ -224,6 +224,17 @@ public static boolean hasExtensibleAPI(IPluginModelBase model) { return false; } + public static String getPlatformFilter(IPluginModelBase model) { + IPluginBase pluginBase = model.getPluginBase(); + if (pluginBase instanceof BundlePlugin plugin) { + return plugin.getPlatformFilter(); + } + if (pluginBase instanceof BundleFragment fragment) { + return fragment.getPlatformFilter(); + } + return null; + } + public static boolean isPatchFragment(Resource desc) { IPluginModelBase model = PluginRegistry.findModel(desc); return model instanceof IFragmentModel i ? isPatchFragment(i.getFragment()) : false; diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/DependencyManager.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/DependencyManager.java index e8a3de6f23b..958916e5113 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/DependencyManager.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/DependencyManager.java @@ -68,7 +68,19 @@ public enum Options { * Specifies to include all non-test fragments into the closure (must * not be combined with {@link #INCLUDE_ALL_FRAGMENTS}). */ - INCLUDE_NON_TEST_FRAGMENTS; + INCLUDE_NON_TEST_FRAGMENTS, + /** + * Option that can be set to include native fragments, that are ones + * that define an {@link ICoreConstants#PLATFORM_FILTER} in their + * manifest. + */ + INCLUDE_PLATFORM_FRAGMENTS, + /** + * Option that can be set to include native fragments, that are ones + * that define an {@link ICoreConstants#PLATFORM_FILTER} in their + * manifest. + */ + INCLUDE_EXTENSIBLE_FRAGMENTS; } /** @@ -168,6 +180,8 @@ public static Set findRequirementsClosure(Collection findRequirementsClosure(Collection findRequirementsClosure(Collection findRequirementsClosure(Collection mani info.libraries = getClasspath(manifest); info.hasExtensibleAPI = "true".equals(manifest.get(ICoreConstants.EXTENSIBLE_API)); //$NON-NLS-1$ info.isPatchFragment = "true".equals(manifest.get(ICoreConstants.PATCH_FRAGMENT)); //$NON-NLS-1$ + info.platformFilter = manifest.get(ICoreConstants.PLATFORM_FILTER); info.localization = manifest.get(Constants.BUNDLE_LOCALIZATION); info.hasBundleStructure = hasBundleStructure; info.bundleSourceEntry = manifest.get(ICoreConstants.ECLIPSE_SOURCE_BUNDLE); diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundleFragment.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundleFragment.java index 58f51142b3a..a2a534edd14 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundleFragment.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundleFragment.java @@ -122,4 +122,8 @@ public boolean isPatch() { return "true".equals(getValue(ICoreConstants.PATCH_FRAGMENT, false)); //$NON-NLS-1$ } + public String getPlatformFilter() { + return getValue(ICoreConstants.PLATFORM_FILTER, false); + } + } diff --git a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePlugin.java b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePlugin.java index 7965327eb33..e9902dc207f 100644 --- a/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePlugin.java +++ b/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/bundle/BundlePlugin.java @@ -57,4 +57,8 @@ public boolean exportsExternalAnnotations() { return "true".equals(getValue(ICoreConstants.ECLIPSE_EXPORT_EXTERNAL_ANNOTATIONS, false)); //$NON-NLS-1$ } + public String getPlatformFilter() { + return getValue(ICoreConstants.PLATFORM_FILTER, false); + } + } diff --git a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/ILaunchingPreferenceConstants.java b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/ILaunchingPreferenceConstants.java index 76b06c44a60..5bdb525d1e7 100644 --- a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/ILaunchingPreferenceConstants.java +++ b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/ILaunchingPreferenceConstants.java @@ -25,6 +25,8 @@ public interface ILaunchingPreferenceConstants { // Main preference page public static final String PROP_AUTO_MANAGE = "Preferences.Launching.automanageDependencies"; //$NON-NLS-1$ + public static final String PROP_AUTO_MANAGE_EXTENSIBLE_FRAGMENTS = "Preferences.Launching.automanageDependencies.includeExtensibleFragments"; //$NON-NLS-1$ + public static final String PROP_AUTO_MANAGE_PLATFORM_FRAGMENTS = "Preferences.Launching.automanageDependencies.includePlatformFragments"; //$NON-NLS-1$ public static final String PROP_RUNTIME_WORKSPACE_LOCATION = "Preferences.Launching.runtimeWorkspaceLocation"; //$NON-NLS-1$ public static final String PROP_RUNTIME_WORKSPACE_LOCATION_IS_CONTAINER = "Preferences.Launching.runtimeWorkspaceLocationIsContainer"; //$NON-NLS-1$ public static final String PROP_JUNIT_WORKSPACE_LOCATION = "Preferences.Launching.junitWorkspaceLocation"; //$NON-NLS-1$ diff --git a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/PreferenceInitializer.java b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/PreferenceInitializer.java index 6dfa817953a..910b5574edd 100644 --- a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/PreferenceInitializer.java +++ b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/PreferenceInitializer.java @@ -36,6 +36,8 @@ public void initializeDefaultPreferences() { prefs.putBoolean(ILaunchingPreferenceConstants.PROP_JUNIT_ADD_NEW_WORKSPACE_PLUGINS, false); prefs.putBoolean(ILaunchingPreferenceConstants.PROP_JUNIT_VALIDATE_LAUNCH, true); prefs.putBoolean(ILaunchingPreferenceConstants.ADD_SWT_NON_DISPOSAL_REPORTING, true); + prefs.putBoolean(ILaunchingPreferenceConstants.PROP_AUTO_MANAGE_EXTENSIBLE_FRAGMENTS, true); + prefs.putBoolean(ILaunchingPreferenceConstants.PROP_AUTO_MANAGE_PLATFORM_FRAGMENTS, true); // copy over instance scope prefs from UI plugin IEclipsePreferences oldInstancePrefs = InstanceScope.INSTANCE.getNode(IPDEConstants.UI_PLUGIN_ID); diff --git a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/BundleLauncherHelper.java b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/BundleLauncherHelper.java index 1092df4e5a1..ee0319aee10 100644 --- a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/BundleLauncherHelper.java +++ b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/BundleLauncherHelper.java @@ -66,6 +66,7 @@ import org.eclipse.pde.internal.core.DependencyManager; import org.eclipse.pde.internal.core.FeatureModelManager; import org.eclipse.pde.internal.core.PDECore; +import org.eclipse.pde.internal.core.PDEPreferencesManager; import org.eclipse.pde.internal.core.PluginModelManager; import org.eclipse.pde.internal.core.TargetPlatformHelper; import org.eclipse.pde.internal.core.ifeature.IFeature; @@ -74,6 +75,7 @@ import org.eclipse.pde.internal.core.ifeature.IFeatureModel; import org.eclipse.pde.internal.core.ifeature.IFeaturePlugin; import org.eclipse.pde.internal.core.util.VersionUtil; +import org.eclipse.pde.internal.launching.ILaunchingPreferenceConstants; import org.eclipse.pde.internal.launching.IPDEConstants; import org.eclipse.pde.internal.launching.PDELaunchingPlugin; import org.eclipse.pde.internal.launching.PDEMessages; @@ -168,11 +170,29 @@ private static void addRequiredBundles(Map bundle2star List appRequirements = RequirementHelper.getApplicationLaunchRequirements(configuration); RequirementHelper.addApplicationLaunchRequirements(appRequirements, configuration, bundle2startLevel); - boolean includeOptional = configuration.getAttribute(IPDELauncherConstants.INCLUDE_OPTIONAL, true); - computeDependencies(bundle2startLevel.keySet(), includeOptional, true) // + Set options = configurationToOptions(configuration); + computeDependencies(bundle2startLevel.keySet(), options, true) // .forEach(p -> addDefaultStartingBundle(bundle2startLevel, p)); } + protected static Set configurationToOptions(ILaunchConfiguration configuration) throws CoreException { + boolean includeOptional = configuration.getAttribute(IPDELauncherConstants.INCLUDE_OPTIONAL, true); + //TODO read everything from launch config + PDEPreferencesManager launchingStore = PDELaunchingPlugin.getDefault().getPreferenceManager(); + + Set options = new HashSet<>(); + if (includeOptional) { + options.add(DependencyManager.Options.INCLUDE_OPTIONAL_DEPENDENCIES); + } + if (launchingStore.getBoolean(ILaunchingPreferenceConstants.PROP_AUTO_MANAGE_EXTENSIBLE_FRAGMENTS)) { + options.add(DependencyManager.Options.INCLUDE_EXTENSIBLE_FRAGMENTS); + } + if (launchingStore.getBoolean(ILaunchingPreferenceConstants.PROP_AUTO_MANAGE_PLATFORM_FRAGMENTS)) { + options.add(DependencyManager.Options.INCLUDE_PLATFORM_FRAGMENTS); + } + return options; + } + // --- feature based launches --- private static Map getMergedBundleMapFeatureBased(ILaunchConfiguration configuration, Map features) throws CoreException { @@ -221,12 +241,13 @@ private static Map getMergedBundleMapFeatureBased(ILau launchPlugins.addAll(additionalPlugins.keySet()); if (addRequirements) { + Set options = configurationToOptions(configuration); // Add all missing plug-ins required by the application/product set in the config List appRequirements = RequirementHelper.getApplicationLaunchRequirements(configuration); RequirementHelper.addApplicationLaunchRequirements(appRequirements, configuration, launchPlugins, launchPlugins::add); // Get all required plugins - computeDependencies(launchPlugins, false, isWorkspace(defaultPluginResolution)).forEach(launchPlugins::add); + computeDependencies(launchPlugins, options, isWorkspace(defaultPluginResolution)).forEach(launchPlugins::add); } // Create the start levels for the selected plugins and add them to the map @@ -542,7 +563,7 @@ private static void addBundleToMap(Map map, IPluginMod // --- dependency resolution --- - private static Stream computeDependencies(Set includedPlugins, boolean includeOptional, boolean preferWorkspaceBundles) { + private static Stream computeDependencies(Set includedPlugins, Set options, boolean preferWorkspaceBundles) { if (includedPlugins.isEmpty()) { return Stream.empty(); } @@ -556,11 +577,7 @@ private static Stream computeDependencies(Set closure = DependencyManager.findRequirementsClosure(launchBundles, options); + Set closure = DependencyManager.findRequirementsClosure(launchBundles, options.toArray(DependencyManager.Options[]::new)); return closure.stream().map(launchBundlePlugins::get).map(Objects::requireNonNull) // .filter(p -> !includedPlugins.contains(p)); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEUIMessages.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEUIMessages.java index a2f51440d1d..21a021305b8 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEUIMessages.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEUIMessages.java @@ -2474,6 +2474,14 @@ public class PDEUIMessages extends NLS { public static String ConfigurationPageMock_sectionDesc; public static String PluginConfigurationSection_tablePluginTitle; + public static String AbstractPluginBlock_addRequiredDialogIncludeAllFragments; + + public static String AbstractPluginBlock_addRequiredDialogIncludeFragmentsWithoutTests; + + public static String AbstractPluginBlock_addRequiredDialogIncludeOptional; + + public static String AbstractPluginBlock_addRequiredDialogTitle; + public static String AbstractPluginBlock_counter; public static String AbstractRepository_ErrorLoadingImageFromJar; @@ -2711,6 +2719,12 @@ public class PDEUIMessages extends NLS { public static String LaunchingPreferencePage_description; + public static String LaunchingPreferencePage_GroupComputingOptions; + + public static String LaunchingPreferencePage_IncludeExtensibleFragments; + + public static String LaunchingPreferencePage_IncludePlatformFragments; + public static String RemoveLazyLoadingDirectiveResolution_remove; public static String RemoveAutomaticModuleResolution_remove; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/AbstractPluginBlock.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/AbstractPluginBlock.java index 0bf97106e6a..e1b62392983 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/AbstractPluginBlock.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/AbstractPluginBlock.java @@ -42,6 +42,7 @@ import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.util.Util; import org.eclipse.jface.viewers.CheckStateChangedEvent; @@ -415,11 +416,14 @@ public void createControl(Composite parent, int span, int indent) { SelectionListener.widgetSelectedAdapter(e -> this.fAutoIncludeRequirementsButtonChanged = true)); if (fTab instanceof PluginsTab) { - fIncludeOptionalButton = createButton(parent, span, indent,PDEUIMessages.AdvancedLauncherTab_includeOptional_plugins); + fIncludeOptionalButton = createButton(parent, span, indent + 15, + PDEUIMessages.AdvancedLauncherTab_includeOptional_plugins); }else if (fTab instanceof BundlesTab) { - fIncludeOptionalButton = createButton(parent, span, indent, PDEUIMessages.AdvancedLauncherTab_includeOptional_bundles); + fIncludeOptionalButton = createButton(parent, span, indent + 15, + PDEUIMessages.AdvancedLauncherTab_includeOptional_bundles); }else{ - fIncludeOptionalButton = createButton(parent, span, indent, NLS.bind(PDEUIMessages.AdvancedLauncherTab_includeOptional, fTab.getName().toLowerCase(Locale.ENGLISH))); + fIncludeOptionalButton = createButton(parent, span, indent + 15, NLS.bind( + PDEUIMessages.AdvancedLauncherTab_includeOptional, fTab.getName().toLowerCase(Locale.ENGLISH))); } if (fTab instanceof PluginsTab) { fAddWorkspaceButton = createButton(parent, span, indent, PDEUIMessages.AdvancedLauncherTab_addNew_plugins); @@ -868,22 +872,79 @@ protected void initializeButtonsFrom(ILaunchConfiguration config) throws CoreExc * then also checked in the tree */ protected void addRequiredPlugins() { - Object[] checked = fPluginTreeViewer.getCheckedLeafElements(); - List toCheck = Arrays.stream(checked).filter(IPluginModelBase.class::isInstance) - .map(IPluginModelBase.class::cast).collect(Collectors.toList()); + Set options = new HashSet<>(); + options.add(Options.INCLUDE_NON_TEST_FRAGMENTS); + options.add(Options.INCLUDE_OPTIONAL_DEPENDENCIES); + Dialog dialog = new Dialog(fPluginTreeViewer.getControl().getShell()) { - DependencyManager.Options[] options = fIncludeOptionalButton.getSelection() - ? new Options[] { Options.INCLUDE_NON_TEST_FRAGMENTS, Options.INCLUDE_OPTIONAL_DEPENDENCIES } - : new Options[] { Options.INCLUDE_NON_TEST_FRAGMENTS }; - Set additionalBundles = DependencyManager.getDependencies(toCheck, options); + @Override + protected Control createDialogArea(Composite parent) { + Composite composite = (Composite) super.createDialogArea(parent); + Button buttonFragmentsAll = new Button(composite, SWT.RADIO); + Button buttonFragmentNonTest = new Button(composite, SWT.RADIO); + Button buttonOptional = new Button(composite, SWT.CHECK); + buttonFragmentNonTest.setText(PDEUIMessages.AbstractPluginBlock_addRequiredDialogIncludeFragmentsWithoutTests); + buttonFragmentNonTest.setSelection(true); + SelectionListener radioListener = new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + if (buttonFragmentNonTest.getSelection()) { + options.add(Options.INCLUDE_NON_TEST_FRAGMENTS); + options.remove(Options.INCLUDE_ALL_FRAGMENTS); + } else { + options.remove(Options.INCLUDE_NON_TEST_FRAGMENTS); + options.add(Options.INCLUDE_ALL_FRAGMENTS); + } + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { - additionalBundles.stream().map(Resource.class::cast).map(PluginRegistry::findModel).filter(Objects::nonNull) - .forEach(toCheck::add); + } + }; + buttonFragmentNonTest.addSelectionListener(radioListener); + buttonFragmentsAll.setText(PDEUIMessages.AbstractPluginBlock_addRequiredDialogIncludeAllFragments); + buttonFragmentsAll.addSelectionListener(radioListener); + buttonOptional.setSelection(true); + buttonOptional.setText(PDEUIMessages.AbstractPluginBlock_addRequiredDialogIncludeOptional); + buttonOptional.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + if (buttonOptional.getSelection()) { + options.add(Options.INCLUDE_OPTIONAL_DEPENDENCIES); + } else { + options.remove(Options.INCLUDE_OPTIONAL_DEPENDENCIES); + } + } - checked = toCheck.toArray(); - setCheckedElements(checked); + @Override + public void widgetDefaultSelected(SelectionEvent e) { - countSelectedModels(); + } + }); + return composite; + } + + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + newShell.setText(PDEUIMessages.AbstractPluginBlock_addRequiredDialogTitle); + } + }; + if (dialog.open() == Window.OK) { + Object[] checked = fPluginTreeViewer.getCheckedLeafElements(); + List toCheck = Arrays.stream(checked).filter(IPluginModelBase.class::isInstance) + .map(IPluginModelBase.class::cast).collect(Collectors.toList()); + Set additionalBundles = DependencyManager.getDependencies(toCheck, + options.toArray(DependencyManager.Options[]::new)); + additionalBundles.stream().map(Resource.class::cast).map(PluginRegistry::findModel).filter(Objects::nonNull) + .forEach(toCheck::add); + checked = toCheck.toArray(); + setCheckedElements(checked); + countSelectedModels(); + } } protected IPluginModelBase findPlugin(String id) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/pderesources.properties b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/pderesources.properties index ae99f17e635..f5da8d3d54b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/pderesources.properties +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/pderesources.properties @@ -487,6 +487,10 @@ SchemaElementDetails_title=Element Details SchemaElementDetails_rootTitle=Extension Element Details SchemaAttributeDetails_use=Use: +AbstractPluginBlock_addRequiredDialogIncludeAllFragments=Include all fragments +AbstractPluginBlock_addRequiredDialogIncludeFragmentsWithoutTests=Include fragments, except those containing tests +AbstractPluginBlock_addRequiredDialogIncludeOptional=Include optional dependencies +AbstractPluginBlock_addRequiredDialogTitle=Choose Options AbstractPluginBlock_counter={0} out of {1} selected AbstractTargetPage_setTarget=Set as Active Target Platform AbstractTargetPage_reloadTarget=Reload Target Platform @@ -2193,6 +2197,9 @@ LauncherSection_launcherName=Launcher Name: LauncherSection_dialogTitle=Image Selection LauncherSection_dialogMessage=Select an image: LaunchingPreferencePage_description=Settings for Plug-in launches +LaunchingPreferencePage_GroupComputingOptions=When computing required Plug-ins +LaunchingPreferencePage_IncludeExtensibleFragments=Include Fragment of Extensible-API Plug-ins +LaunchingPreferencePage_IncludePlatformFragments=Include Platform Specific Fragment RemoveLazyLoadingDirectiveResolution_remove=Remove lazy activation header RemoveAutomaticModuleResolution_remove=Remove automatic module name header ProductDefinitonWizardPage_applicationDefinition=

An Eclipse product must be associated with an application, the default entry point for the product when it is running.

diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/LaunchingPreferencePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/LaunchingPreferencePage.java index 6da6486e1cc..432b61089f9 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/LaunchingPreferencePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/LaunchingPreferencePage.java @@ -162,6 +162,10 @@ protected boolean isFile() { private Button fJunitAddWorkspaceButton; private Button fJunitAutoValidate; + private Button fFragmentsPlatformButton; + + private Button fFragmentsExtensibleApiButton; + public LaunchingPreferencePage() { setPreferenceStore(PDEPlugin.getDefault().getPreferenceStore()); setDescription(PDEUIMessages.LaunchingPreferencePage_description); @@ -197,6 +201,17 @@ protected Control createContents(Composite parent) { fRuntimeWorkspacesContainerRadio.setSelection(runtimeLocationIsContainer); new DefaultJUnitWorkspaceBlock().createControl(composite); + Group group = SWTFactory.createGroup(composite, PDEUIMessages.LaunchingPreferencePage_GroupComputingOptions, 1, + 1, + GridData.FILL_HORIZONTAL); + fFragmentsPlatformButton = SWTFactory.createCheckButton(group, PDEUIMessages.LaunchingPreferencePage_IncludePlatformFragments, null, false, + 1); + fFragmentsExtensibleApiButton = SWTFactory.createCheckButton(group, + PDEUIMessages.LaunchingPreferencePage_IncludeExtensibleFragments, null, false, 1); + fFragmentsPlatformButton.setSelection( + launchingStore.getBoolean(ILaunchingPreferenceConstants.PROP_AUTO_MANAGE_PLATFORM_FRAGMENTS)); + fFragmentsExtensibleApiButton.setSelection( + launchingStore.getBoolean(ILaunchingPreferenceConstants.PROP_AUTO_MANAGE_EXTENSIBLE_FRAGMENTS)); fJUnitWorkspaceLocation .setText(launchingStore.getString(ILaunchingPreferenceConstants.PROP_JUNIT_WORKSPACE_LOCATION)); boolean jUnitLocationIsContainer = launchingStore @@ -250,6 +265,10 @@ public boolean performOk() { fJunitAutoValidate.getSelection()); launchingStore.setValueOrRemove(ILaunchingPreferenceConstants.ADD_SWT_NON_DISPOSAL_REPORTING, fAddSwtNonDisposalReporting.getSelection()); + launchingStore.setValueOrRemove(ILaunchingPreferenceConstants.PROP_AUTO_MANAGE_EXTENSIBLE_FRAGMENTS, + fFragmentsExtensibleApiButton.getSelection()); + launchingStore.setValueOrRemove(ILaunchingPreferenceConstants.PROP_AUTO_MANAGE_PLATFORM_FRAGMENTS, + fFragmentsPlatformButton.getSelection()); try { launchingStore.flush(); } catch (BackingStoreException e) { @@ -287,6 +306,10 @@ protected void performDefaults() { launchingStore.getDefaultBoolean(ILaunchingPreferenceConstants.PROP_JUNIT_ADD_NEW_WORKSPACE_PLUGINS)); fJunitAutoValidate.setSelection( launchingStore.getDefaultBoolean(ILaunchingPreferenceConstants.PROP_JUNIT_VALIDATE_LAUNCH)); + fFragmentsExtensibleApiButton.setSelection( + launchingStore.getBoolean(ILaunchingPreferenceConstants.PROP_AUTO_MANAGE_EXTENSIBLE_FRAGMENTS)); + fFragmentsPlatformButton.setSelection( + launchingStore.getBoolean(ILaunchingPreferenceConstants.PROP_AUTO_MANAGE_PLATFORM_FRAGMENTS)); } @Override