gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 07:10:14 26 4
gpt4 key购买 nike

这个问题在这里已经有了答案:




10年前关闭。




Possible Duplicate:
How can I bind a specific key to different launch configurations in Eclipse?



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

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

我在“键”下的首选项中找不到类似的东西。

最佳答案

目前无法绑定(bind)到特定的启动配置(无需自己编写插件代码)。这是一个遍历启动配置以查找命名配置的示例:

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

}

理论上,您会编写一个命令,提供一个参数来选择名称,并定义一个 org.eclipse.core.commands.IParameterValues这样您就可以在 Keys 首选项页面中看到所有启动配置。
F11是上次启动的调试和 CTRL+F11是上次启动时运行。您可能必须在 Preferences>Run/Debug>Launching 中将首选项设置为“始终启动以前启动的应用程序”。但这只会启动最后一个,而不是在启动之间切换。

关于eclipse:将键盘快捷键放在特定的启动配置上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6015510/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com