Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 379400

Summary: Layout calculation causes virtual table items to be initialized
Product: [RT] RAP Reporter: Thomas Kratz <eiswind>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: major    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Snippet to reproduce none

Description Thomas Kratz CLA 2012-05-14 07:34:21 EDT
Build Identifier: 1.5M7

Yesterday I noticed that my applcation hangs on creating large virtual TableViewers, after some investigation I found that my GridLayout causes a setBounds on the Table which causes a notifyResize which initializes all the TableItems. I'll try to provide a snippet on Thursday.

Reproducible: Always
Comment 1 Thomas Kratz CLA 2012-05-14 13:58:05 EDT
Created attachment 215589 [details]
Snippet to reproduce

I am glad that I could reproduce this one outside of my application. It's all about using a GridLayout. If you comment out the GridLayout everything is fine. If you use the GridLayout, the TableItems get initialized and the whole little thing is broken completely.
Comment 2 Ivan Furnadjiev CLA 2012-05-14 14:57:46 EDT
Thomas, I can reproduce it with your snippet, but I think that your code is not so correct. The grid cell, where the table is, become 24000 pixels in height. And the table becomes 24000 pixels in height too. This is the reason why all items are materialized. I'm not sure if this is a bug or GridLayout behaves that way (have to check your snippet against SWT). Setting layout data for the Table fixes the issue:
...
viewer = new TableViewer( parent, SWT.VIRTUAL );
GridData tableData = new GridData( SWT.FILL, SWT.FILL, true, true );
viewer.getTable().setLayoutData( tableData );
...
Comment 3 Ivan Furnadjiev CLA 2012-05-14 16:01:31 EDT
Just checked it in SWT and the Table have the same huge ~20000 pixels height. I think that the bug is invalid.
Comment 4 Ivan Furnadjiev CLA 2012-05-14 16:02:40 EDT
Thomas, please reopen if you disagree.
Comment 5 Thomas Kratz CLA 2012-05-15 03:50:13 EDT
I guess it's then that I have the GridLayout (I have the LayoutData in my code) in a ScrolledForm (that indeed can grow in size) that makes the Table explode in size. Looks like this is the intended behaviour. Have to think about how to workaround this tonight :)

Thanks for clearing that up with me!