I try to switch from JFace TreeViewer to NatTable. Unfortunately I didn't find a lot of documentation about implementing trees with NatTable. So I have some questions
With TreeViewer I used
setInput()
to provide new input. How can I achieve the same with NatTable? Is it a proper way to callclear()
andaddAll()
on underlying data sourceList
? (I use GlazedLists)I use described
clear()
/addAll()
way to pass new data after querying a database. And after it expanded state of tree is lost, all nodes are colapsed. With JFace TreeViewer I usedgetExpandedElements()
/setExpandedElements()
to keep expanded state. Is there something similar available in NatTable?Is it possible to load child tree nodes only when parent node is clicked? I can't build beforehand all tree data because I can have cycles in it (well, strictly speaking my data is not really a tree, but it's convenient to display it like a tree)
UPD: Not sure if I should ask it here or create separate question
- I have problems with sorting. I've found similar discussion here https://www.eclipse.org/forums/index.php?t=msg&th=489524 but I still don't have deep understanding.
My problem: after sorting on any column other than 'tree' column child nodes can move to invalid parent. Though the order of elements is correct on all levels of hierarchy. I use SortableTreeComparator
and as treeComparator
I use my custom comparator (not GlazedLists.beanPropertyComparator
as in example). What can be wrong here?