|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2004, 2006 IBM Corporation and others. |
2 |
* Copyright (c) 2004, 2010 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 15-20
Link Here
|
| 15 |
import org.eclipse.core.runtime.Platform; |
15 |
import org.eclipse.core.runtime.Platform; |
| 16 |
import org.eclipse.core.runtime.preferences.IEclipsePreferences; |
16 |
import org.eclipse.core.runtime.preferences.IEclipsePreferences; |
| 17 |
import org.eclipse.core.runtime.preferences.IScopeContext; |
17 |
import org.eclipse.core.runtime.preferences.IScopeContext; |
|
|
18 |
import org.osgi.service.prefs.BackingStoreException; |
| 19 |
import org.osgi.service.prefs.Preferences; |
| 18 |
|
20 |
|
| 19 |
/** |
21 |
/** |
| 20 |
* Object representing the project scope in the Eclipse preferences |
22 |
* Object representing the project scope in the Eclipse preferences |
|
Lines 64-70
Link Here
|
| 64 |
public IEclipsePreferences getNode(String qualifier) { |
66 |
public IEclipsePreferences getNode(String qualifier) { |
| 65 |
if (qualifier == null) |
67 |
if (qualifier == null) |
| 66 |
throw new IllegalArgumentException(); |
68 |
throw new IllegalArgumentException(); |
| 67 |
return (IEclipsePreferences) Platform.getPreferencesService().getRootNode().node(SCOPE).node(context.getName()).node(qualifier); |
69 |
// be careful looking up for our node so not to create any nodes as side effect |
|
|
70 |
Preferences prefs = Platform.getPreferencesService().getRootNode().node(SCOPE); |
| 71 |
try { |
| 72 |
if (!prefs.nodeExists(context.getName())) |
| 73 |
return null; |
| 74 |
prefs = prefs.node(context.getName()); |
| 75 |
if (!prefs.nodeExists(qualifier)) |
| 76 |
return null; |
| 77 |
return (IEclipsePreferences) prefs.node(qualifier); |
| 78 |
} catch (BackingStoreException e) { |
| 79 |
//ignore |
| 80 |
} |
| 81 |
return null; |
| 68 |
} |
82 |
} |
| 69 |
|
83 |
|
| 70 |
/* |
84 |
/* |