Bug 166872 - [CommonNavigator] empty JarPackageFragment nodes fail to get filtered in hierarchical layout of Project Explorer
Summary: [CommonNavigator] empty JarPackageFragment nodes fail to get filtered in hier...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: 3.3 RC1   Edit
Assignee: Michael D. Elder CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 161362
  Show dependency tree
 
Reported: 2006-12-05 18:02 EST by Mik Kersten CLA
Modified: 2007-05-16 11:37 EDT (History)
2 users (show)

See Also:
martinae: review+


Attachments
Patch for jdt.ui (2.49 KB, patch)
2007-05-02 14:10 EDT, Michael D. Elder CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mik Kersten CLA 2006-12-05 18:02:09 EST
I believe that the problem here is a duplicate of bug 148759, which was fixed for the
Package Explorer but now occurs in the Project Explorer.  The description regarding the
Package Explorer on bug 148759 is as follows.  As before we need this to support Mylar's
interest filtering on the Project Explorer's hierarchical package presentation.

The
comment on PackageExplorerPart.createViewer is: 
	 * This viewer ensures that non-leaves
in the hierarchical
	 * layout are not removed by any filters.

While this may make
sense for many filters, it is preventing Mylar users from using the hierarchical layout
because empty nodes end up being shown (see attachment).  Could this rule be updated to
"filter *empty* non-leaf" nodes instead, where determining "empty" allows all the filters
applied to the viewer to run?
Comment 1 Martin Aeschlimann CLA 2006-12-14 06:23:55 EST
This is not so easely doable as in the project explorer framework, we don't have access to the filtered children .

What we want is that a package is filtered as soon as all children are filtered. To do this in the package explorer we use the viewer's getFilteredChildren method and find out if the package really is needed.

What we would need is a possibility in the project explorer to get an element's filtered children.

Moving to Michael for comments
Comment 2 Mik Kersten CLA 2007-02-05 15:52:38 EST
Any news?  Please let me know if I should provide any further clarification.  The high order bit is that filtering of Java elements should work the same way in the Project Explorer as it does in the Package Explorer.
Comment 3 Mik Kersten CLA 2007-04-09 22:22:58 EDT
Any news on this?  If this does not get fixed for the 3.3 perhaps there should be documentation indicating the difference in filtering semantics between the Package Explorer and Project Explorer?  Otherwise integrators will be left to identify and debug this tricky scenario as has been the case for Mylar.
Comment 4 Mik Kersten CLA 2007-05-01 20:28:32 EDT
Anyone watching this bug?  I am assuming this will not have priority for 3.4 fixes and that Mylar will have to work around it by automatically disabling the hierarchical mode in the Project Explorer.
Comment 5 Michael D. Elder CLA 2007-05-01 22:27:04 EDT
Thanks for the nudge. This had fallen off of my radar. 

Martin -- how did you fix this for the Package Explorer?

Comment 6 Martin Aeschlimann CLA 2007-05-02 03:38:19 EDT
see comment 1 on how it is done in the package explorer. 
Comment 7 Michael D. Elder CLA 2007-05-02 14:10:34 EDT
Created attachment 65660 [details]
Patch for jdt.ui

The patch modifies the behavior in the NonEssentialElementsFilter, which is where the logical from the Package Explorer's isEssential() logic ends up. The fix mimics the solution in the JDT Package Explorer. 

Mik -- can you test this patch?

Martin -- would you review for release (but please wait for Mik's verification)?
Comment 8 Martin Aeschlimann CLA 2007-05-03 02:53:07 EDT
Great, Michael, that's quite clever. I thought it would be much more complicated. I will test it next week for RC1.
Comment 9 Mik Kersten CLA 2007-05-03 11:21:11 EDT
Great to see progress on this!  For the last 6 weeks I have been using the Project Explorer almost exclusively and I think it is finally a drop-in replacement (with benefits) for the Package Explorer, which is fantastic.  As far as I know this will be the last bit of compatibility needed.

Since we are pushing hard for the Mylar 2.0M3 release (next Friday) I will wait until Martin has a chance to test this next week and verify after that.
Comment 10 Martin Aeschlimann CLA 2007-05-07 13:10:41 EDT
patch reviewed and released > 20070507

Mik, let us know if it works in Mylar as well.
Comment 11 Mik Kersten CLA 2007-05-11 12:05:46 EDT
*** Bug 161362 has been marked as a duplicate of this bug. ***
Comment 12 Benno Baumgartner CLA 2007-05-16 05:31:54 EDT
verified in I20070516-0010
Comment 13 Mik Kersten CLA 2007-05-16 11:37:45 EDT
Just checked and it looks like this is indeed fixed, which is fantastic.  

Note that I had to reopen the Mylar bug 161362 for this because we are still failing since it looks like the sequence of Java model elements that show up in the Project Explorer for this case is slightly different than those in the Package Explorer.  We've had to put in similar work-arounds for this previously so I don't foresee any problems with this case.  Thanks again.