TableViewerColumn column0 = new TableViewerColumn(viewer, SWT.NONE);
column0.getColumn().setText("Type");
column0.getColumn().setResizable(true);
column0.getColumn().setWidth(100);
tableLayout.setColumnData(column0.getColumn(), new ColumnWeightData(20, 100));
column0.setLabelProvider(new CellLabelProvider() {
@Override
public void update(ViewerCell cell) {
try{
cell.setText(property.getTypeAsString());
cell.setForeground(greyColor);
} catch(Exception e) {
cell.setText("n/a");
cell.setForeground(greyColor);
}
}
});
TableViewerColumn column1 = new TableViewerColumn(viewer, SWT.NONE);
column1.getColumn().setText("Value");
column1.getColumn().setResizable(true);
column1.getColumn().setWidth(200);
tableLayout.setColumnData(column1.getColumn(), new ColumnWeightData(80, 200));
column1.setLabelProvider(new CellLabelProvider() {
@Override
public void update(ViewerCell cell) {
Line line = (Line) cell.getElement();
cell.setText(line.getValue());