【问题标题】:Eclipse Plugin: Is there a way to get the External Tools Configurations Tree?Eclipse 插件:有没有办法获取外部工具配置树?
【发布时间】:2016-09-27 10:11:25
【问题描述】:

有没有办法获得“外部工具配置...”窗口的橙色突出显示树(见 img)?

如果没有,我可以使用官方 Eclipse-API 的哪些类来构建自己的 TreeViewer?

这个问题here: Eclipse Plugin - get Launch Configurations Tree List in a Dialog 和我的差不多。在那里,给出了官方的 Eclipse-API 类。另一种方法是使用LaunchConfigurationFilteredTree,即使它不是官方API。 ExternalTools 有类似的类吗?

【问题讨论】:

    标签: java eclipse eclipse-plugin eclipse-rcp launch-configuration


    【解决方案1】:

    外部工具对话框仍然只是启动配置,但仅显示启动配置属于 org.eclipse.ui.externaltools.launchGroup 启动组的配置。

    像往常一样,Eclipse 代码非常复杂,但您可以使用启动组获取

    ILaunchGroup [] groups = DebugUITools.getLaunchGroups();
    

    从你得到的数组中找到具有正确 id 的组。

    您可以通过

    获取ILaunchConfiguration 的启动组
    ILaunchGroup group = DebugUITools.getLaunchGroup(config, mode);
    

    对于外部工具,模式始终为 "run"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-09-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-26
      相关资源
      最近更新 更多