문제

I did it to create simple radio buttons:

RadioGroupFieldEditor settingsSourceEditor =
    new RadioGroupFieldEditor("abc", "", 1, new String[][] {
                                                { "Read settings from BIS-Installation directory", "1"" },
                                                { "Manually specify settings", "'" } },
                              container);

But i want to extend it to be able to enable or disable the corresponding group of elements. The example of how it should look down below (except that both of radio buttons should have child elements):

example

Is there any functionality to add child elements like that or do I have to write my own sub-class to have it work like I want?

도움이 되었습니까?

해결책

Looking at the RadioGroupFieldEditor source there is no functionality to add child elements. It also doesn't look easy to sub-class.

The example you show from the General preferences page (org.eclipse.ui.internal.dialogs.WorkbenchPreferencePage) does not use field editors to display the preferences, instead it just uses normal Button controls. Using normal controls is OK in a preferences page but you have to manage loading and saving the preferences in your code.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top