2012-07-18 91 views
0

我得到了它使用的GridData代碼如下所示:使用SWT eclipse在Java中編輯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. setCellEditor() 2. setCellModifier() 但我不確定參數。任何幫助?

回答