1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 package com.nokia.cdt.internal.debug.launch.wizard; |
|
18 |
|
19 import java.util.List; |
|
20 |
|
21 import org.eclipse.core.resources.IProject; |
|
22 import org.eclipse.core.runtime.CoreException; |
|
23 import org.eclipse.core.runtime.IPath; |
|
24 import org.eclipse.debug.core.DebugPlugin; |
|
25 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; |
|
26 |
|
27 import com.nokia.cdt.debug.cw.symbian.SettingsData; |
|
28 |
|
29 public class SophiaLaunchWizard extends AbstractLaunchWizard { |
|
30 |
|
31 private BuildOptionsSelectionPage fBuildOptionsSelectionPage; |
|
32 private SophiaWizardPage fSophiaPage; |
|
33 private StopModeRomImageWizardPage fRomImgPage; |
|
34 |
|
35 private boolean hasFinished = false; |
|
36 |
|
37 public SophiaLaunchWizard(List<IPath> mmps, List<IPath> exes, IPath defaultExecutable, IProject project, String configurationName) { |
|
38 super(project, configurationName, mmps, exes, defaultExecutable, true, false); |
|
39 setWindowTitle(Messages.getString("SophiaLaunchWizard.1")); //$NON-NLS-1$ |
|
40 } |
|
41 |
|
42 @Override |
|
43 public String getLaunchTypeID() { |
|
44 return SettingsData.STI_LAUNCH_TYPE_ID; |
|
45 } |
|
46 |
|
47 @Override |
|
48 public boolean supportsCategory(String categoryId) { |
|
49 return categoryId.equals(BOARD_CATEGORY_ID); |
|
50 } |
|
51 |
|
52 public boolean performFinish() { |
|
53 hasFinished = true; |
|
54 return true; |
|
55 } |
|
56 |
|
57 public void addPages() { |
|
58 super.addPages(); |
|
59 fBuildOptionsSelectionPage = new BuildOptionsSelectionPage(); |
|
60 fSophiaPage = new SophiaWizardPage(this); |
|
61 fRomImgPage = new StopModeRomImageWizardPage(this); |
|
62 addPage(fBuildOptionsSelectionPage); |
|
63 addPage(fSophiaPage); |
|
64 addPage(fRomImgPage); |
|
65 addPage(getSummaryPage()); |
|
66 } |
|
67 |
|
68 public String toString() { |
|
69 return Messages.getString("SophiaLaunchWizard.2"); //$NON-NLS-1$ |
|
70 } |
|
71 |
|
72 public String getDescription() { |
|
73 return Messages.getString("SophiaLaunchWizard.3"); //$NON-NLS-1$ |
|
74 } |
|
75 |
|
76 public ILaunchConfigurationWorkingCopy createLaunchConfiguration(IPath mmpPath, IPath exePath, IPath processToLaunchTargetPath) { |
|
77 // if we haven't finished then don't create anything |
|
78 if (!hasFinished) { |
|
79 return null; |
|
80 } |
|
81 |
|
82 ILaunchConfigurationWorkingCopy config = null; |
|
83 try { |
|
84 // create our config |
|
85 config = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(SettingsData.STI_LAUNCH_TYPE_ID).newInstance(null, getConfigName()); |
|
86 |
|
87 // set the default values |
|
88 SettingsData.setDefaults(config, SettingsData.LaunchConfig_SophiaSTI, getProject(), mmpPath, exePath); |
|
89 |
|
90 // now let the wizard pages update values |
|
91 fBuildOptionsSelectionPage.updateConfiguration(config); |
|
92 fSophiaPage.updateConfiguration(config); |
|
93 fRomImgPage.updateConfiguration(config); |
|
94 |
|
95 } catch (CoreException e) { |
|
96 e.printStackTrace(); |
|
97 } |
|
98 return config; |
|
99 } |
|
100 } |
|