blob: c23ff9e78a7a0e10314390fbb17bf3c0fd8fa5c8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
// **********************************************************************
//
// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
//
// This plug-in is provided to you under the terms and conditions
// of the Eclipse Public License Version 1.0 ("EPL"). A copy of
// the EPL is available at http://www.eclipse.org/legal/epl-v10.html.
//
// **********************************************************************
package com.zeroc.slice2javaplugin.preferences;
import java.io.File;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.jface.preference.IPreferenceStore;
import com.zeroc.slice2javaplugin.Activator;
/**
* Class used to initialize default preference values.
*/
public class PreferenceInitializer extends AbstractPreferenceInitializer
{
private String getDefaultHome()
{
String os = System.getProperty("os.name");
if(os.equals("Linux"))
{
return "/usr";
}
else if(os.startsWith("Windows"))
{
File f = new File("C:\\Ice-3.3.0");
if(!f.exists())
{
File f2 = new File("C:\\Ice-3.3.0-VC90");
if(f2.exists())
{
return f2.toString();
}
}
return f.toString();
}
return "/opt/Ice-3.3.0";
}
/*
* (non-Javadoc)
*
* @seeorg.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#
* initializeDefaultPreferences()
*/
public void initializeDefaultPreferences()
{
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
store.setDefault(PluginPreferencePage.SDK_PATH, getDefaultHome() );
}
}
|