문제

I'm trying to update the input of JFace TreeViwer periodically using setInput() method. Also I use the

viewer.setExpandedElements(expandedElements);
viewer.setExpandedTreePaths(expandedTreePaths);

methods to save the state of the tree. But after each setInput() call the TreeViewer flickers. How can avoid from flickering ?

도움이 되었습니까?

해결책

Is the actual input changing? If not you can call refresh() instead... or ideally use TreeViewers add/remove/update methods to avoid having to rebuild the entire tree.

You could try calling viewer.getTree().setRedraw(false) before the calls to setExpand, and then viewer.getTree().setRedraw(true) after.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top