Eclipse: add keyboard shortcuts to specific launch configurations

Possible duplicate:
How to associate a specific key with various startup configurations in Eclipse?

I launch certain programs many times from the small drop-down menu next to the green start button in the eclipse.

Is there a way to associate keys (e.g. F1 - F12) with these startup configurations?

I could not find something like this in the settings in the "Keys" section.

+8
eclipse
source share
1 answer

There is currently no way to bind to a specific launch configuration (without writing the plugin code yourself). Here's an example of going into a launch configuration by 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 should write a command that provides an option to select a name, and defines org.eclipse.core.commands.IParameterValues so you can see all of your startup configurations on the Keys preferences page.

F11 - Debug Last Launched and CTRL+F11 starts from the last run. You may need to set the preference in Settings> Launch / Debug> Launch to "Always run previously launched application." But this will just launch the latter, and not switch between launches.

+10
source share

All Articles