2163
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
package com.nokia.cdt.internal.debug.launch.newwizard;
|
|
20 |
|
|
21 |
import org.eclipse.core.runtime.Platform;
|
|
22 |
import org.eclipse.core.runtime.preferences.InstanceScope;
|
|
23 |
import org.eclipse.debug.ui.IDebugUIConstants;
|
|
24 |
import org.osgi.service.prefs.Preferences;
|
|
25 |
|
|
26 |
|
|
27 |
/**
|
|
28 |
*
|
|
29 |
*/
|
|
30 |
public class WizardDataUtils {
|
|
31 |
|
|
32 |
/** Get current workspace setting */
|
|
33 |
public static boolean isWorkspaceBuildBeforeLaunch() {
|
|
34 |
// here's how to get the prefs from a plugin's #getPreferenceStore() without violating access
|
|
35 |
String prefId = IDebugUIConstants.PREF_BUILD_BEFORE_LAUNCH;
|
|
36 |
int idx = prefId.lastIndexOf('.');
|
|
37 |
String plugin = prefId.substring(0, idx);
|
|
38 |
Preferences node = Platform.getPreferencesService().getRootNode().node(InstanceScope.SCOPE).node(plugin);
|
|
39 |
return node.getBoolean(prefId, true);
|
|
40 |
}
|
|
41 |
|
|
42 |
|
|
43 |
}
|