如何以编程方式获取所有当前 运行ning LaunchConfigurations(运行- 和调试模式)?

How to get all current running LaunchConfigurations (run- and debugmode) programmatically?

我正在尝试编写一个 Eclipse 插件,它获取所有当前的 运行ning LaunchConfigurations(运行- 和调试模式)并从后面终止它们(参见 img.1.1)。 我知道 class ILaunchConfiguration 中有一个 terminate() 方法,但我认为这不是我要找的。

[图片。 1.1] 这是 LaunchConfigurations 的示例(第二个和第三个处于调试模式),我想从最后到第一个终止。

一如既往地感谢您的帮助!

从启动管理器获取当前启动的列表并终止活动进程。

类似于:

ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();

ILaunch [] launches = manager.getLaunches();

for (ILaunch launch : launches) {
   IProcess [] processes = launch.getProcesses();

   for (IProcess process : processes) {
      if (process.canTerminate()) {
         process.terminate();
      }
   } 
}