JFace:ITreeContentProvider 和 ILazyTreeContentProvider 之间的区别

发布于 2024-08-29 20:16:02 字数 677 浏览 1 评论 0 原文

阅读ILazyTreeContentProvider 的 JavaDoc虚拟表和树 我有点困惑。他们真的意味着用一个简单的 ITreeContentProvider 所有元素在创建树时都必须加载吗?我预计仅在扩展元素时才会调用 getChildren() 并调用 hasChildren() 来确定是否应显示加号)。或者它们是针对某些元素有很多子元素的情况?

After reading JavaDoc for ILazyTreeContentProvider and Virtual Tables and Trees I am a bit confused. Do they really mean that with a simple ITreeContentProvider all elements have to be loaded when the tree is created? I expected that getChildren() would only be called when expanding an element (and hasChildren() to be called to determine whether the plus sign should be shown). Or are they intended for the case where some elements have many children?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

窗影残 2024-09-05 20:16:02

找到这个

支持 SWT.VIRTUAL 树 - 请参阅错误 112000。请注意,TreeViewer 始终实现惰性树:仅当用户展开节点时才调用树内容提供程序的 getChildren() 方法。如果每个父级有很多子级,或者计算每个子级所需的信息成本很高,则虚拟树查看器会很有帮助。

Found this:

Support for SWT.VIRTUAL trees - see bug 112000. Note that all along, TreeViewer implemented lazy trees: the tree content provider's getChildren() method is only called when the user expands a node. The virtual tree viewer is helpful if there are lots of children per parent, or if it expensive to compute the information needed for each child.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文