eclipse:在特定的启动配置上放置键盘快捷键

cla*_*amp 8 eclipse

可能重复:
如何将特定键绑定到Eclipse中的不同启动配置?

我从eclipse中绿色运行按钮旁边的小下拉菜单中多次启动某些程序.

有没有办法将键(如F1-F12)绑定到那些运行配置?

我在"钥匙"下的偏好中找不到这样的东西.

Pau*_*ter 10

目前没有办法绑定到特定的启动配置(没有自己编写插件代码).这是一个走动发射配置寻找命名的例子:

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;
    }

}
Run Code Online (Sandbox Code Playgroud)

从理论上讲,您可以编写一个命令,该命令提供一个参数来选择名称,并定义一个命令,org.eclipse.core.commands.IParameterValues以便您可以在Keys首选项页面中看到所有启动配置.

F11上次启动的调试,CTRL+F11上次运行的.您可能必须在"首选项">"运行/调试">"启动 " 中将"首选项"设置为"始终启动先前启动的应用程序".但这只会启动最后一次,而不是在启动之间切换.