Community
Participate
Working Groups
- run the snippet below - the second item should have a green background, because the SWT.BACKGROUND bit is cleared from the EraseItem event's detail field for it, but it is red static void tableEraseItemListener() { final Display display = new Display(); Shell shell = new Shell(display); shell.setBounds(10,10,200,200); shell.setLayout(new FillLayout()); final Table table = new Table(shell, SWT.CHECK); for (int i = 0; i < 2; i++) { new TableColumn(table, SWT.NONE).setWidth(80); } for (int i = 0; i < 2; i++) { TableItem item = new TableItem(table, SWT.NONE); item.setText(new String[] {"one","two"}); item.setBackground(display.getSystemColor(SWT.COLOR_RED)); } table.addListener(SWT.EraseItem, new Listener() { public void handleEvent(Event event) { if (table.indexOf((TableItem)event.item) == 1) { event.detail &= ~SWT.BACKGROUND; event.gc.setBackground(display.getSystemColor(SWT.COLOR_GREEN)); event.gc.fillRectangle(event.gc.getClipping()); } } }); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.