summaryrefslogtreecommitdiffstats
path: root/org.rtems.cdt/src/org/rtems/cdt/preferences/PreferencePage.java
blob: a82f7e4e9ee66308cbe6c930f83f26cb4751d1da (plain) (blame)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
 * Copyright (c) 2008 Embedded Brains GmbH and others.
 *
 *   Embedded Brains GmbH
 *   Obere Lagerstr. 30
 *   D-82178 Puchheim
 *   Germany
 *   rtems@embedded-brains.de
 *
 * All rights reserved.  This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License Version 1.0 ("EPL")
 * which accompanies this distribution and is available at
 *
 *   http://www.eclipse.org/legal/epl-v10.html
 *
 * For purposes of the EPL, "Program" will mean the Content.
 *
 * Contributors:
 *
 *   Sebastian Huber (Embedded Brains GmbH) - Initial API and implementation.
 */

package org.rtems.cdt.preferences;

import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.DirectoryFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.IWorkbench;
import org.rtems.cdt.Activator;
import org.rtems.cdt.Constants;

public class PreferencePage
	extends FieldEditorPreferencePage
	implements IWorkbenchPreferencePage {
	public PreferencePage() {
		super( GRID);
		setPreferenceStore( Activator.getDefault().getPreferenceStore());
		setDescription( "Select the RTEMS base installation path and the board support package (BSP) installation path.  This provides the default values for all projects.  Existing projects are not affected by changes made here.");
	}

	public void createFieldEditors() {
		addField(
			new DirectoryFieldEditor(
				Constants.BASE_PATH_KEY,
				"Base path:",
				getFieldEditorParent()
			)
		);
		addField(
			new DirectoryFieldEditor(
				Constants.BSP_PATH_KEY,
				"BSP path:",
				getFieldEditorParent()
			)
		);
		if (Platform.getOS().equals( Platform.OS_WIN32)) {
			addField(
				new DirectoryFieldEditor(
					Constants.CYGWIN_PATH_KEY,
					"Cygwin path:",
					getFieldEditorParent()
				)
			);
			addField(
				new DirectoryFieldEditor(
					Constants.MINGW_PATH_KEY,
					"MinGW path:",
					getFieldEditorParent()
				)
			);
			addField(
				new DirectoryFieldEditor(
					Constants.MSYS_PATH_KEY,
					"MSYS path:",
					getFieldEditorParent()
				)
			);
		}
		addField(
			new BooleanFieldEditor(
				Constants.DISABLE_TOOL_OPTIONS_KEY,
				"Disable tool options derived from BSP settings",
				getFieldEditorParent()
			)
		);
	}

	public void init( IWorkbench workbench) {
		// Do nothing
	}
}