author | Eugene Ostroukhov <eugeneo@symbian.org> |
Mon, 25 Jan 2010 16:30:51 -0500 | |
changeset 43 | 464130c45935 |
parent 39 | eb7d9e33e288 |
child 55 | bb6160d0b6f2 |
permissions | -rw-r--r-- |
2 | 1 |
/******************************************************************************* |
2 |
* Copyright (c) 2009 Symbian Foundation 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 |
* Symbian Foundation - initial contribution. |
|
11 |
* Contributors: |
|
12 |
* Description: |
|
13 |
* Overview: |
|
14 |
* Details: |
|
15 |
* Platforms/Drives/Compatibility: |
|
16 |
* Assumptions/Requirement/Pre-requisites: |
|
17 |
* Failures and causes: |
|
18 |
*******************************************************************************/ |
|
19 |
package org.symbian.tools.wrttools.debug.internal; |
|
20 |
||
21 |
import java.io.File; |
|
22 |
||
23 |
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; |
|
24 |
import org.eclipse.jface.preference.IPreferenceStore; |
|
25 |
||
26 |
public class PreferenceInitializer extends AbstractPreferenceInitializer { |
|
27 |
private final static String DEFAULT_CHROME_LOCATION = "Local Settings/Application Data/Google/Chrome/Application"; |
|
28 |
||
29 |
@Override |
|
30 |
public void initializeDefaultPreferences() { |
|
31 |
IPreferenceStore store = Activator.getDefault().getPreferenceStore(); |
|
32 |
File folder = getDefaultFolder(); |
|
33 |
if (ChromeDebugUtils.getExecutablePath(folder.getAbsolutePath()) != null) { |
|
34 |
store.setDefault(IConstants.PREF_NAME_CHROME_LOCATION, folder |
|
35 |
.getAbsolutePath()); |
|
36 |
} |
|
37 |
} |
|
38 |
||
39 |
private File getDefaultFolder() { |
|
40 |
if (ChromeDebugUtils.isMac()) { |
|
41 |
return new File("/Applications"); |
|
43
464130c45935
Linux support, first cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
39
diff
changeset
|
42 |
} else if (ChromeDebugUtils.isLinux()) { |
464130c45935
Linux support, first cut
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
39
diff
changeset
|
43 |
return new File("/opt/google/chrome"); |
2 | 44 |
} |
45 |
String property = System.getProperty("user.home"); |
|
46 |
File folder = new File(property, DEFAULT_CHROME_LOCATION); |
|
47 |
return folder; |
|
48 |
} |
|
49 |
||
50 |
} |