答案 0 :(得分:1)
您可以使用足够的中间复合材料使用GridLayout
进行此操作:
// Assumes 'parent' has FillLayout which will be the case for an e4 part
Composite outer = new Composite(parent, SWT.NONE);
outer.setLayout(new GridLayout());
Composite intermediate = new Composite(outer, SWT.NONE);
intermediate.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
intermediate.setLayout(new GridLayout());
Composite inner = new Composite(intermediate, SWT.NONE);
inner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
inner.setLayout(new GridLayout(4, false));
Label label1 = new Label(inner, SWT.LEAD);
label1.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
label1.setText("TopLevelPath");
Text text1 = new Text(inner, SWT.SINGLE | SWT.BORDER);
text1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
Label endLabel = new Label(inner, SWT.PUSH);
endLabel.setText("but1");
endLabel = new Label(inner, SWT.PUSH);
endLabel.setText("but2");
Label label2 = new Label(inner, SWT.LEAD);
label2.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
label2.setText("Alt TopLevelPath (optional)");
Text text2 = new Text(inner, SWT.SINGLE | SWT.BORDER);
text2.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));