author | dadubrow |
Wed, 20 Oct 2010 09:35:54 -0500 | |
changeset 2163 | f0a9f2d04d4a |
parent 2160 | 3a82092877ea |
permissions | -rw-r--r-- |
956 | 1 |
/* |
2 |
* Copyright (c) 2010 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 |
||
18 |
package com.nokia.cdt.internal.debug.launch.newwizard; |
|
19 |
||
1067
856622c7b203
10809 - generating warning for missing sis file or missing exe
dadubrow
parents:
1013
diff
changeset
|
20 |
import java.io.File; |
956 | 21 |
|
22 |
import org.eclipse.core.runtime.IStatus; |
|
23 |
import org.eclipse.core.runtime.Status; |
|
24 |
||
25 |
import com.nokia.cdt.internal.debug.launch.LaunchPlugin; |
|
2163 | 26 |
import com.nokia.cdt.internal.debug.launch.newwizard.IDebugRunProcessWizardData.EExeSelection; |
956 | 27 |
|
28 |
/** |
|
29 |
* This page presents three sections: |
|
30 |
* <p> |
|
31 |
* Connection to use: container for the Remote Connection selection UI, plus a label |
|
32 |
* explaining how to handle the case of no connections defined. |
|
33 |
* <p> |
|
34 |
* Debug process: section explaining how the launch will happen, with a combo |
|
35 |
* allowing selecting different process to launch, and a button allowing more |
|
36 |
* in-depth configuration. |
|
37 |
* <p> |
|
1265
f90f47d3882f
PlatSim-related launch wizard changes: (1) Remember last connection created and offer this by default in the Select Connection dialog; (2) Immediately open New Connection dialog if debugging and no connections exist; (3) Split out SelectConnectionDialog; (4) Fix some wording in Select Connection dialog since this is not always an error situation.
Ed Swartz <ed.swartz@nokia.com>
parents:
1067
diff
changeset
|
38 |
* Other settings: section with (currently only) the build-before-debug preference for this |
956 | 39 |
* launch configuration. |
1265
f90f47d3882f
PlatSim-related launch wizard changes: (1) Remember last connection created and offer this by default in the Select Connection dialog; (2) Immediately open New Connection dialog if debugging and no connections exist; (3) Split out SelectConnectionDialog; (4) Fix some wording in Select Connection dialog since this is not always an error situation.
Ed Swartz <ed.swartz@nokia.com>
parents:
1067
diff
changeset
|
40 |
* <p> |
f90f47d3882f
PlatSim-related launch wizard changes: (1) Remember last connection created and offer this by default in the Select Connection dialog; (2) Immediately open New Connection dialog if debugging and no connections exist; (3) Split out SelectConnectionDialog; (4) Fix some wording in Select Connection dialog since this is not always an error situation.
Ed Swartz <ed.swartz@nokia.com>
parents:
1067
diff
changeset
|
41 |
* Each section is validated separately and editable with its own dialog. Changes in |
f90f47d3882f
PlatSim-related launch wizard changes: (1) Remember last connection created and offer this by default in the Select Connection dialog; (2) Immediately open New Connection dialog if debugging and no connections exist; (3) Split out SelectConnectionDialog; (4) Fix some wording in Select Connection dialog since this is not always an error situation.
Ed Swartz <ed.swartz@nokia.com>
parents:
1067
diff
changeset
|
42 |
* the dialog are not applied until the dialog is accepted. |
956 | 43 |
*/ |
2160 | 44 |
public class UnifiedLaunchOptionsPage extends AbstractUnifiedLaunchOptionsPage { |
956 | 45 |
|
2163 | 46 |
public UnifiedLaunchOptionsPage(IWizardData data) { |
2160 | 47 |
super(Messages.getString("UnifiedLaunchOptionsPage.Title"), data); //$NON-NLS-1$ |
969 | 48 |
setDescription(Messages.getString("UnifiedLaunchOptionsPage.Desc")); //$NON-NLS-1$ |
956 | 49 |
|
2160 | 50 |
addSection(new ConnectToDeviceSection(data, this)); |
51 |
addSection(new DebugRunProcessSection(data, this)); |
|
52 |
addSection(new OtherSettingsSection(data, this)); |
|
956 | 53 |
} |
54 |
||
1067
856622c7b203
10809 - generating warning for missing sis file or missing exe
dadubrow
parents:
1013
diff
changeset
|
55 |
protected IStatus getStatus() { |
856622c7b203
10809 - generating warning for missing sis file or missing exe
dadubrow
parents:
1013
diff
changeset
|
56 |
return checkBuildProducts(); |
956 | 57 |
} |
1067
856622c7b203
10809 - generating warning for missing sis file or missing exe
dadubrow
parents:
1013
diff
changeset
|
58 |
|
856622c7b203
10809 - generating warning for missing sis file or missing exe
dadubrow
parents:
1013
diff
changeset
|
59 |
private IStatus checkBuildProducts() { |
2163 | 60 |
IOtherSettingsWizardData otherSettingsWizardData = (IOtherSettingsWizardData) data; |
61 |
if (!otherSettingsWizardData.isCurrentBuildBeforeLaunch()) { |
|
1067
856622c7b203
10809 - generating warning for missing sis file or missing exe
dadubrow
parents:
1013
diff
changeset
|
62 |
// check sis files |
2163 | 63 |
IDebugRunProcessWizardData debugRunProcessWizardData = (IDebugRunProcessWizardData) data; |
64 |
String sisPath = debugRunProcessWizardData.getSisPath(); |
|
65 |
if (debugRunProcessWizardData.isInstallPackage() && |
|
1067
856622c7b203
10809 - generating warning for missing sis file or missing exe
dadubrow
parents:
1013
diff
changeset
|
66 |
sisPath != null && !new File(sisPath).exists()) { |
856622c7b203
10809 - generating warning for missing sis file or missing exe
dadubrow
parents:
1013
diff
changeset
|
67 |
return new Status(IStatus.WARNING, LaunchPlugin.PLUGIN_ID, |
856622c7b203
10809 - generating warning for missing sis file or missing exe
dadubrow
parents:
1013
diff
changeset
|
68 |
Messages.getString("UnifiedLaunchOptionsPage.SISFileMissingWarning")); //$NON-NLS-1$ |
856622c7b203
10809 - generating warning for missing sis file or missing exe
dadubrow
parents:
1013
diff
changeset
|
69 |
} |
856622c7b203
10809 - generating warning for missing sis file or missing exe
dadubrow
parents:
1013
diff
changeset
|
70 |
// check launch file |
2163 | 71 |
if (debugRunProcessWizardData.getExeSelection().equals(EExeSelection.USE_PROJECT_EXECUTABLE) && |
72 |
!debugRunProcessWizardData.getExePath().toFile().exists()) { |
|
1067
856622c7b203
10809 - generating warning for missing sis file or missing exe
dadubrow
parents:
1013
diff
changeset
|
73 |
return new Status(IStatus.WARNING, LaunchPlugin.PLUGIN_ID, |
856622c7b203
10809 - generating warning for missing sis file or missing exe
dadubrow
parents:
1013
diff
changeset
|
74 |
Messages.getString("UnifiedLaunchOptionsPage.ExeFileMissingWarning")); //$NON-NLS-1$ |
856622c7b203
10809 - generating warning for missing sis file or missing exe
dadubrow
parents:
1013
diff
changeset
|
75 |
} |
856622c7b203
10809 - generating warning for missing sis file or missing exe
dadubrow
parents:
1013
diff
changeset
|
76 |
} |
856622c7b203
10809 - generating warning for missing sis file or missing exe
dadubrow
parents:
1013
diff
changeset
|
77 |
|
856622c7b203
10809 - generating warning for missing sis file or missing exe
dadubrow
parents:
1013
diff
changeset
|
78 |
return Status.OK_STATUS; |
856622c7b203
10809 - generating warning for missing sis file or missing exe
dadubrow
parents:
1013
diff
changeset
|
79 |
} |
956 | 80 |
} |