KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > runtime > preferences > PreferenceModifyListener


1 /*******************************************************************************
2  * Copyright (c) 2005 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.runtime.preferences;
12
13 /**
14  * This class provides a hook into the preference service before particular operations
15  * on the global preference tree. Preference modify listeners are registered with
16  * the preference service via XML and the <code>org.eclipse.core.runtime.preferences</code>
17  * extension point.
18  * <p>
19  * Clients may subclass this type.
20  * </p>
21  *
22  * @since 3.1
23  */

24 public abstract class PreferenceModifyListener {
25
26     /**
27      * Clients are given the opportunity to modify the given tree before it is applied
28      * to the global preference tree. Clients should return the tree which should be
29      * applied globally. The tree passed in will not be <code>null</code> and clients
30      * <em>must not</em> return a <code>null</code> tree.
31      * <p>
32      * This method is called by the preference service from within calls to
33      * {@link IPreferencesService#applyPreferences(IExportedPreferences)} or
34      * {@link IPreferencesService#applyPreferences(IEclipsePreferences, IPreferenceFilter[])}.
35      * </p>
36      * <p>
37      * A typical action for clients to perform would be to intercept the incoming preference tree,
38      * migrate old preference values to new ones, and then return the new tree.
39      * </p>
40      *
41      * @param node the tree to modify
42      * @return the tree to apply to the global preferences
43      */

44     public IEclipsePreferences preApply(IEclipsePreferences node) {
45         // default implementation makes no modifications
46
return node;
47     }
48
49 }
50
Popular Tags