I am using TreeViewer
and creating Job to refresh Treeview
that is added 4k - 5k nodes. In Refresh Job, I call Display.getDefault().asyncExec
to execute getTreeViewer().refresh()
method. However, I have faced the problem that getTreeViewer().refresh()
has to wait 4000ms or more than that to run. This is in Ubuntu and Windows has to wait more than 30000ms.
i don't know why it has to wait for long time to execute.
asyncExec
runs as soon as possible on the SWT User Interface thread. So if it is being delayed something else must be using that thread. Since you have a large tree it is probably the TreeViewer
building the tree that is causing the delay (unless you are running something that take a long time in the UI thread).
For a large tree you may need to look at creating the tree with the SWT.VIRTUAL
style and use a ILazyTreeContentProvider
content provider.