我得到了一个使用 GridData 的代码,如下所示:
public DetailView(Composite parent) {
carModel = new Composite(parent, SWT.NONE);
carModel.setLayoutData(new GridData(GridData.FILL_BOTH));
carModel.setLayout(new GridLayout());
}
public void constructView() {
carModelViewer = new TableViewer(carModelComposite, SWT.BORDER);
CarModelProvider = new carModelContentProvider();
carModelViewer.setContentProvider(carModelProvider);
carModelViewer.setLabelProvider(new CarModelLabelProvider());
Table carModel = carModelViewer.getTable();
carModel.setHeaderVisible(true);
carModel.setLinesVisible(true);
carModel.setLayoutData(new GridData(GridData.FILL_BOTH));
TableColumn carModelColumn = new TableColumn(carModel, SWT.LEFT);
carModelColumn.setText("Model:");
carModel.pack();
}
我想知道是否可以在应用程序的 UI 中编辑单元格。我尝试阅读API并找到两种方法:1。2 setCellEditor()
。setCellModifier()
但不确定参数。有什么帮助吗??