Source:
<code>private void initializeAppearColorTableColumns(Composite tableComposite) { final TableViewerColumn labelColumn= new TableViewerColumn(fAppearanceColorTableViewer, SWT.NONE, 0); <START> final TableViewerColumn colorPreviewColumn= new TableViewerColumn(fAppearanceColorTableViewer, SWT.NONE, 1); <END> TableColumnLayout tableColumnLayout= new TableColumnLayout(true); PixelConverter pixelConverter= new PixelConverter(tableComposite.getParent().getFont()); tableColumnLayout.setColumnData(labelColumn.getColumn(), new ColumnWeightData(1, pixelConverter.convertWidthInCharsToPixels(30))); tableColumnLayout.setColumnData(colorPreviewColumn.getColumn(), new ColumnWeightData(0, pixelConverter.convertWidthInCharsToPixels(5))); labelColumn.setLabelProvider(new ColumnLabelProvider() { @Override public String getText(Object element) { return ((String[]) element)[0]; } }); colorPreviewImages= new ArrayList<>(); colorPreviewColumn.setLabelProvider(new ColumnLabelProvider() { @Override public Image getImage(Object element) { int dimensions= 10; String key= ((String[]) element)[1]; RGB rgb= PreferenceConverter.getColor(fOverlayStore, key); Color color= new Color(tableComposite.getParent().getDisplay(), rgb.red, rgb.green, rgb.blue); Image image= new Image(tableComposite.getParent().getDisplay(), dimensions, dimensions); GC gc= new GC(image); gc.setBackground(color); gc.fillRectangle(0, 0, dimensions, dimensions); gc.setBackground(new Color(tableComposite.getParent().getDisplay(), 0, 0, 0)); gc.setLineWidth(2); gc.drawRectangle(0, 0, dimensions, dimensions); gc.dispose(); colorPreviewImages.add(image); return image; } @Override public String getText(Object element) { return null; } }); tableComposite.setLayout(tableColumnLayout); }</code><technical_language>Instead of 2 columns, simply LabelProvider returning preview in getImage()</technical_language>

Target:
private void initializeAppearColorTableColumns(Composite tableComposite) { colorPreviewImages= new ArrayList<>(); fAppearanceColorTableViewer.setLabelProvider(new LabelProvider() { @Override public Image getImage(Object element) { int dimensions= 10; String key= ((String[]) element)[1]; RGB rgb= PreferenceConverter.getColor(fOverlayStore, key); Color color= new Color(tableComposite.getParent().getDisplay(), rgb.red, rgb.green, rgb.blue); Image image= new Image(tableComposite.getParent().getDisplay(), dimensions, dimensions); GC gc= new GC(image); gc.setBackground(color); gc.fillRectangle(0, 0, dimensions, dimensions); gc.setBackground(new Color(tableComposite.getParent().getDisplay(), 0, 0, 0)); gc.setLineWidth(2); gc.drawRectangle(0, 0, dimensions, dimensions); gc.dispose(); colorPreviewImages.add(image); return image; } @Override public String getText(Object element) { return ((String[]) element)[0]; } }); TableColumn tc= new TableColumn(fAppearanceColorTableViewer.getTable(), SWT.NONE, 0); TableColumnLayout tableColumnLayout= new TableColumnLayout(true); PixelConverter pixelConverter= new PixelConverter(tableComposite.getParent().getFont()); tableColumnLayout.setColumnData(tc, new ColumnWeightData(1, pixelConverter.convertWidthInCharsToPixels(30))); tableComposite.setLayout(tableColumnLayout); }