Bug 134454 - SWT.MeasureItem event handler doesn't affect initial empty table
Summary: SWT.MeasureItem event handler doesn't affect initial empty table
Status: RESOLVED DUPLICATE of bug 148039
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-03 02:18 EDT by Feng Dihai CLA
Modified: 2007-03-25 20:21 EDT (History)
0 users

See Also:


Attachments
SWT.MeasureItem event handler doesn't affect initial empty table (101.45 KB, image/jpeg)
2006-04-03 02:19 EDT, Feng Dihai CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Feng Dihai CLA 2006-04-03 02:18:22 EDT
Though attached with a SWT.MearsureItem event handler, an initial empty table doesn't modify row height (between grid lines) as the event handler has implied.

    	table.addListener(SWT.MeasureItem, new Listener(){

			public void handleEvent(Event event) {
				event.height=24;
			}
    		
    	});



Being displayed, filling one or more TableItem will change the row height. And clearing TableItems to make the table empty again does keep the modified row height.

It seems tricky. We want that row height being modified even when initialized as an empty table.

(see attached pics)
Comment 1 Feng Dihai CLA 2006-04-03 02:19:59 EDT
Created attachment 37490 [details]
SWT.MeasureItem event handler doesn't affect initial empty table
Comment 2 Steve Northover CLA 2007-03-24 11:25:50 EDT
Since an empty table has no items, we can't send SWT.MeasureItem.  If we make setItemHeight() API, then you will be able to use it to set the item height you want.  Have you considered setting the lines not visible when the table is empty?

*** This bug has been marked as a duplicate of bug 148039 ***
Comment 3 Feng Dihai CLA 2007-03-25 20:21:54 EDT
Up to now we can only change table's item height via SWT.MeasureItem listener. But an empty table can also paint its grid lines when setLinesVisible(true) being called. We want to control table's behavior whatever empty or not in the same way. In a RCP application, it's better not to suprise your users.