[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Re: TreeViewer with lazy loading

Thomas Larsson wrote:

I have a treeviewer that displays a file tree. Is there any convenient way to write the contentprovider to achieve lazy loading of the tree?

Or is the best way to use a Tree according to http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet8.java?rev=HEAD&content-type=text/vnd.viewcvs-markup and implement a customized viewer after that?

A TreeViewer always works like the Tree in that snippet and only requests information from the content provider for those nodes that are actually visible in the tree.


If you want an even lazier :-) solution, have a look at NAF's ExplorerExample (see signature for download URL) which expands tree nodes in background threads, thus keeping the UI responsive and updating it as soon as new information becomes available.

--
Stefan Zeiger - Developer of Novocode Application Framework
Build SWT-based MVC GUIs via XML: http://www.novocode.com/naf/