私は愚かな何かを逃しているに違いありません。ドキュメントには、RowLayoutレイアウトのRowDataオブジェクトで最小サイズ(幅と高さ)を指定できることが明確に記載されています。これは理にかなっています。ただし、基になるウィジェットがこのサイズを超えると、サイズは増加せず、ウィジェットはトリミングされます。それは本当に最小限ですか?
例
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("Example");
shell.setBounds(100, 100, 325, 200);
shell.setLayout(new FillLayout());
Composite comp = new Composite(shell, SWT.BORDER);
comp.setLayout(new RowLayout(SWT.VERTICAL));
Label label1 = new Label(comp, SWT.CENTER);
label1.setLayoutData(new RowData(20,20));
label1.setText("Trying with bounded rowdata...");
Label label2 = new Label(comp, SWT.CENTER);
label2.setText("Trying with no rowdata...");
comp.layout(true,true); // no difference
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
結果: