Possible Duplicate:
How can I bind a specific key to different launch configurations in Eclipse?
I am launching certain programs many times from the little dropdown menu next to the green run-button in eclipse.
Is there a way to bind keys (like F1 - F12) to those run configurations?
I couldnt find something like this in the preferences under "Keys".
the main preference page can be found under window > preferences > general > keys (or faster: press ctrl+3 , type keys and press enter ). from here you can see all commands and assign/change their associated keyboard shortcuts.
In Eclipse you can duplicate a codeline via the shortcut CTRL+ALT+Up/Down.
Pressing Ctrl + Shift + L will open the current list of defined shortcuts, again pressing Ctrl + Shift + L will open preference page from where the shortcuts can be modified. Save this answer.
Open project, file, etc. Ctrl+Shift+R. Open Resource (file, folder or project) Alt+Enter. Show and access file properties.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With