Bug 312735 - Table with EraseItem Listener doesn't draw full row background
Summary: Table with EraseItem Listener doesn't draw full row background
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-12 20:34 EDT by ArronM CLA
Modified: 2020-11-25 04:18 EST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.