I'd like to be able to persist the expanded state of a Tree. This is so when
you expand portions of it to see the parts you are interested in you don't
have to do it all over again the next time. Of course if the data
represented by the tree changes a lot this won't work, but when it is fairly
static this would be very useful.
Before I start writing code to do this I'm wondering if there is already a
built-in way to persist the expanded state of a Tree.
taking a deep look at the jface api docs tells me that there's no built-in way to achieve this task. You could solve this by mapping the tree structure to xml and vice versa. The <i> org.eclipse.jface.viewers.AbstractTreeViewer.getExpandedStat e(Object element)</i> method should be consulted here. I also plan to address this feature in my newsfeed reader application by using an extended opml structure. Shouldn't be that hard anyway.