Community
Participate
Working Groups
Build Identifier: 3.7m2 See example below. The selected row should be drawn in red, but in 3.7m2 (unlike 3.6.1) the text is drawn in white, making the line appear 'blank'. Note that this bug affects the JFace features that allow the user to select a cell in the table (eg. FocusCellOwnerDrawHighlighter). Reproducible: Always Steps to Reproduce: import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableItem; public class EraseItemExample { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new FillLayout()); final Color red = display.getSystemColor(SWT.COLOR_RED); final Table table = new Table(shell, SWT.FULL_SELECTION); table.setHeaderVisible(true); new TableColumn(table, SWT.NONE).setWidth(100); new TableColumn(table, SWT.NONE).setWidth(100); new TableColumn(table, SWT.NONE).setWidth(100); for (int i = 0; i < 5; i++) { TableItem item = new TableItem(table, SWT.NONE); item.setText(0, "item " + i + " col 0"); item.setText(1, "item " + i + " col 1"); item.setText(2, "item " + i + " col 2"); } table.pack(); table.addListener(SWT.EraseItem, new Listener() { public void handleEvent(Event event) { if ((event.detail & SWT.SELECTED) != 0) { event.gc.setForeground(red); event.detail &= ~SWT.SELECTED; } } }); shell.setSize(400, 300); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }
I should also mention my platform is Mac OSX cocoa 64 bit.
The fix for Bug 289868 has caused this. Sorry about it.
Created attachment 181925 [details] patch Put back the code to get the foreground color from gc. Scott, please review.
Looks good to me.
Thanks Scott. Fixed in HEAD > 20101109