阅读后JavaDoc for ILazyTreeContentProvider和 Virtual Tables and Trees我有点困惑。他们真的是用一个简单的 ITreeContentProvider 来表达这个意思吗?创建树时必须加载所有元素?我预计 getChildren()
只会在扩展元素时被调用(和 hasChildren()
被调用以确定是否应该显示加号)。或者它们是否适用于某些元素有多个子元素的情况?
最佳答案
找到 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.
关于swt - JFace:ITreeContentProvider 和 ILazyTreeContentProvider 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2709408/