Bug 189106 - FilteredItemsSelectionDialog flickers when pattern changes
Summary: FilteredItemsSelectionDialog flickers when pattern changes
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 RC3   Edit
Assignee: Krzysztof Michalski CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, polish
Depends on:
Blocks:
 
Reported: 2007-05-25 05:20 EDT by Markus Keller CLA
Modified: 2007-06-05 14:32 EDT (History)
7 users (show)

See Also:
Mike_Wilson: pmc_approved+
Szymon.Brandys: review+
Tod_Creasey: review+
markus.kell.r: review+


Attachments
Proposition of modifications 001 (1.72 KB, patch)
2007-05-30 07:52 EDT, Krzysztof Michalski CLA
no flags Details | Diff
My suggested patch (1.98 KB, patch)
2007-05-30 10:09 EDT, Tod Creasey CLA
no flags Details | Diff
Patch 003 (2.11 KB, patch)
2007-05-30 11:15 EDT, Krzysztof Michalski CLA
no flags Details | Diff
Proposition of modifications 004 (3.42 KB, patch)
2007-05-30 13:43 EDT, Krzysztof Michalski CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2007-05-25 05:20:00 EDT
I20070525-0010, was OK in I20070523-0010.

The FilteredItemsSelectionDialog flickers when the pattern is changed. E.g. open the Open Type dialog and slowly type "Array" (wait until search is done after every keystroke).
=> The table always first becomes blank and then the new items are shown.
Comment 1 Tod Creasey CLA 2007-05-25 07:30:04 EDT
If the fix for this is low risk we should consider it for RC3. Please start working on a possible solution.
Comment 2 Krzysztof Michalski CLA 2007-05-30 07:52:58 EDT
Created attachment 69253 [details]
Proposition of modifications 001
Comment 3 Tod Creasey CLA 2007-05-30 10:09:45 EDT
Created attachment 69280 [details]
My suggested patch

This code is pretty ineffecient

if (contentProvider.getSortedItems().length > 0)
	contentProvider.refresh();

Sorting the set is a lot of work when all you are trying to do is determine if there any items
Comment 4 Tod Creasey CLA 2007-05-30 10:10:53 EDT
Krzysztof please verify my changes. My initial testing indicates the bug is fixed with this patch.
Comment 5 Krzysztof Michalski CLA 2007-05-30 11:15:23 EDT
Created attachment 69305 [details]
Patch 003

For me patch looks good. I add some small changes (access modificators and javadoc).
Comment 6 Szymon Brandys CLA 2007-05-30 11:21:02 EDT
The "Patch 003" looks good.
Comment 7 Markus Keller CLA 2007-05-30 11:58:50 EDT
I've tested the first two patches, and they only work as long as there are no types in the history. Just open type ArrayList and then do comment 0. Patch 003 does not look different implementation-wise.
Comment 8 Szymon Brandys CLA 2007-05-30 12:14:28 EDT
It seems that for empty or short histories (e.g. one item) two refreshes one by one cause this problem.
Comment 9 Krzysztof Michalski CLA 2007-05-30 13:43:25 EDT
Created attachment 69340 [details]
Proposition of modifications 004
Comment 10 Markus Keller CLA 2007-05-30 14:01:12 EDT
Wow, version 004 looks good (i.e. I tried hard, but I couldn't make it flicker). However, the implementation is becoming black magic for me. Can you explain why this works?
Comment 11 Szymon Brandys CLA 2007-05-30 14:08:06 EDT
It's a kind of magic ;-) I'm trying to understand it too :D
Comment 12 Tod Creasey CLA 2007-05-30 14:23:06 EDT
I think I understand it but I will let Krzysztof explain it to you. The change is more about how the filters determine when to refresh.

FilterHistoryJob#run has this method and needs a good quality comment. Otherwise +1.
Comment 13 Krzysztof Michalski CLA 2007-05-30 14:34:16 EDT
The problem was in twice fast refresh one by one (first after history and second after filtering all rest elements). I add if condition on first refresh. Now it could be scheduled only before full filtering (it use fillContentProvider method) and when history is not empty. Problem was during filtering cache. It's very fast and we had a flickering effect. Now we have one refresh after search in cache.
Comment 14 Tod Creasey CLA 2007-05-30 14:54:33 EDT
Please verify on Linux and the mac before proceeding
Comment 15 Kim Horne CLA 2007-05-30 15:32:09 EDT
It works on OS X but then I never saw the flashing to begin with.
Comment 16 Szymon Brandys CLA 2007-05-30 16:06:47 EDT
I tested it on Linux. I saw the flashing in the previous version
and everything works ok after applying the patch.
Comment 17 Tod Creasey CLA 2007-05-30 16:11:36 EDT
This last patch has been released for build 20070530-0100. McQ has yet to approve it but I wanted to make sure it was in as this is hopefully our last RC3 build.
Comment 18 Krzysztof Michalski CLA 2007-05-31 11:31:02 EDT
Fixed for RC3.
Comment 19 Markus Keller CLA 2007-05-31 11:36:36 EDT
Verified in I20070531-0010.