[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [platform-swt-dev] JFace tree hacks
|
Seth, there is lots of history surronding this decision. The summary is
that at the time,
it was not clear that every platform supports "setHasChildren" but it is
clear that the
dummy hack will work everywhere. In a past life, I had to implement
"setHasChildren"
on OS/2 PM and this was not easy.
Steve
Seth Nickell
<snickell@xxxxxxxxxxxx> To: platform-swt-dev@xxxxxxxxxxx
Sent by: cc:
platform-swt-dev-admin@ Subject: [platform-swt-dev] JFace tree hacks
eclipse.org
08/23/02 03:12 PM
Please respond to
platform-swt-dev
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
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev