Eclipse插件 - 在对话框中获取启动配置树列表。 [英] Eclipse Plugin - get Launch Configurations Tree List in a Dialog.

查看:200
本文介绍了Eclipse插件 - 在对话框中获取启动配置树列表。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将RunConfigurations ...窗口的红色部分(参见img 1.1)
转换为TitleAreaDialog(请参阅img 1.2)。
最终结果应如下所示:(见img 1.3)



img 1.1



img 1.3



使用插件Spy我发现了一些有用的信息:
在LaunchConfigurationsDialog中创建了运行配置...窗口(img 1.1),该类具有LaunchConfigurationView作为属性(注意:此属性是一个类)。
在这个私有属性中,你会发现一个LaunchConfigurationFilteredTree属性(注意:另一个类)。



我认为,最后一个属性就是我寻找。但是我无法确定哪些方法可以重写,以便在我的CustomTitleAreaDialog中显示所有启动配置的FilteredTreeList。



提前感谢您的帮助!

解决方案

所有类您发现这些包含在内部包中,因此不是Eclipse API的一部分(请参阅 Eclipse API参与规则)。这些类可能会随时更改您的插件。



视图的核心使用官方API。



首先得到 ILaunchManager

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

树的根元素是 ILaunchConfigurationType 条目:

  ILaunchConfigurationType [] allTypes = manager.getLaunchConfigurationTypes(); 

ILaunchConfigurationType 的子项是实际的 ILaunchConfiguration 启动配置对象:

  ILaunchConfiguration [ ] configs = manager.getLaunchConfigurations(configType); 

如果您使用这些方法构建一个 TreeViewer 你会没事的。


I'm currently trying to get the red part of the "RunConfigurations..." window, (see img 1.1) into an TitleAreaDialog (see img 1.2). The final result should look like this: (see img 1.3)

img 1.1 img 1.2

img 1.3

With the plugin "Spy" I found some useful information: The "Run Configurations..." window (img 1.1) is created in the class: "LaunchConfigurationsDialog" which has a "LaunchConfigurationView" as an attribute (note: this attribute is a class). Within this private attribute you find a "LaunchConfigurationFilteredTree" attribute (note: yet another class).

I think, that this last attribute is what I'm looking for. But I can't figure out which methods I have to override to be able to show this FilteredTreeList with all Launch Configurations in my CustomTitleAreaDialog.

Thanks in advance for your help!

解决方案

All the classes you have found are in internal packages and are therefore not part of the Eclipse API (see Eclipse API Rules of Engagement). These classes may be changed at any time breaking your plug-in.

The core of the view does use official APIs.

First it gets the ILaunchManager:

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

The root elements of the tree are the ILaunchConfigurationType entries:

ILaunchConfigurationType [] allTypes = manager.getLaunchConfigurationTypes();

The children of ILaunchConfigurationType are the actual ILaunchConfiguration launch configuration objects:

ILaunchConfiguration [] configs = manager.getLaunchConfigurations(configType);

If you build a TreeViewer using these methods you will be OK.

这篇关于Eclipse插件 - 在对话框中获取启动配置树列表。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆