KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > internal > net > PreferenceModifyListener


1 /*******************************************************************************
2  * Copyright (c) 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.core.internal.net;
12
13 import org.eclipse.core.runtime.preferences.IEclipsePreferences;
14 import org.osgi.service.prefs.BackingStoreException;
15
16 public class PreferenceModifyListener extends
17         org.eclipse.core.runtime.preferences.PreferenceModifyListener {
18
19     public PreferenceModifyListener() {
20         // Nothing to do
21
}
22     
23     public IEclipsePreferences preApply(IEclipsePreferences node) {
24         try {
25             if (node.nodeExists("instance")) { //$NON-NLS-1$
26
((ProxyManager)ProxyManager.getProxyManager()).migrateUpdateHttpProxy(node.node("instance"), false); //$NON-NLS-1$
27
}
28         } catch (BackingStoreException e) {
29             Activator.logError("Could not access instance preferences", e); //$NON-NLS-1$
30
}
31         return super.preApply(node);
32     }
33
34 }
35
Popular Tags