public void createUIConventional(Composite parent) {
parent.setLayout(GridLayoutFactory.swtDefaults().numColumns(3).create());
Label label = new Label(parent, SWT.NONE);
label.setText("Selection");
ComboViewer viewer = new ComboViewer(parent, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
customizeComboViewer(viewer);
viewer.getCombo().setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Button button = new Button(parent, SWT.NONE);
button.setText("Apply");
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
text.setText("Selection: " + viewer.getCombo().getText());
}
});
text = new Text(parent, SWT.READ_ONLY | SWT.BORDER);
text.setLayoutData(
GridDataFactory.swtDefaults().span(3, 1).grab(true, true).align(SWT.FILL, SWT.FILL).create());
}
HelloWorld.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:lambda-ui
作者:
评论列表
文章目录