简体   繁体   English

重新定位FieldEditor

[英]Relocate FieldEditor

I'm creating a preference page for my eclipse plugin. 我正在为我的eclipse插件创建一个首选项页面。 For this purpose I make use of the FieldEditor to give the user the chance to edit properties (I have subclassed the needed FieldEditors). 为此,我利用FieldEditor为用户提供了编辑属性的机会(我将所需的FieldEditor子类化了)。
However I want to be able to relocate the created FieldEditors meaning that I want to put them on a different container after they have been created. 但是,我希望能够重新定位创建的FieldEditor,这意味着我想在创建它们之后将它们放置在其他容器中。

As a FieldEditor is no GUI-class I can't take it and set it to a different parent (at least I haven't found any functionality like that). 由于FieldEditor不是GUI类,因此我无法将其设置为其他父级(至少我没有找到类似的功能)。

The next idea I had was to get all the GUI-elements of the respective editor (label, etc.) but that seems quite hard as well. 我的下一个想法是获取相应编辑器(标签等)的所有GUI元素,但这似乎也很困难。

What's the proper wy of relocating such an FieldEditor and if there is no such functionality is there a way of getting all GUI-elements to replace them manually? 重新放置这种FieldEditor的适当方法是什么,如果没有这种功能,是否有办法让所有GUI元素手动替换?

Edit 编辑
I'm not using a FieldEditorPreferencePage. 我没有使用FieldEditorPreferencePage。 I'm using my own PreferencePage and use the FieldEditors on top of that. 我正在使用自己的PreferencePage并在其之上使用FieldEditors。

If you want a more complex layout than the simple list provided by FieldEditorPreferencePage you need to just extend PreferencePage and create normal SWT controls in the page rather than using field editors. 如果您想要比FieldEditorPreferencePage提供的简单列表更复杂的布局,则只需扩展PreferencePage并在页面中创建常规SWT控件即可,而不是使用字段编辑器。

Use the getPreferenceStore() call to get the IPreferenceStore to load and save the individual preference values. 使用getPreferenceStore()调用获取IPreferenceStore来加载和保存各个首选项值。

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

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