debuggercdi/com.nokia.cdt.debug.launch/src/com/nokia/cdt/internal/debug/launch/BoardLaunchShortcut.java
author Ed Swartz <ed.swartz@nokia.com>
Wed, 21 Apr 2010 15:10:34 -0500
changeset 1260 f3b387a17eb7
parent 1171 651ae39eb566
permissions -rw-r--r--
Merge PlatSim changes from 2.x, but move ILaunchDelegateConnectionExtension into com.nokia.cdt.debug.common so EDC can use it
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
956
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
     1
/*
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
     3
* All rights reserved.
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
     4
* This component and the accompanying materials are made available
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
     6
* which accompanies this distribution, and is available
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
     8
*
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
     9
* Initial Contributors:
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    11
*
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    12
* Contributors:
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    13
*
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    14
* Description: 
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    15
*
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    16
*/
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    17
package com.nokia.cdt.internal.debug.launch;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    18
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    19
import org.eclipse.cdt.debug.core.executables.Executable;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    20
import org.eclipse.core.resources.IProject;
1171
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 956
diff changeset
    21
import org.eclipse.core.runtime.CoreException;
956
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    22
import org.eclipse.core.runtime.IPath;
1171
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 956
diff changeset
    23
import org.eclipse.debug.core.ILaunchConfiguration;
956
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    24
1171
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 956
diff changeset
    25
import com.nokia.cdt.debug.cw.symbian.SettingsData;
956
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    26
import com.nokia.cdt.internal.debug.launch.LaunchPlugin.ILaunchCreationWizardFactory;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    27
import com.nokia.cdt.internal.debug.launch.wizard.AbstractLaunchWizard;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    28
import com.nokia.cdt.internal.debug.launch.wizard.ILaunchCreationWizard;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    29
import com.nokia.cdt.internal.debug.launch.wizard.LaunchCreationWizard;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    30
import com.nokia.cdt.internal.debug.launch.wizard.LaunchCreationWizardInstance;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    31
import com.nokia.cdt.internal.debug.launch.wizard.LaunchOptions;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    32
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    33
public class BoardLaunchShortcut extends AbstractSymbianLaunchShortcut {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    34
	
1171
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 956
diff changeset
    35
	/* (non-Javadoc)
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 956
diff changeset
    36
	 * @see com.nokia.cdt.internal.debug.launch.AbstractSymbianLaunchShortcut#isSupportedConfiguration(org.eclipse.debug.core.ILaunchConfiguration)
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 956
diff changeset
    37
	 */
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 956
diff changeset
    38
	@Override
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 956
diff changeset
    39
	protected boolean isSupportedConfiguration(ILaunchConfiguration config)
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 956
diff changeset
    40
			throws CoreException {
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 956
diff changeset
    41
		return SettingsData.isStopModeConfiguration(config);
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 956
diff changeset
    42
	}
651ae39eb566 Bug 11013: choose appropriate launch configs when using Run/Debug As... shortcut and show selection when more than one is available.
Ed Swartz <ed.swartz@nokia.com>
parents: 956
diff changeset
    43
	
956
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    44
	@Override
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    45
	protected void launchProject(IProject project, Executable executable, IPath defaultMMP, String mode) {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    46
		LaunchPlugin.getDefault().launchProject(project, executable, defaultMMP, mode, 
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    47
																new ILaunchCreationWizardFactory() {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    48
			public ILaunchCreationWizard createLaunchCreationWizard(LaunchOptions launchOptions) throws Exception {
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    49
				LaunchCreationWizard creationWizard = 
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    50
					LaunchCreationWizardInstance.getInstance().create(
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    51
						launchOptions.project, 
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    52
						launchOptions.configurationName, 
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    53
						launchOptions.mmps,
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    54
						launchOptions.exes,
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    55
						launchOptions.defaultExecutable,
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    56
						launchOptions.isEmulation,
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    57
						launchOptions.emulatorOnly,
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    58
						launchOptions.mode);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    59
				creationWizard.setCategoryId(AbstractLaunchWizard.BOARD_CATEGORY_ID);
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    60
				return creationWizard;
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    61
			}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    62
		});
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    63
	}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    64
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    65
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    66
}
d1e221a2875f new launch wizard implementation
dadubrow
parents:
diff changeset
    67