我试图保存JFace TreeViewer扩展状态以在调用setInput()方法后刷新它.我尝试了getExpandedElements,setExpandedElements,getExpandedTreePaths,TreeViewer的setExpandedTreePaths方法,但它不起作用.
Object[] expandedElements = viewer.getExpandedElements(); TreePath[] expandedTreePaths = viewer.getExpandedTreePaths(); viewer.setInput(); viewer.setExpandedElements(expandedElements); viewer.setExpandedTreePaths(expandedTreePaths);