简体   繁体   English

具有多个数组的Eclipse首选项页面

[英]Eclipse preference page with multiple arrays

I tried to search the internet for examples for doing that, but can not find a good one. 我试图在互联网上搜索有关此操作的示例,但找不到一个很好的示例。 Also I checking eclipse IDE source code, but it's a bit too big to filter out what I need for an example. 我也检查了eclipse IDE源代码,但是它太大了,无法过滤出我需要的示例。

What I would need is something similar to Eclipse File Association page below. 我需要的是类似于下面的Eclipse File Association页面的东西。

My plan is later to replace File types list with a combo and add more values/controls per combo selection. 我的计划是稍后用组合替换“文件类型”列表,并为每个组合选择添加更多值/控件。

I would be very thankful for an example or a link to an example that does that or has a same concept with working preference store. 对于一个示例或指向该示例的链接或与工作首选项存储具有相同概念的示例,我将非常感谢。

Thank you! 谢谢!

在此处输入图片说明

Well, I think that it is nothing more then simple preferences page with two Lists which just represents conformity between file types and editors. 好吧,我认为这不过是带有两个Lists简单首选项页面,该Lists仅表示文件类型和编辑器之间的一致性。 The example how to implement your own preferences page is here: Eclipse Preferences - Tutorial 下面是如何实现自己的首选项页面的示例: Eclipse Preferences-Tutorial

If you want to have Combo - there is no problem - you just replace upper ListEditor woth your ComboFieldEditor and proceed with adding more conrols. 如果你想拥有Combo -没有问题-您只需更换上ListEditor woth您ComboFieldEditor ,并增加更多的conrols进行。 The file associations are stored in Eclipse preferences and you can access them whenever you try to open some file to retrieve corresponding editor. 文件关联存储在Eclipse首选项中,只要您尝试打开某些文件以检索相应的编辑器,就可以访问它们。

You can take a look at the Google Eclipse plugin source code. 您可以看一下Google Eclipse插件的源代码。 I had to achieve something similar to your needs, and inspired myself from there . 我必须达到与您的需求相似的目标,并从那里得到启发。 It is properly designed. 设计正确。 You can take a look at the repository right here . 您可以在这里查看存储库。

In my case, I needed checkboxes instead of combos, and used a CheckboxTableViewer from the JFace library, there are plenty of example onlines (eg: JFace snippets ). 就我而言,我需要复选框而不是组合框,并且使用了JFace库中的CheckboxTableViewer,在线上有很多示例(例如: JFace代码片段 )。 As Alex said, first, works on Eclipse preferences concept... when you got it, it will just stay some pure UI tasks. 正如Alex所说,首先,它基于Eclipse首选项概念……当您了解它时,它将仅保留一些纯UI任务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM