I am having a CheckboxTableViewer with several entries. Now I need to display a few of the entries in a different color. Kindly help me to do this as I am very new to this topic. Thanks in advance.
checkboxTableViewer = CheckboxTableViewer.newCheckList(composite,
SWT.BORDER | SWT.FULL_SELECTION);
checkboxTableViewer.setColumnProperties(new String[] {});
checkboxTableViewer.setAllChecked(false);
checkboxTableViewer.setAllGrayed(false);
table = checkboxTableViewer.getTable();
table.setFont(SWTResourceManager.getFont("Tahoma", 8, SWT.NORMAL));
table.setBounds(0, 10, 805, 277);
checkboxTableViewer.getTable().setLayoutData(
new GridData(SWT.FILL, SWT.FILL, true, true));
checkboxTableViewer.setContentProvider(new ArrayContentProvider());
checkboxTableViewer.setInput(listSelCommit);
Make your Label Provider implement
IColorProvider
, this adds two methods to the provider: