Search code examples
swteclipse-rcpjface

FilteredTree (JFace): custom filter that shows all children


I'm currently using a FilteredTree with a PatternFilter to display data in a Tree.
My problem is that it only shows the elements matching the pattern and hides their children (except they also match the pattern).

Example:
Tree:

A
-B
--1
--2
-C
--1
--2

Pattern "B" gives me:

A
-B

But I need:

A
-B
--1
--2

I tried a few things but didn't find a nice/easy way to do this. Any ideas?


Solution

  • Thats the default behaviour. Override the PatternFilter.isParentMatch() and PatternFilter.isLeafMatch() to get the right results.