1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-30 11:43:33 +02:00

[261503][cleanup] Get rid of deprecated getPluginPreferences()

This commit is contained in:
Martin Oberhuber 2009-01-19 14:39:20 +00:00
parent 717cf8cc0a
commit 5ab146edc6

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved. * Copyright (c) 2006, 2009 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * 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 * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -23,6 +23,7 @@
* David Dykstal (IBM) - [197027] Can lose data if closing eclipse before profile is saved * David Dykstal (IBM) - [197027] Can lose data if closing eclipse before profile is saved
* Kevin Doyle (IBM) - [243821] Save occurring on Main Thread * Kevin Doyle (IBM) - [243821] Save occurring on Main Thread
* David Dykstal (IBM) - [243128] Problem during migration - NPE if provider does save without using a job. * David Dykstal (IBM) - [243128] Problem during migration - NPE if provider does save without using a job.
* Martin Oberhuber (Wind River) - [261503][cleanup] Get rid of deprecated getPluginPreferences()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.persistence; package org.eclipse.rse.internal.persistence;
@ -47,11 +48,11 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.IJobChangeEvent; import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.IJobChangeListener; import org.eclipse.core.runtime.jobs.IJobChangeListener;
import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.preferences.IPreferencesService;
import org.eclipse.rse.core.IRSEPreferenceNames; import org.eclipse.rse.core.IRSEPreferenceNames;
import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.model.IRSEPersistableContainer; import org.eclipse.rse.core.model.IRSEPersistableContainer;
@ -478,14 +479,17 @@ public class RSEPersistenceManager implements IRSEPersistenceManager {
} }
/** /**
* Retrieves the default persistence provider id from the preferences. * Retrieves the default persistence provider id from the preferences. This
* This persistence provider identifier is specified in the org.eclipse.rse.core/DEFAULT_PERSISTENCE_PROVIDER * persistence provider identifier is specified in the
* preference and can be specified a product's plugin_customization.ini file. * org.eclipse.rse.core/DEFAULT_PERSISTENCE_PROVIDER preference and can be
* @return * specified a product's plugin_customization.ini file.
*
* @return the specified default persistence provider, or the empty string
* <code>""</code> if not set.
*/ */
private String getDefaultPersistenceProviderId() { private String getDefaultPersistenceProviderId() {
Preferences preferences = RSECorePlugin.getDefault().getPluginPreferences(); IPreferencesService ps = Platform.getPreferencesService();
String providerId = preferences.getString(IRSEPreferenceNames.DEFAULT_PERSISTENCE_PROVIDER); String providerId = ps.getString(RSECorePlugin.PLUGIN_ID, IRSEPreferenceNames.DEFAULT_PERSISTENCE_PROVIDER, "", null); //$NON-NLS-1$
return providerId; return providerId;
} }