Currently there's no way to bind to a specific launch config (without writing the plugin code yourself). Here's an example of walking the launch configs looking for a named one:
public class LaunchRunAwayHandler extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
try {
final ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfiguration toLaunch = null;
for (ILaunchConfiguration config :launchManager.getLaunchConfigurations()) {
System.out.println(config.getName());
if (config.getName().equals("RunAway")) {
toLaunch = config;
}
}
DebugUITools.launch(toLaunch, ILaunchManager.RUN_MODE);
} catch (CoreException e) {
throw new ExecutionException("Failed to launch", e);
}
return null;
}
}
In theory, you would write a command that provides takes a parameter to pick the name, and defines an org.eclipse.core.commands.IParameterValues
so you could see all of your launch configs in the Keys preference page.
F11
is Debug Last Launched and CTRL+F11
is Run Last Launched. You might have to set a preference in Preferences>Run/Debug>Launching to "Always launch the previously launched application". But that will just launch the last one, not switch between launches.