【问题标题】:How to create new instance of ILaunchConfiguration or ILaunch?如何创建 ILaunchConfiguration 或 ILaunch 的新实例?
【发布时间】:2012-10-16 13:30:31
【问题描述】:

目前我的插件可以通过创建相应的启动配置然后按“运行”来启动。现在我想扩展插件,以便可以右键单击文件并在所选文件上运行插件。相应地扩展菜单已经有效。

但是,现在我需要一个 ILaunchConfiguration 实例(或至少一个 ILaunch 实例)来输入我现有的设置。然后从 ILaunch 对象中获取进程并开始通信。

如何根据已知的默认设置和特定的输入文件创建新的 ILaunchConfiguration?我没有看到任何可以使用的公共构造函数。

谢谢!

【问题讨论】:

    标签: eclipse-plugin


    【解决方案1】:

    以下是ILaunchConfiguration的获取方式:

    ILaunchManager mgr = DebugPlugin.getDefault().getLaunchManager();
    ILaunchConfigurationType lct = mgr.getLaunchConfigurationType(IOpcodeConstants.LAUNCH_CFG_TYPE);
    ILaunchConfiguration[] lcs = mgr.getLaunchConfigurations(lct);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-16
      相关资源
      最近更新 更多