Bug 134454

Summary: SWT.MeasureItem event handler doesn't affect initial empty table
Product: [Eclipse Project] Platform Reporter: Feng Dihai <fengdh>
Component: SWTAssignee: Steve Northover <steve_northover>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
SWT.MeasureItem event handler doesn't affect initial empty table none

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.