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 |
||
1090 | 20 |
import java.util.ArrayList; |
956 | 21 |
import java.util.Collection; |
22 |
import java.util.List; |
|
23 |
||
24 |
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; |
|
25 |
import org.eclipse.core.resources.IProject; |
|
26 |
import org.eclipse.core.runtime.CoreException; |
|
27 |
import org.eclipse.core.runtime.IPath; |
|
28 |
import org.eclipse.core.runtime.IStatus; |
|
29 |
import org.eclipse.core.runtime.Path; |
|
30 |
import org.eclipse.core.runtime.Platform; |
|
31 |
import org.eclipse.core.runtime.Status; |
|
32 |
import org.eclipse.debug.core.DebugPlugin; |
|
33 |
import org.eclipse.debug.core.ILaunchConfigurationType; |
|
34 |
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; |
|
35 |
import org.eclipse.debug.core.ILaunchManager; |
|
1186
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
36 |
import org.osgi.framework.Bundle; |
956 | 37 |
|
38 |
import com.freescale.cdt.debug.cw.core.RemoteConnectionsTRKHelper; |
|
39 |
import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator; |
|
40 |
import com.nokia.carbide.remoteconnections.interfaces.IConnectedService; |
|
41 |
import com.nokia.carbide.remoteconnections.interfaces.IConnection; |
|
42 |
import com.nokia.carbide.remoteconnections.interfaces.IService; |
|
43 |
import com.nokia.carbide.remoteconnections.internal.api.IConnectedService2; |
|
44 |
import com.nokia.carbide.remoteconnections.internal.registry.Registry; |
|
45 |
import com.nokia.cdt.debug.cw.symbian.SettingsData; |
|
2163 | 46 |
import com.nokia.cdt.internal.debug.launch.LaunchPlugin; |
956 | 47 |
import com.nokia.cdt.internal.debug.launch.wizard.LaunchOptions; |
48 |
import com.nokia.cpp.internal.api.utils.core.TextUtils; |
|
49 |
||
50 |
import cwdbg.PreferenceConstants; |
|
51 |
||
52 |
/** |
|
53 |
* Data manipulated by the launch wizard and its dialogs. |
|
54 |
*/ |
|
55 |
@SuppressWarnings("restriction") |
|
2163 | 56 |
public class LaunchWizardData extends LaunchOptions implements |
57 |
IWizardData, |
|
58 |
IConnectionWizardData, |
|
59 |
IDebugRunProcessWizardData, |
|
60 |
IOtherSettingsWizardData { |
|
1186
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
61 |
/** |
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
62 |
* This plugin is only shipped in internal layouts and is used as a fallback |
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
63 |
* to determine whether Sys TRK is more likely to be available than App TRK |
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
64 |
* if we cannot otherwise tell. |
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
65 |
*/ |
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
66 |
private static final String COM_NOKIA_CARBIDE_SYMSEE_TRK_SUPPORT = "com.nokia.carbide.symsee.trk.support"; |
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
67 |
|
956 | 68 |
public interface IPathValidator { |
69 |
/** |
|
70 |
* @param path IPath |
|
71 |
* @return Error string or <code>null</code> if is valid |
|
72 |
*/ |
|
73 |
String isValidPath(IPath path); |
|
74 |
} |
|
75 |
||
2163 | 76 |
private IService service; |
956 | 77 |
|
78 |
// overall target |
|
79 |
public static class LaunchType { |
|
80 |
private final String launchId; |
|
81 |
||
82 |
public LaunchType(String launchId) { |
|
83 |
this.launchId = launchId; |
|
84 |
} |
|
85 |
||
86 |
public boolean isApplicable(LaunchWizardData data) { |
|
87 |
return true; |
|
88 |
} |
|
89 |
||
90 |
public String getLaunchId() { |
|
91 |
return launchId; |
|
92 |
} |
|
93 |
}; |
|
94 |
||
95 |
public final static LaunchType APP_TRK = new LaunchType(null); |
|
96 |
public final static LaunchType SYS_TRK = new LaunchType(null); |
|
97 |
public final static LaunchType ATTACH_TO_PROCESS_LAUNCH = new LaunchType(null); |
|
98 |
||
99 |
private EExeSelection exeSelection; |
|
100 |
private IPath exeSelectionPath = Path.EMPTY; |
|
101 |
private EBuildBeforeLaunchOption buildBeforeLaunch; |
|
102 |
private boolean installPackage; |
|
103 |
private String sisPath; |
|
104 |
private IConnection connection; |
|
1090 | 105 |
private List<IPath> launchableExes; |
956 | 106 |
|
2163 | 107 |
public LaunchWizardData() { |
956 | 108 |
} |
109 |
||
2163 | 110 |
public void initialize(LaunchOptions launchOptions) { |
956 | 111 |
this.mmps = launchOptions.mmps; |
112 |
this.exes = launchOptions.exes; |
|
113 |
this.defaultExecutable = launchOptions.defaultExecutable; |
|
114 |
this.project = launchOptions.project; |
|
115 |
this.configurationName = launchOptions.configurationName; |
|
116 |
this.isEmulation = launchOptions.isEmulation; |
|
117 |
this.emulatorOnly = launchOptions.emulatorOnly; |
|
118 |
this.mode = launchOptions.mode; |
|
2163 | 119 |
service = LaunchPlugin.getRunModeDebugService(); |
956 | 120 |
} |
121 |
||
122 |
/** |
|
123 |
* @return the service |
|
124 |
*/ |
|
125 |
public IService getService() { |
|
126 |
return service; |
|
127 |
} |
|
128 |
||
129 |
/** |
|
130 |
* @return |
|
131 |
*/ |
|
132 |
public boolean isDebug() { |
|
133 |
return mode.equals(ILaunchManager.DEBUG_MODE); |
|
134 |
} |
|
135 |
||
136 |
public String getModeLabel() { |
|
137 |
if (mode.equals(ILaunchManager.RUN_MODE)) |
|
969 | 138 |
return Messages.getString("LaunchWizardData.RunModeLabel"); //$NON-NLS-1$ |
956 | 139 |
else if (mode.equals(ILaunchManager.DEBUG_MODE)) |
969 | 140 |
return Messages.getString("LaunchWizardData.DebugModeLabel"); //$NON-NLS-1$ |
956 | 141 |
else |
142 |
return TextUtils.titleCase(mode); |
|
143 |
||
144 |
} |
|
145 |
||
146 |
/** |
|
147 |
* Validate the detected and/or configured data |
|
148 |
* @return IStatus, never <code>null</code> |
|
149 |
*/ |
|
150 |
public IStatus validate() { |
|
151 |
return Status.OK_STATUS; |
|
152 |
} |
|
153 |
||
154 |
/** |
|
155 |
* @return |
|
156 |
* @return |
|
157 |
*/ |
|
158 |
public List<IPath> getExes() { |
|
159 |
return exes; |
|
160 |
} |
|
1090 | 161 |
|
162 |
public List<IPath> getLaunchableExes() { |
|
163 |
if (launchableExes == null) { |
|
164 |
launchableExes = new ArrayList<IPath>(); |
|
165 |
for (IPath path : exes) { |
|
166 |
if ("exe".equalsIgnoreCase(path.getFileExtension())) |
|
167 |
launchableExes.add(path); |
|
168 |
} |
|
169 |
} |
|
170 |
return launchableExes; |
|
171 |
} |
|
956 | 172 |
|
173 |
/** |
|
174 |
* @return the defaultExecutable |
|
175 |
*/ |
|
176 |
public IPath getDefaultExecutable() { |
|
177 |
return defaultExecutable; |
|
178 |
} |
|
179 |
||
180 |
/** |
|
181 |
* Set the executable selection mode |
|
182 |
* @param selection |
|
183 |
*/ |
|
184 |
public void setExeSelection(EExeSelection selection) { |
|
185 |
this.exeSelection = selection; |
|
186 |
} |
|
187 |
/** |
|
188 |
* Set the path for the exe |
|
189 |
* @param path or <code>null</code> |
|
190 |
*/ |
|
191 |
public void setExeSelectionPath(IPath path) { |
|
192 |
this.exeSelectionPath = path != null ? path : Path.EMPTY; |
|
193 |
} |
|
194 |
||
195 |
/** |
|
196 |
* @return |
|
197 |
*/ |
|
198 |
public EExeSelection getExeSelection() { |
|
199 |
return exeSelection; |
|
200 |
} |
|
201 |
||
202 |
public IPath getExeSelectionPath() { |
|
203 |
return exeSelectionPath; |
|
204 |
} |
|
205 |
||
206 |
public String getConnectionName() { |
|
207 |
IConnection connection = getConnection(); |
|
208 |
if (connection == null) |
|
209 |
return null; |
|
210 |
return connection.getDisplayName(); |
|
211 |
} |
|
212 |
||
213 |
public void setBuildBeforeLaunchOption( |
|
214 |
EBuildBeforeLaunchOption setting) { |
|
215 |
this.buildBeforeLaunch = setting; |
|
216 |
} |
|
217 |
||
218 |
public EBuildBeforeLaunchOption getBuildBeforeLaunch() { |
|
219 |
return buildBeforeLaunch; |
|
220 |
} |
|
221 |
||
222 |
/** Get current workspace setting */ |
|
223 |
public boolean isWorkspaceBuildBeforeLaunch() { |
|
2163 | 224 |
return WizardDataUtils.isWorkspaceBuildBeforeLaunch(); |
956 | 225 |
} |
226 |
||
227 |
/** Get actual launch-time setting */ |
|
228 |
public boolean isCurrentBuildBeforeLaunch() { |
|
229 |
if (buildBeforeLaunch != EBuildBeforeLaunchOption.USE_WORKSPACE_SETTING) |
|
230 |
return buildBeforeLaunch == EBuildBeforeLaunchOption.ALWAYS; |
|
231 |
return isWorkspaceBuildBeforeLaunch(); |
|
232 |
} |
|
233 |
||
234 |
/** |
|
235 |
* @param selection |
|
236 |
*/ |
|
237 |
public void setInstallPackage(boolean selection) { |
|
238 |
this.installPackage = selection; |
|
239 |
} |
|
240 |
||
241 |
/** |
|
242 |
* @return the installPackage |
|
243 |
*/ |
|
244 |
public boolean isInstallPackage() { |
|
245 |
return installPackage; |
|
246 |
} |
|
247 |
||
248 |
/** |
|
249 |
* @return |
|
250 |
*/ |
|
251 |
public IProject getProject() { |
|
252 |
return project; |
|
253 |
} |
|
254 |
||
255 |
/** |
|
256 |
* @param sisPath |
|
257 |
*/ |
|
258 |
public void setSisPath(String sisPath) { |
|
259 |
this.sisPath = sisPath; |
|
260 |
} |
|
261 |
||
262 |
/** |
|
263 |
* @return |
|
264 |
*/ |
|
265 |
public String getSisPath() { |
|
266 |
return sisPath; |
|
267 |
} |
|
268 |
||
269 |
/** |
|
270 |
* Copy the data, for use by a transient dialog. |
|
271 |
* @return new copy of data |
|
272 |
*/ |
|
273 |
public LaunchWizardData copy() { |
|
274 |
LaunchOptions launchOptions = new LaunchOptions(); |
|
275 |
launchOptions.mmps = mmps; |
|
276 |
launchOptions.exes = exes; |
|
277 |
launchOptions.defaultExecutable = defaultExecutable; |
|
278 |
launchOptions.project = project; |
|
279 |
launchOptions.configurationName = configurationName; |
|
280 |
launchOptions.isEmulation = isEmulation; |
|
281 |
launchOptions.emulatorOnly = emulatorOnly; |
|
282 |
launchOptions.mode = mode; |
|
2163 | 283 |
LaunchWizardData d = new LaunchWizardData(); |
284 |
d.initialize(launchOptions); |
|
956 | 285 |
d.exeSelection = exeSelection; |
286 |
d.exeSelectionPath = exeSelectionPath; |
|
287 |
d.buildBeforeLaunch = buildBeforeLaunch; |
|
288 |
d.installPackage = installPackage; |
|
289 |
d.sisPath = sisPath; |
|
290 |
d.connection = connection; |
|
2163 | 291 |
d.service = service; |
956 | 292 |
return d; |
293 |
} |
|
294 |
||
295 |
/** |
|
296 |
* Apply the given data to the receiver (when a transient dialog is accepted) |
|
297 |
* @param dialogData |
|
298 |
*/ |
|
2163 | 299 |
public void apply(IWizardData launchWizardData) { |
300 |
LaunchWizardData dialogData = (LaunchWizardData) launchWizardData; |
|
956 | 301 |
exeSelection = dialogData.exeSelection; |
302 |
exeSelectionPath = dialogData.exeSelectionPath; |
|
303 |
buildBeforeLaunch = dialogData.buildBeforeLaunch; |
|
304 |
installPackage = dialogData.installPackage; |
|
305 |
sisPath = dialogData.sisPath; |
|
306 |
connection = dialogData.connection; |
|
307 |
} |
|
308 |
||
309 |
/** |
|
310 |
* @return |
|
311 |
*/ |
|
312 |
public boolean requiresInstallPackage() { |
|
1186
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
313 |
return isSysTRKConnection() == Boolean.FALSE /* but not if unknown */ || installPackage; |
956 | 314 |
} |
315 |
||
316 |
public void setConnection(IConnection connection) { |
|
317 |
this.connection = connection; |
|
318 |
} |
|
319 |
||
320 |
public IConnection getConnection() { |
|
321 |
return connection; |
|
322 |
} |
|
323 |
||
324 |
public ILaunchConfigurationWorkingCopy createConfiguration() throws CoreException { |
|
325 |
String launchTypeId = getApplicableLaunchTypeId(); |
|
326 |
ILaunchConfigurationType launchType = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(launchTypeId); |
|
327 |
ILaunchConfigurationWorkingCopy config = launchType.newInstance(null, configurationName); |
|
328 |
initializeConfigSettings(launchTypeId, config); |
|
329 |
||
330 |
return config; |
|
331 |
} |
|
332 |
||
333 |
private void initializeConfigSettings(String launchTypeId, ILaunchConfigurationWorkingCopy config) { |
|
334 |
IPath exePath = getExePath(); |
|
335 |
IPath mmpPath = getMmpPath(exePath); |
|
336 |
if (launchTypeId.equals(SettingsData.APP_TRK_LAUNCH_TYPE_ID)) { |
|
337 |
SettingsData.setDefaults(config, SettingsData.LaunchConfig_AppTRK, project, mmpPath, exePath); |
|
338 |
} |
|
339 |
else if (launchTypeId.equals(SettingsData.SYS_TRK_LAUNCH_TYPE_ID)) { |
|
340 |
SettingsData.setDefaults(config, SettingsData.LaunchConfig_SysTRK, project, mmpPath, exePath); |
|
341 |
} |
|
342 |
else if (launchTypeId.equals(SettingsData.ATTACH_LAUNCH_TYPE_ID)) { |
|
343 |
SettingsData.setDefaults(config, SettingsData.LaunchConfig_AppTRK, project, mmpPath, exePath); |
|
344 |
} |
|
1042
a1a443e77261
bugs 10806 + 10807 fix problems with program to launch
dadubrow
parents:
969
diff
changeset
|
345 |
if (exeSelection.equals(EExeSelection.USE_REMOTE_EXECUTABLE)) |
a1a443e77261
bugs 10806 + 10807 fix problems with program to launch
dadubrow
parents:
969
diff
changeset
|
346 |
SettingsData.setProcessToLaunch(config, exeSelectionPath); |
a1a443e77261
bugs 10806 + 10807 fix problems with program to launch
dadubrow
parents:
969
diff
changeset
|
347 |
|
956 | 348 |
addBuildOptions(config); |
349 |
// always set the current connection id |
|
350 |
config.setAttribute(RemoteConnectionsTRKHelper.CONNECTION_ATTRIBUTE, Registry.CURRENT_CONNECTION_ID); |
|
1069
16060a6479b9
10823 - if installing and launching from E:, install into E: also
dadubrow
parents:
1067
diff
changeset
|
351 |
if (installPackage) { |
956 | 352 |
config.setAttribute(PreferenceConstants.J_PN_SisFileHostPath, sisPath); |
1069
16060a6479b9
10823 - if installing and launching from E:, install into E: also
dadubrow
parents:
1067
diff
changeset
|
353 |
// special case handling for running out of E: drive - install into E: drive |
16060a6479b9
10823 - if installing and launching from E:, install into E: also
dadubrow
parents:
1067
diff
changeset
|
354 |
if (exeSelection.equals(EExeSelection.USE_REMOTE_EXECUTABLE) && |
16060a6479b9
10823 - if installing and launching from E:, install into E: also
dadubrow
parents:
1067
diff
changeset
|
355 |
exeSelectionPath.getDevice().equalsIgnoreCase("E:")) //$NON-NLS-1$ |
16060a6479b9
10823 - if installing and launching from E:, install into E: also
dadubrow
parents:
1067
diff
changeset
|
356 |
config.setAttribute(PreferenceConstants.J_PN_InstallToDrive, 4); // index 4 == E: drive |
16060a6479b9
10823 - if installing and launching from E:, install into E: also
dadubrow
parents:
1067
diff
changeset
|
357 |
} |
956 | 358 |
} |
359 |
||
360 |
private IPath getMmpPath(IPath exePath) { |
|
361 |
if (!mmps.isEmpty()) { |
|
362 |
for (int i = 0; i < exes.size(); i++) { |
|
363 |
IPath exe = exes.get(i); |
|
364 |
if (exe.lastSegment().equals(exePath.lastSegment())) |
|
365 |
return mmps.get(i); |
|
366 |
} |
|
367 |
} |
|
368 |
return null; |
|
369 |
} |
|
370 |
||
1067
856622c7b203
10809 - generating warning for missing sis file or missing exe
dadubrow
parents:
1042
diff
changeset
|
371 |
public IPath getExePath() { |
1042
a1a443e77261
bugs 10806 + 10807 fix problems with program to launch
dadubrow
parents:
969
diff
changeset
|
372 |
// if attach, doesn't matter so return first exe |
956 | 373 |
if (exeSelection.equals(EExeSelection.ATTACH_TO_PROCESS)) |
1042
a1a443e77261
bugs 10806 + 10807 fix problems with program to launch
dadubrow
parents:
969
diff
changeset
|
374 |
return exes.isEmpty() ? Path.EMPTY : exes.get(0); |
a1a443e77261
bugs 10806 + 10807 fix problems with program to launch
dadubrow
parents:
969
diff
changeset
|
375 |
|
a1a443e77261
bugs 10806 + 10807 fix problems with program to launch
dadubrow
parents:
969
diff
changeset
|
376 |
// otherwise, see if we can use the selected path - process to launch string |
a1a443e77261
bugs 10806 + 10807 fix problems with program to launch
dadubrow
parents:
969
diff
changeset
|
377 |
// by checking if the file name matches any of the ones in our list of exes |
a1a443e77261
bugs 10806 + 10807 fix problems with program to launch
dadubrow
parents:
969
diff
changeset
|
378 |
String filename = exeSelectionPath.lastSegment(); |
1090 | 379 |
if (filename != null) { |
380 |
for (IPath exePath : exes) { |
|
381 |
if (filename.equalsIgnoreCase(exePath.lastSegment())) { |
|
382 |
return exePath; |
|
383 |
} |
|
1042
a1a443e77261
bugs 10806 + 10807 fix problems with program to launch
dadubrow
parents:
969
diff
changeset
|
384 |
} |
a1a443e77261
bugs 10806 + 10807 fix problems with program to launch
dadubrow
parents:
969
diff
changeset
|
385 |
} |
a1a443e77261
bugs 10806 + 10807 fix problems with program to launch
dadubrow
parents:
969
diff
changeset
|
386 |
// none could be found matching the selected path, so use the first in the list |
1090 | 387 |
return getLaunchableExes().isEmpty() ? Path.EMPTY : getLaunchableExes().get(0); |
956 | 388 |
} |
389 |
||
390 |
private IConnectedService getConnectedService() { |
|
391 |
if (connection != null) { |
|
392 |
Collection<IConnectedService> connectedServices = |
|
393 |
RemoteConnectionsActivator.getConnectionsManager().getConnectedServices(connection); |
|
394 |
for (IConnectedService connectedService : connectedServices) { |
|
1968
3482df86a51d
Remove TRK service and replace with TCF TRK service. Remove wildcard service check used as an interim when TCF TRK and TRK were both options.
Ed Swartz <ed.swartz@nokia.com>
parents:
1780
diff
changeset
|
395 |
if (service != null && connectedService.getService().getIdentifier().equals(service.getIdentifier())) |
956 | 396 |
return connectedService; |
397 |
} |
|
398 |
} |
|
399 |
return null; |
|
400 |
} |
|
401 |
||
1186
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
402 |
/** Tell whether we can detect that the current connection is Sys TRK. |
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
403 |
* |
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
404 |
* @return Boolean.TRUE if Sys TRK, Boolean.FALSE if App TRK, or <code>null</code> if unknown |
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
405 |
*/ |
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
406 |
public Boolean isSysTRKConnection() { |
956 | 407 |
IConnectedService connectedService = getConnectedService(); |
408 |
if (connectedService instanceof IConnectedService2) { |
|
2023
54aa500f40cd
Add check for CODA sys/app property
Ed Swartz <ed.swartz@nokia.com>
parents:
1968
diff
changeset
|
409 |
// C3TRK: old name |
956 | 410 |
String value = ((IConnectedService2) connectedService).getProperties().get("is-system-trk"); //$NON-NLS-1$ |
1189
9efa81cf79bf
Don't assume App TRK if service has no value at all for 'is-sys-trk' property
Ed Swartz <ed.swartz@nokia.com>
parents:
1186
diff
changeset
|
411 |
if (value != null) { |
9efa81cf79bf
Don't assume App TRK if service has no value at all for 'is-sys-trk' property
Ed Swartz <ed.swartz@nokia.com>
parents:
1186
diff
changeset
|
412 |
return Boolean.parseBoolean(value); |
9efa81cf79bf
Don't assume App TRK if service has no value at all for 'is-sys-trk' property
Ed Swartz <ed.swartz@nokia.com>
parents:
1186
diff
changeset
|
413 |
} |
2023
54aa500f40cd
Add check for CODA sys/app property
Ed Swartz <ed.swartz@nokia.com>
parents:
1968
diff
changeset
|
414 |
|
54aa500f40cd
Add check for CODA sys/app property
Ed Swartz <ed.swartz@nokia.com>
parents:
1968
diff
changeset
|
415 |
// new name |
54aa500f40cd
Add check for CODA sys/app property
Ed Swartz <ed.swartz@nokia.com>
parents:
1968
diff
changeset
|
416 |
value = ((IConnectedService2) connectedService).getProperties().get("is-system-debugger"); //$NON-NLS-1$ |
54aa500f40cd
Add check for CODA sys/app property
Ed Swartz <ed.swartz@nokia.com>
parents:
1968
diff
changeset
|
417 |
if (value != null) { |
54aa500f40cd
Add check for CODA sys/app property
Ed Swartz <ed.swartz@nokia.com>
parents:
1968
diff
changeset
|
418 |
return Boolean.parseBoolean(value); |
54aa500f40cd
Add check for CODA sys/app property
Ed Swartz <ed.swartz@nokia.com>
parents:
1968
diff
changeset
|
419 |
} |
956 | 420 |
} |
1186
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
421 |
|
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
422 |
return null; |
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
423 |
} |
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
424 |
|
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
425 |
/** |
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
426 |
* Tell whether Carbide is running in an internal layout. |
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
427 |
* @return true if the installation includes known internal-only plugins |
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
428 |
*/ |
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
429 |
public boolean isInternalLayout() { |
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
430 |
Bundle bundle = Platform.getBundle(COM_NOKIA_CARBIDE_SYMSEE_TRK_SUPPORT); |
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
431 |
if (bundle != null) { |
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
432 |
// assume this is an internal build |
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
433 |
return true; |
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
434 |
} |
956 | 435 |
return false; |
436 |
} |
|
437 |
||
438 |
private String getApplicableLaunchTypeId() { |
|
439 |
if (exeSelection.equals(EExeSelection.ATTACH_TO_PROCESS)) |
|
440 |
return SettingsData.ATTACH_LAUNCH_TYPE_ID; |
|
1186
067198a8221d
Bug 11067: fix some issues with the PNP launch wizard
Ed Swartz <ed.swartz@nokia.com>
parents:
1090
diff
changeset
|
441 |
else if (!installPackage) |
956 | 442 |
return SettingsData.SYS_TRK_LAUNCH_TYPE_ID; |
443 |
else |
|
444 |
return SettingsData.APP_TRK_LAUNCH_TYPE_ID; |
|
445 |
} |
|
446 |
||
447 |
private void addBuildOptions(ILaunchConfigurationWorkingCopy config) { |
|
448 |
int buildBeforeLaunchValue = ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_USE_WORKSPACE_SETTING; |
|
449 |
switch (buildBeforeLaunch) { |
|
450 |
case NEVER: |
|
451 |
buildBeforeLaunchValue = ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_DISABLED; |
|
452 |
break; |
|
453 |
case ALWAYS: |
|
454 |
buildBeforeLaunchValue = ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_ENABLED; |
|
455 |
break; |
|
456 |
} |
|
457 |
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_BUILD_BEFORE_LAUNCH, buildBeforeLaunchValue); |
|
458 |
} |
|
2163 | 459 |
|
956 | 460 |
} |
461 |