1 | /* |
---|
2 | * Copyright (c) 2008 |
---|
3 | * Embedded Brains GmbH |
---|
4 | * Obere Lagerstr. 30 |
---|
5 | * D-82178 Puchheim |
---|
6 | * Germany |
---|
7 | * rtems@embedded-brains.de |
---|
8 | * |
---|
9 | * The license and distribution terms for this file may be found in the file |
---|
10 | * LICENSE in this distribution or at http://www.rtems.com/license/LICENSE. |
---|
11 | */ |
---|
12 | |
---|
13 | package org.rtems.cdt.wizards; |
---|
14 | |
---|
15 | import org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPageManager; |
---|
16 | import org.eclipse.cdt.ui.wizards.CDTCommonProjectWizard; |
---|
17 | import org.eclipse.core.resources.IProject; |
---|
18 | import org.eclipse.jface.wizard.IWizardPage; |
---|
19 | import org.rtems.cdt.Constants; |
---|
20 | import org.rtems.cdt.Storage; |
---|
21 | |
---|
22 | public class FinishSetup implements Runnable { |
---|
23 | public void run() { |
---|
24 | // Get a handle to the wizard |
---|
25 | IWizardPage [] pages = MBSCustomPageManager.getPages(); |
---|
26 | |
---|
27 | if (pages != null && pages.length > 0) { |
---|
28 | // Get last project |
---|
29 | CDTCommonProjectWizard wizard = (CDTCommonProjectWizard) pages [0].getWizard(); |
---|
30 | IProject project = wizard.getLastProject(); |
---|
31 | |
---|
32 | // Get wizard values |
---|
33 | String basePath = (String) MBSCustomPageManager.getPageProperty( |
---|
34 | BasicSetup.PAGE_ID, Constants.BASE_PATH_KEY |
---|
35 | ); |
---|
36 | String bspPath = (String) MBSCustomPageManager.getPageProperty( |
---|
37 | BasicSetup.PAGE_ID, Constants.BSP_PATH_KEY |
---|
38 | ); |
---|
39 | |
---|
40 | // Set project properties |
---|
41 | Storage.setProperty( project, Constants.BASE_PATH_KEY, basePath); |
---|
42 | Storage.setProperty( project, Constants.BSP_PATH_KEY, bspPath); |
---|
43 | |
---|
44 | // Update tools |
---|
45 | Storage.updateTools( project); |
---|
46 | } |
---|
47 | } |
---|
48 | } |
---|