Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 3c2a94027f761dbda4244a34c740f867974b6462 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*******************************************************************************
 * Copyright (c) 2009, 2015 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
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.core.runtime.preferences;

import org.eclipse.core.internal.preferences.AbstractScope;
import org.eclipse.core.runtime.IPath;

/**
 * Object representing the bundle defaults scope in the Eclipse preferences
 * hierarchy. Can be used as a context for searching for preference
 * values (in the IPreferencesService APIs) or for determining the
 * correct preference node to set values in the store.
 * <p>
 * The bundle defaults are the defaults are default values which have
 * been set either by the bundle's preference initializer or by a customization
 * file supplied with the bundle.
 * <p>
 * Bundle default preferences are not persisted to disk.
 * </p>
 * <p>
 * The path for preferences defined in the bundle defaults scope hierarchy
 * is as follows: <code>/bundle_defaults/&lt;qualifier&gt;</code>
 * </p>
 * <p>
 * This class is not intended to be subclassed. This class may be instantiated.
 * </p>
 * @since 3.3
 */
public final class BundleDefaultsScope extends AbstractScope {

	/**
	 * String constant (value of <code>"default"</code>) used for the
	 * scope name for the default preference scope.
	 */
	public static final String SCOPE = "bundle_defaults"; //$NON-NLS-1$

	/**
	 * Singleton instance of a Bundle Defaults Scope object. Typical usage is:
	 * <code>BundleDefaultsScope.INSTANCE.getNode(...);</code>
	 *
	 * @since 3.4
	 */
	public static final IScopeContext INSTANCE = new BundleDefaultsScope();

	/**
	 * Create and return a new default scope instance.
	 * @deprecated use <code>BundleDefaultsScope.INSTANCE</code> instead
	 */
	public BundleDefaultsScope() {
		super();
	}


	@Override
	public String getName() {
		return SCOPE;
	}


	@Override
	public IEclipsePreferences getNode(String qualifier) {
		return super.getNode(qualifier);
	}


	@Override
	public IPath getLocation() {
		// We don't persist defaults so return null.
		return null;
	}
}

Back to the top