使用SWT eclipse在Java中编辑GridData?

使用SWT eclipse在Java中编辑GridData?,java,swt,Java,Swt,我得到了一个使用GridData的代码,如下所示: public DetailView(Composite parent) { carModel = new Composite(parent, SWT.NONE); carModel.setLayoutData(new GridData(GridData.FILL_BOTH)); carModel.setLayout(new GridLayout()); } public void constru

我得到了一个使用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. <代码>setCellModifier()
但我不确定参数。任何帮助???

GridData
与单元格内容完全无关,它只是告诉您整个表应该如何放置在父组合中。如果要更改表的布局,请阅读


如果您想让用户更改单元格内容,请阅读。

谢谢,真的很有帮助。SWT初学者。