[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools] Phantom + signs in TreeViewer

I am using a TreeViewer with a filter so that only certain nodes show. 
However, when I do that, some of the leaf nodes in the TreeViewer show a
phantom '+' sign until a user clicks on it in an attempt to expand that
node.  At that point, if that node has no child to expand, the '+' sign
goes away.

This happens on leaf nodes that has at least one child but none that would
pass the filter.  I can understand why the above happens: the TreeViewer
simply calls the hasChildren() method in the ContentProvider and decides
from that alone whether to put a '+' sign on the node.  When the user
clicks on it, the TreeViewer finds out that there is actually no children
to display and removes the '+' sign.

Do you think that this is a bug with the TreeViewer?  Also, what is the
best way to solve this problem for now?  We are currently putting smarts
in the hasChildren() method to accomodate the filter, but we will be
interested in other solutions as well.

Thanks.