KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2004, 2006 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 import org.eclipse.core.internal.preferences.AbstractScope;
14 import org.eclipse.core.runtime.IPath;
15
16 /**
17  * Object representing the default scope in the Eclipse preferences
18  * hierarchy. Can be used as a context for searching for preference
19  * values (in the IPreferencesService APIs) or for determining the
20  * correct preference node to set values in the store.
21  * <p>
22  * Default preferences are not persisted to disk.
23  * </p>
24  * <p>
25  * The path for preferences defined in the default scope hierarchy
26  * is as follows: <code>/default/&lt;qualifier&gt;</code>
27  * </p>
28  * <p>
29  * Note about product preference customization:
30  * Clients who define their own {@link org.eclipse.core.runtime.IProduct}
31  * are able to specify a product key of "<code>preferenceCustomization</code>".
32  * (defined as a constant in {@link org.eclipse.ui.branding.IProductConstants})
33  * Its value is either a {@link java.net.URL} or a file-system path to a
34  * file whose contents are used to customize default preferences.
35  * </p>
36  * <p>
37  * This class is not intended to be subclassed. This class may be instantiated.
38  * </p>
39  * @since 3.0
40  */

41 public final class DefaultScope extends AbstractScope implements IScopeContext {
42
43     /**
44      * String constant (value of <code>"default"</code>) used for the
45      * scope name for the default preference scope.
46      */

47     public static final String JavaDoc SCOPE = "default"; //$NON-NLS-1$
48

49     /**
50      * Create and return a new default scope instance.
51      */

52     public DefaultScope() {
53         super();
54     }
55
56     /*
57      * @see org.eclipse.core.runtime.preferences.IScopeContext#getName()
58      */

59     public String JavaDoc getName() {
60         return SCOPE;
61     }
62
63     /* (non-Javadoc)
64      * @see org.eclipse.core.runtime.preferences.IScopeContext#getNode(java.lang.String)
65      */

66     public IEclipsePreferences getNode(String JavaDoc qualifier) {
67         return super.getNode(qualifier);
68     }
69
70     /*
71      * @see org.eclipse.core.runtime.preferences.IScopeContext#getLocation()
72      */

73     public IPath getLocation() {
74         // We don't persist defaults so return null.
75
return null;
76     }
77 }
78
Popular Tags