Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] JFace tree hacks

The way JFace's AbstractTreeViewer uses Tree wrt to nodes that have
children but the children's contents is not read is rather hackish.
Currently it adds a blank item to the tree at that point. When you
expand the node, it appears to *first* delete the phantom node, and then
read the real children from the model and add them. The problem is that
this necessitates somehow "freezing" the Tree for an undefined period of
time (unless I am missing some calls here, which I could be).

I see two better ways to handle this:

1) The cleanest IMO is to add "setHasChildren" or something like that to
the TreeItem API. So rather than JFace managing phantom nodes, platforms
without a tree that can display an expander without knowing the contents
will manage it.

2) The no-API-change way is to not remove the phantom node until at
least one of the real child nodes has been added. I'm not really sure
why this isn't already done.

-Seth






Back to the top