简体   繁体   中英

JFace TreeViewer flickering

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM