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

Bug 343049

Summary: Optimize Table/Tree#dispose()
Product: [RT] RAP Reporter: Rüdiger Herrmann <ruediger.herrmann>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: unspecified   
Target Milestone: 1.4 M7   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Proposed patch
none
Activated test case none

Description Rüdiger Herrmann CLA 2011-04-16 14:34:12 EDT
While disposing of a table, all TableItems and TableColumns are disposed of one by one. This causes many unnecessary re calculation of scoll bar sizes, topIndex, focusIndex, etc.
This should be avoided.

Also check the Tree if a similar optimization can be applied there.
Comment 1 Ivan Furnadjiev CLA 2011-04-19 05:46:28 EDT
Created attachment 193561 [details]
Proposed patch

This patch skips the code executed in Table#destroyItem and Table#destroyColumn if Table is in dispose. The corresponding item and column are removed from its holder in Table#releaseChildren. Do I miss something?
Comment 2 Ivan Furnadjiev CLA 2011-04-19 09:09:47 EDT
Just checked the Tree and the same optimization could be made for it too.
Comment 3 Rüdiger Herrmann CLA 2011-04-19 09:16:20 EDT
Created attachment 193579 [details]
Activated test case

The Table_Test#testDisposeWithFontDisposeInDisposeListener() was without effect as it wasn't executing the PROCESS_ACTION phase.
This patch includes the previous and fakes the phase in the test accordingly.
With this, we even have a test case for the changes.
From my point of view, the patch can be committed.
Comment 4 Ivan Furnadjiev CLA 2011-04-19 09:29:18 EDT
Applied patch to CVS HEAD. Will be made the same optimization for Tree as well.
Comment 5 Ivan Furnadjiev CLA 2011-04-19 10:04:20 EDT
Similar optimization for Tree is in CVS.