| Summary: | Virtual tree viewer contains wrong items after refresh | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Ken Wenzel <kenwenzel> | ||||
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | Flags: | ivan:
review?
(rsternberg) |
||||
| Version: | 2.0 | ||||||
| Target Milestone: | 2.0 M2 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | sr151 | ||||||
| Attachments: |
|
||||||
|
Description
Ken Wenzel
After some testing I found that the wrong text appears only if the item "2" is expanded before you click the "Test" button. Test case that succeed in SWT but not in RAP:
public void testVirtualClearAll_DoesNotRequestData() {
final List<Event> eventLog = new ArrayList<Event>();
Tree tree = new Tree( shell, SWT.VIRTUAL );
TreeItem parentItem = new TreeItem( tree, SWT.NONE );
TreeItem item = new TreeItem( parentItem, SWT.NONE );
item.setText( "item" ); // materialize the item
tree.addListener( SWT.SetData, new Listener() {
public void handleEvent( Event event ) {
eventLog.add( event );
}
} );
parentItem.clearAll( true );
assertEquals( 0, eventLog.size() );
}
TreeItem#clearAll should not re-materialize the item (request data).
The problem was in TreeItem#clearAll where the data are requested again (parent.checkData is called) for the cleared item. Fixed in master with commit 21bd6f5494697f48f827063147aeb623c93a36c5. I think we could backport this fix to 1.5 maintenance branch. (In reply to comment #3) > I think we could backport this fix to 1.5 maintenance branch. +1 Backport the fix to 1.5 maintenance branch with commit c2009741bfdc2c220cc32ad56654eca3dc404683. |