[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.newcomer] Re: How to filter a TreeViewer to not display the parent, but show the children

On 2/11/2009 2:21 PM, Kyle J Nolan wrote:
My structure has the following (where each level is a different class
type):

DocumentRoot
+- MyExplorer
  +-Tree1
   ---item1
   ---item2
  +-Tree2
   ---item3
   ---item4

I am trying to filter my TreeViewer to only display:
Tree1
   ---item1
   ---item2
Tree2
   ---item3
   ---item4

I can't seem to figure out how to do this with the ViewerFilter--if I
try to filter a parent class, I lose the children.
I would also be happy with a solution to just print the tree starting
at a certain level (if that's simpler)

I don't think ViewFilter can do what you want. Do you already have a custom content provider for the TreeViewer? I'd think that is the place to do this kind of thing.


Eric