From 239680f2a44bde772ae4d2ce216e3f73053dc65b Mon Sep 17 00:00:00 2001 From: Camilo Bernal Date: Wed, 24 Oct 2012 11:47:21 -0400 Subject: Bug 392685: Store unification profiling preferences in a single file. https://bugs.eclipse.org/bugs/show_bug.cgi?id=392685 Use single node with qualifier being the provider plug-in id. Preference keys are generated by using the profiling type, each referencing the selected profiling type provider. Change-Id: Ib874849e2fa7e6c4d34978109ffb723c5e7aa8a4 Reviewed-on: https://git.eclipse.org/r/8363 Reviewed-by: Jeff Johnston IP-Clean: Jeff Johnston Tested-by: Jeff Johnston --- .../profiling/provider/AbstractProviderPreferencesPage.java | 13 +++++++------ .../launch/ProviderLaunchConfigurationDelegate.java | 5 +++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/AbstractProviderPreferencesPage.java b/profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/AbstractProviderPreferencesPage.java index 743d7ac9f6..b3172436e0 100644 --- a/profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/AbstractProviderPreferencesPage.java +++ b/profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/AbstractProviderPreferencesPage.java @@ -63,7 +63,7 @@ public class AbstractProviderPreferencesPage extends public void init(IWorkbench workbench) { final IPreferenceStore store = new ScopedPreferenceStore( - ConfigurationScope.INSTANCE, type); + ConfigurationScope.INSTANCE, ProviderProfileConstants.PLUGIN_ID); setPreferenceStore(store); } @@ -71,8 +71,8 @@ public class AbstractProviderPreferencesPage extends super.performDefaults(); String providerId = ProfileLaunchShortcut .getDefaultLaunchShortcutProviderId(type); - ConfigurationScope.INSTANCE.getNode(type) - .put(ProviderProfileConstants.PREFS_KEY, providerId); + ConfigurationScope.INSTANCE.getNode(ProviderProfileConstants.PLUGIN_ID) + .put(ProviderProfileConstants.PREFS_KEY + type, providerId); } @@ -80,8 +80,9 @@ public class AbstractProviderPreferencesPage extends protected void createFieldEditors() { String providerId = ProfileLaunchShortcut .getDefaultLaunchShortcutProviderId(type); - - getPreferenceStore().setDefault(ProviderProfileConstants.PREFS_KEY, providerId); + + getPreferenceStore().setDefault( + ProviderProfileConstants.PREFS_KEY + type, providerId); HashMap map = ProfileLaunchConfigurationTabGroup .getProviderNamesForType(type); @@ -106,7 +107,7 @@ public class AbstractProviderPreferencesPage extends // Create basic field editor. RadioGroupFieldEditor editor = new RadioGroupFieldEditor( - ProviderProfileConstants.PREFS_KEY, + ProviderProfileConstants.PREFS_KEY + type, Messages.ProviderPreferencesPage_1, 1, providerList, getFieldEditorParent(), true); editor.setPreferenceStore(getPreferenceStore()); diff --git a/profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/launch/ProviderLaunchConfigurationDelegate.java b/profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/launch/ProviderLaunchConfigurationDelegate.java index a2e83c7bcc..4399a8d62f 100644 --- a/profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/launch/ProviderLaunchConfigurationDelegate.java +++ b/profiling/org.eclipse.linuxtools.profiling.provider/src/org/eclipse/linuxtools/internal/profiling/provider/launch/ProviderLaunchConfigurationDelegate.java @@ -60,8 +60,9 @@ public class ProviderLaunchConfigurationDelegate extends */ public static String getProviderIdToRun(String type) { // Look in the preferences for a provider - String providerId = ConfigurationScope.INSTANCE.getNode(type).get( - ProviderProfileConstants.PREFS_KEY, ""); + String providerId = ConfigurationScope.INSTANCE.getNode( + ProviderProfileConstants.PLUGIN_ID).get( + ProviderProfileConstants.PREFS_KEY + type, ""); if (providerId.equals("") || getConfigurationDelegateFromId(providerId) == null) { // Get highest priority provider providerId = ProfileLaunchConfigurationTabGroup -- cgit v1.2.3