diff options
author | DJ Houghton | 2011-01-20 15:40:00 +0000 |
---|---|---|
committer | DJ Houghton | 2011-01-20 15:40:00 +0000 |
commit | cd7e8d98c306c92a85f5b9161966aefee765e463 (patch) | |
tree | ab9b332f350422f169c99b3680a182b71c2d4987 | |
parent | b6f39203378fc2569976fc2825469a622adf8fd0 (diff) | |
download | rt.equinox.bundles-cd7e8d98c306c92a85f5b9161966aefee765e463.tar.gz rt.equinox.bundles-cd7e8d98c306c92a85f5b9161966aefee765e463.tar.xz rt.equinox.bundles-cd7e8d98c306c92a85f5b9161966aefee765e463.zip |
Bug 330320 - [prefs] ResourcesPlugin is activated prematurely by Preferences due to hardcoded "project" scope
-rw-r--r-- | bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/PreferencesService.java | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/PreferencesService.java b/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/PreferencesService.java index 56b773c7d..f6bc34cf1 100644 --- a/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/PreferencesService.java +++ b/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/PreferencesService.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2009 IBM Corporation and others. + * Copyright (c) 2004, 2011 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 @@ -34,10 +34,9 @@ public class PreferencesService implements IPreferencesService { private static final long STRING_SHARING_INTERVAL = 300000; private static final String MATCH_TYPE_PREFIX = "prefix"; //$NON-NLS-1$ - // cheat here and add "project" even though we really shouldn't know about it - // because of plug-in dependencies and it being defined in the resources plug-in - private static final String[] DEFAULT_DEFAULT_LOOKUP_ORDER = new String[] {"project", //$NON-NLS-1$ - InstanceScope.SCOPE, // + // the order of search scopes when people don't have a specific order set + private static String[] DEFAULT_DEFAULT_LOOKUP_ORDER = new String[] { // + InstanceScope.SCOPE, // ConfigurationScope.SCOPE, // DefaultScope.SCOPE}; private static final char EXPORT_ROOT_PREFIX = '!'; @@ -1104,4 +1103,23 @@ public class PreferencesService implements IPreferencesService { return result; } + /* + * Return the default search lookup order for when nothing is set. + */ + public String[] getDefaultDefaultLookupOrder() { + return DEFAULT_DEFAULT_LOOKUP_ORDER; + } + + /* + * Set the default search order to use when there is nothing else set. Clients should not + * call this method because it is in an internal class and has been created solely for use by + * the org.eclipse.core.resources bundle in response to this bug: + * https://bugs.eclipse.org/330320 + */ + public void setDefaultDefaultLookupOrder(String[] order) { + // shouldn't happen but let's protect against an NPE. + if (order == null) + order = new String[0]; + DEFAULT_DEFAULT_LOOKUP_ORDER = order; + } } |