diff options
author | Hamdan Msheik | 2012-12-19 23:14:45 +0000 |
---|---|---|
committer | Pascal Rapicault | 2013-01-14 17:40:27 +0000 |
commit | bad1633b394a335e2adeddd617736c1f413d9057 (patch) | |
tree | 9f7bb49cfba160ddf29c00034eda875b2567f50d /bundles/org.eclipse.equinox.p2.ui.sdk | |
parent | 4090cd9081c513cdef33c81e77472008ca1ea5f4 (diff) | |
download | rt.equinox.p2-bad1633b394a335e2adeddd617736c1f413d9057.tar.gz rt.equinox.p2-bad1633b394a335e2adeddd617736c1f413d9057.tar.xz rt.equinox.p2-bad1633b394a335e2adeddd617736c1f413d9057.zip |
Bug 396420: Control a number of p2 install checkboxes via plugin_customizationv20130114-174027I20130115-0800
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui.sdk')
3 files changed, 34 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/ProvSDKUIActivator.java b/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/ProvSDKUIActivator.java index 61ea6c7df..c6d6acd79 100644 --- a/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/ProvSDKUIActivator.java +++ b/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/ProvSDKUIActivator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 IBM Corporation and others. + * Copyright (c) 2007, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Ericsson AB (Hamdan Msheik) - Bug 396420 - Control Install dialog through preference customization *******************************************************************************/ package org.eclipse.equinox.internal.p2.ui.sdk; @@ -120,7 +121,24 @@ public class ProvSDKUIActivator extends AbstractUIPlugin { } void updateWithPreferences(Policy policy) { - policy.setShowLatestVersionsOnly(getPreferenceStore().getBoolean(PreferenceConstants.PREF_SHOW_LATEST_VERSION)); + + IPreferenceStore store = getPreferenceStore(); + + String value = store.getString(PreferenceConstants.PREF_SHOW_LATEST_VERSION); + policy.setShowLatestVersionsOnly(!IPreferenceStore.STRING_DEFAULT_DEFAULT.equals(value) ? store.getBoolean(PreferenceConstants.PREF_SHOW_LATEST_VERSION) : policy.getShowLatestVersionsOnly()); + + value = store.getString(PreferenceConstants.PREF_HIDE_INSTALLED); + policy.setHideAlreadyInstalled(!IPreferenceStore.STRING_DEFAULT_DEFAULT.equals(value) ? store.getBoolean(PreferenceConstants.PREF_HIDE_INSTALLED) : policy.getHideAlreadyInstalled()); + + value = store.getString(PreferenceConstants.PREF_FILTER_ON_ENV); + policy.setFilterOnEnv(!IPreferenceStore.STRING_DEFAULT_DEFAULT.equals(value) ? store.getBoolean(PreferenceConstants.PREF_FILTER_ON_ENV) : policy.getFilterOnEnv()); + + value = store.getString(PreferenceConstants.PREF_CONTACT_ALL_SITES); + policy.setContactAllSites(!IPreferenceStore.STRING_DEFAULT_DEFAULT.equals(value) ? store.getBoolean(PreferenceConstants.PREF_CONTACT_ALL_SITES) : policy.getContactAllSites()); + + value = store.getString(PreferenceConstants.PREF_GROUP_BY_CATEGORY); + policy.setGroupByCategory(!IPreferenceStore.STRING_DEFAULT_DEFAULT.equals(value) ? store.getBoolean(PreferenceConstants.PREF_GROUP_BY_CATEGORY) : policy.getGroupByCategory()); + } /* diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/prefs/PreferenceConstants.java b/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/prefs/PreferenceConstants.java index 144ac50eb..06f35c481 100644 --- a/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/prefs/PreferenceConstants.java +++ b/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/prefs/PreferenceConstants.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 IBM Corporation and others. + * Copyright (c) 2007, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Ericsson AB (Hamdan Msheik) - Bug 396420 - Control Install dialog through preference customization *******************************************************************************/ package org.eclipse.equinox.internal.p2.ui.sdk.prefs; @@ -17,6 +18,10 @@ public class PreferenceConstants { public static final String PREF_PAGE_PROVISIONING = "org.eclipse.equinox.internal.p2.ui.sdk.ProvisioningPreferencePage"; //$NON-NLS-1$ public static final String PREF_PAGE_SITES = "org.eclipse.equinox.internal.p2.ui.sdk.SitesPreferencePage"; //$NON-NLS-1$ public static final String PREF_SHOW_LATEST_VERSION = "showLatestVersion"; //$NON-NLS-1$ + public static final String PREF_GROUP_BY_CATEGORY = "groupByCategory"; //$NON-NLS-1$ + public static final String PREF_FILTER_ON_ENV = "filterOnEnv"; //$NON-NLS-1$ + public static final String PREF_CONTACT_ALL_SITES = "contactAllSites"; //$NON-NLS-1$ + public static final String PREF_HIDE_INSTALLED = "hideAlreadyInstalled"; //$NON-NLS-1$ public static final String PREF_OPEN_WIZARD_ON_ERROR_PLAN = "allowNonOKPlan"; //$NON-NLS-1$ public static final String PREF_LICENSE_DIGESTS = "licenseDigestList"; //$NON-NLS-1$ } diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/prefs/PreferenceInitializer.java b/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/prefs/PreferenceInitializer.java index d1bfc9b15..9a3ce6ed9 100644 --- a/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/prefs/PreferenceInitializer.java +++ b/bundles/org.eclipse.equinox.p2.ui.sdk/src/org/eclipse/equinox/internal/p2/ui/sdk/prefs/PreferenceInitializer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 IBM Corporation and others. + * Copyright (c) 2007, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Ericsson AB (Hamdan Msheik) - Bug 396420 - Control Install dialog through preference customization *******************************************************************************/ package org.eclipse.equinox.internal.p2.ui.sdk.prefs; @@ -38,7 +39,12 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer { // don't migrate everything. Some of the preferences moved to // another bundle. pref.put(PreferenceConstants.PREF_OPEN_WIZARD_ON_ERROR_PLAN, oldPref.get(PreferenceConstants.PREF_OPEN_WIZARD_ON_ERROR_PLAN, MessageDialogWithToggle.PROMPT)); - pref.putBoolean(PreferenceConstants.PREF_SHOW_LATEST_VERSION, oldPref.getBoolean(PreferenceConstants.PREF_SHOW_LATEST_VERSION, true)); + + // if the preference value associated with PREF_SHOW_LATEST_VERSION does not exist do not initialize it + String showLatestVersionString = oldPref.get(PreferenceConstants.PREF_SHOW_LATEST_VERSION, null); + if (showLatestVersionString != null) { + pref.putBoolean(PreferenceConstants.PREF_SHOW_LATEST_VERSION, Boolean.TRUE.toString().equalsIgnoreCase(showLatestVersionString)); + } pref.flush(); } } catch (BackingStoreException e) { |