Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 124545 - [Viewers] FilteredTree refresh when filter is on
Summary: [Viewers] FilteredTree refresh when filter is on
Status: RESOLVED DUPLICATE of bug 187200
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Karice McIntyre CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 165883 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-01-19 16:07 EST by Mik Kersten CLA
Modified: 2007-06-17 00:33 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mik Kersten CLA 2006-01-19 16:07:52 EST
If a filter is on, and the content of the tree changes (e.g. node is added or removed), and a refresh() call is made on the viewer, the change does not appear until the filter is removed again.  My expectation is that a refresh of the TreeViewer would cause the filter to refresh if the filter were applied.  Otherwise if a node is deleted from the viewer it doesn't disappear until the filter is reset.  Or am I misusing it somehow?
Comment 1 Karice McIntyre CLA 2006-01-26 10:32:57 EST
Sounds like a bug.  The item you added matched the filter, correct?  The deleting part sounds buggy, but I am not sure how (programmatically) you are removing the node from the tree.  If you have some sample code that illustrates the problem you are seeing in the delete case that would be helpful.
Comment 2 Mik Kersten CLA 2006-02-07 18:21:33 EST
Sorry for the slow reply on this.  Yes, the item matches the filter.  Generating sample code for this is a bit involved since needs to be a content provider and actions to replicate.  Here are the simplest steps to reproduce, let me know if a pointer to the code would still be useful.

1) create a tree whose content provider returns nodes 11 and 12
2) enter "1" for the filter text (both show)
3) delete node 12 (via view or code), then call getViewer().refresh()
   - 12 will continue to show, even though it's gone from the content
4) call FilteredTree.textChanged()
   - 12 will now disappear

It's like the refresh is not getting the new content from the content provider when the filter is on.  My current work around, thanks to your changes on bug 74795, is to call filteredTree.textChanged(0) instead of getViewer().refresh().  But others could easily trip over this.
Comment 3 Karice McIntyre CLA 2006-02-07 18:30:15 EST
You shouldn't have to workaround this.  There is a cache of the items in PatternFilter.  This may be the problem.  Hopefully I will get a chance to look at this soon.
Comment 4 Mik Kersten CLA 2006-04-19 17:37:41 EDT
I haven't been noticing this problem recently.  Was something fixed with that cache?  
Comment 5 Karice McIntyre CLA 2006-04-19 18:02:21 EDT
No - I did look at this bug though.  I tried some things but they didn't work consistently so I never released any code for this problem.  I wonder if it got "fixed" somehow because of some other changes in FilteredTree or even in JFace's tree viewer.  
Comment 6 Mik Kersten CLA 2006-04-19 18:12:47 EDT
I just did some manual testing.  Given the following tree:

category
- one 
- onetwo

If the filter text is set to "one", and "onetwo" is deleted, it will disappear.  That wasn't working a while back.  

What doesn't work is if I rename the item "one" to be "bla".  It will still appear in the tree.  Similarly if the item "onethree" is added to the tree content it wont show unless the filter is refreshed.  

There's a chance that this could be related to wierdness in my content provider, but it doesn't seem that likely since the refresh in the tree happens normally otherwise.  I guess that there are no clients in the SDK that use the filtered tree with dynamically changing content, so it's not noticeable anywhere else?
Comment 7 Karice McIntyre CLA 2006-04-19 18:38:39 EDT
The Launch configurations dialog (Run... or Debug...) uses FilteredTree and dynamically changes the labels of tree items.  Create a new configuration then change the name and hit Apply.  
Comment 8 Mik Kersten CLA 2007-05-24 13:46:51 EDT
Did something change about this on M6 or RC1?  This bug is no longer happening to me, and I'm pretty sure it was still there on previous releases.
Comment 9 Karice McIntyre CLA 2007-05-24 14:31:37 EDT
Boris might know.
Comment 10 Boris Bokowski CLA 2007-05-24 15:21:42 EDT

*** This bug has been marked as a duplicate of bug 187200 ***
Comment 11 Mik Kersten CLA 2007-06-17 00:33:44 EDT
*** Bug 165883 has been marked as a duplicate of this bug. ***