summaryrefslogtreecommitdiffstats
path: root/org.rtems.cdt/src/org/rtems/cdt/wizards/FinishSetup.java
diff options
context:
space:
mode:
Diffstat (limited to 'org.rtems.cdt/src/org/rtems/cdt/wizards/FinishSetup.java')
-rw-r--r--org.rtems.cdt/src/org/rtems/cdt/wizards/FinishSetup.java58
1 files changed, 58 insertions, 0 deletions
diff --git a/org.rtems.cdt/src/org/rtems/cdt/wizards/FinishSetup.java b/org.rtems.cdt/src/org/rtems/cdt/wizards/FinishSetup.java
new file mode 100644
index 0000000..0724413
--- /dev/null
+++ b/org.rtems.cdt/src/org/rtems/cdt/wizards/FinishSetup.java
@@ -0,0 +1,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);
+ }
+ }
+}