当您设置 Eclipse 插件首选项页面时,是否可以在 FieldEditors 之间添加某种文本或分隔线?
@Override
protected void createFieldEditors() {
addField( new SomeFieldEditor(....));
addField( new SomeFieldEditor(....));
}
最佳答案
你可以使用类似的东西:
Label label = new Label(getFieldEditorParent(), SWT.NONE);
label.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 3, 1));
添加一个空白,例如,或
Label label = new Label(getFieldEditorParent(), SWT.SEPARATOR | SWT.HORIZONTAL);
label.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 3, 1));
添加水平分隔符。
这假设您使用GRID
布局。您可能需要调整 GridData
中的“3”,具体取决于字段编辑器最终使用的列数。
关于java - Eclipse-Plugin:FieldEditor 之间的分隔线可能吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27105232/