Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354209 - Problem in filtering the child items
Summary: Problem in filtering the child items
Status: CLOSED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Nebula (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Donald Dunne CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-09 02:18 EDT by Venkata Rao CLA
Modified: 2021-07-05 11:40 EDT (History)
2 users (show)

See Also:


Attachments
XViewer Issue (346.10 KB, image/bmp)
2011-08-09 02:20 EDT, Venkata Rao CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Venkata Rao CLA 2011-08-09 02:18:47 EDT
Build Identifier: I20100608-0911

Consider the scenario where XViewer contains the child items and the parent item does not match the filter criteria but child item matches. 

When filtering is done, since parent item does not match the filter criteria it will be removed from the view so child items are also removed even though filter criteria matches.

Instead it should look for child items whether any of the child matches with the criteria. If so parent should not be removed so that child also visible.

Reproducible: Always

Steps to Reproduce:
1. Consider the data present in the attached screen shot.
2. Filter Child11, then it will not be visible in the table even though it matches the criteria.
Comment 1 Venkata Rao CLA 2011-08-09 02:20:29 EDT
Created attachment 201117 [details]
XViewer Issue
Comment 2 Donald Dunne CLA 2011-08-17 17:35:03 EDT
I have tried implementing something like this in the past.  Use case makes sense, but the devil is in the details.

First problem: The way ViewerFilters work, the parents are given first and the filter is asked if it is visible. In order to make your case work, you would have to pre-process all children for all columns in order to determine if a parent should be shown.

Secondly: You would need to keep track of those items that are expanded so that you don't expand additional items, but instead only match on those that are expanded.

And Third: The XViewer, like all TreeViewers, don't required you to load all items first, but instead just the first level.  Where it becomes expensive to load children, like in database provided data, you wouldn't want to search all children for matches just to figure out if parents match.

All that said, I'm open to an elegant solution if you can provide one based on the current design.  And based on the third issue above, we would have to make it toggle-able so the XViewer could be used for the load-all case and the lazy-loading case.

Hope this makes sense.
Comment 3 Venkata Rao CLA 2011-08-26 03:06:45 EDT
  Yes. You are absolutely correct. If it is implemented then it is against the lazy loading policy and it may hit performance also.

  Since my use case is a typical one, I suggest the following two approaches.

  1. Just like RE option, one more option (preferably check box) can be provided to filter in child items. Once this is selected, table will be loaded fully and starts filtering in child items.

  2. Otherwise provide option to customize existing filtering functionality for user needs. Right  now all variables are private. It is better to make some of the variables (like xViewerFilter variable in CustomizeManager class and customizeMgr variable in XViewer class) protected so that user can customize the functionality as per his requiremnt.
Comment 4 Donald Dunne CLA 2012-04-30 14:01:06 EDT
You can already override the XViewer.getXViewerTextFilter() method to provide your own filtering.  Will that support what you're trying to do?
Comment 5 Donald Dunne CLA 2013-04-17 18:29:16 EDT
Will the above fix work for your needs?
Comment 6 Venkata Rao CLA 2013-04-19 12:57:51 EDT
Yes. It works fine for my use case.
Comment 7 Donald Dunne CLA 2013-04-19 13:23:47 EDT
You can already override the XViewer.getXViewerTextFilter()