summaryrefslogtreecommitdiffstats
path: root/org.rtems.cdt/src/org/rtems/cdt/wizards/FinishSetup.java
blob: 072441354d72c1c618492774d4911d41678a59a3 (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
/*
 * 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.wizards;

import org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPageManager;
import org.eclipse.cdt.ui.wizards.CDTCommonProjectWizard;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.wizard.IWizardPage;
import org.rtems.cdt.Constants;
import org.rtems.cdt.Storage;

public class FinishSetup implements Runnable {
	public void run() {
		// Get a handle to the wizard
		IWizardPage [] pages = MBSCustomPageManager.getPages();

		if (pages != null && pages.length > 0) {
			// Get last project
			CDTCommonProjectWizard wizard = (CDTCommonProjectWizard) pages [0].getWizard();
			IProject project = wizard.getLastProject();

			// Get wizard values
			String basePath = (String) MBSCustomPageManager.getPageProperty(
				BasicSetup.PAGE_ID, Constants.BASE_PATH_KEY
			);
			String bspPath = (String) MBSCustomPageManager.getPageProperty(
				BasicSetup.PAGE_ID, Constants.BSP_PATH_KEY
			);

			// Set project properties
			Storage.setProperty( project, Constants.BASE_PATH_KEY, basePath);
			Storage.setProperty( project, Constants.BSP_PATH_KEY, bspPath);

			// Clear platform
			Storage.clearPlatform( project);
		}
	}
}