Bug 312735

Summary: Table with EraseItem Listener doesn't draw full row background
Product: [Eclipse Project] Platform Reporter: ArronM <arronm>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: ben.cox, grant_gayed, jeeeyul, lshanmug, Silenio_Quarti, skovatch
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
See Also: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/172487
https://bugs.eclipse.org/bugs/show_bug.cgi?id=565969
https://bugs.eclipse.org/bugs/show_bug.cgi?id=568931
Whiteboard:

Description ArronM CLA 2010-05-12 20:34:22 EDT
Build Identifier: SWT3647

When a Table (or Tree, I believe) has an EraseItem listener, and a TableItem is selected, the selection color doesn't fill the entire horizontal area.

Reproducible: Always

Steps to Reproduce:
snippet:

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.*;

public class testTableFullRow
{

	public static void main(String[] args) {
		Display display = new Display();
		Shell shellMain = new Shell(display, SWT.SHELL_TRIM);
		shellMain.setLayout(new FillLayout(SWT.VERTICAL));

		Table table = new Table(shellMain, SWT.BORDER);
		new TableColumn(table, SWT.RIGHT);
		new TableItem(table, SWT.NONE).setText("No EraseItem");
		table.getColumn(0).setWidth(300);

		table.select(0);
		
		/////////////////////

		Table table2 = new Table(shellMain, SWT.BORDER);
		new TableColumn(table2, SWT.RIGHT);
		new TableItem(table2, SWT.NONE).setText("Has EraseItem");
		table2.getColumn(0).setWidth(300);

		table2.addListener(SWT.EraseItem, new Listener() {
			public void handleEvent(Event event) {
			}
		});
		
		table2.select(0);

		////////////////
		
		shellMain.setSize(400, 200);
		shellMain.open();

		while (!shellMain.isDisposed()) {
			try {
				if (!display.readAndDispatch())
					display.sleep();
			} catch (Throwable t) {
				t.printStackTrace();
			}
		}
		display.dispose();
	}
}
Comment 1 Grant Gayed CLA 2010-05-18 11:45:24 EDT
Table/Tree.highlightSelectionInClipRect() runs away if EraseItem is hooked.
Comment 2 Eclipse Webmaster CLA 2019-09-06 16:19:00 EDT
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.