KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > help > internal > base > HelpBasePreferenceInitializer


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.help.internal.base;
12
13 import java.util.Locale JavaDoc;
14
15 import org.eclipse.core.runtime.*;
16 import org.eclipse.core.runtime.preferences.*;
17
18 /**
19  */

20 public class HelpBasePreferenceInitializer extends
21         AbstractPreferenceInitializer {
22
23     /*
24      * (non-Javadoc)
25      *
26      * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
27      */

28     public void initializeDefaultPreferences() {
29         Preferences prefs = HelpBasePlugin.getDefault().getPluginPreferences();
30
31         String JavaDoc os = System.getProperty("os.name").toLowerCase(Locale.ENGLISH); //$NON-NLS-1$
32

33         if (os.indexOf("windows") != -1) { //$NON-NLS-1$
34
prefs
35                     .setDefault("custom_browser_path", //$NON-NLS-1$
36
"\"C:\\Program Files\\Internet Explorer\\IEXPLORE.EXE\" %1"); //$NON-NLS-1$
37
} else if (os.indexOf("linux") != -1) { //$NON-NLS-1$
38
prefs.setDefault("custom_browser_path", //$NON-NLS-1$
39
"konqueror %1"); //$NON-NLS-1$
40
} else {
41             prefs.setDefault("custom_browser_path", "mozilla %1"); //$NON-NLS-1$ //$NON-NLS-2$
42
}
43     }
44
45 }
46
Popular Tags