Community
Participate
Working Groups
Created attachment 227054 [details] Modified org.eclipse.cdt.examples.dsf.filebrowser that can reproduc the reported issue I have implemented a tree viewer using TreeModelViewer (Virtual type in Lazy mode). I could see a strange behavior while running in Linux OS . If ever I try to expand the tree items using the API expandAll(), the tree starts blinking/flickering, if it fail to fetch the child nodes. But this behavior was not there in Windows. I tried to debug the code, but it went deep into some infinite loop that always try to update the tree viewer. Please see below the relevant stack trace : Thread [main] (Suspended) OS._gtk_main_do_event(long) line: not available [native method] OS.gtk_main_do_event(long) line: 8422 Display.eventProc(long, long) line: 1245 OS._gdk_window_process_updates(long, boolean) line: not available [native method] OS.gdk_window_process_updates(long, boolean) line: 5511 Tree(Control).update(boolean, boolean) line: 4975 Tree(Control).update() line: 4966 TreeModelViewer(TreeViewer).setExpanded(Item, boolean) line: 335 TreeModelViewer(AbstractTreeViewer).internalExpandToLevel(Widget, int) line: 1757 TreeModelViewer(AbstractTreeViewer).expandToLevel(Object, int) line: 1060 TreeModelViewer(InternalTreeModelViewer).autoExpand(TreePath) line: 2063 HasChildrenUpdate.performUpdate() line: 53 ViewerUpdateMonitor$1.runInUIThread(IProgressMonitor) line: 99 UIJob$1.run() line: 95 Steps to reproduce the same in the DSF samples provided (org.eclipse.cdt.examples.dsf.filebrowser). 1. First I created an empty folder in Linux OS (Fedora 17) say /home/malu/emptyFolder 2. Now in the constructor of file FilesystemRootsVMNode.java, modified the run() method of update() job so that the root node is File[] files = new File[] {new File("/home/malu/EmptyFolder")};(instead of using API File.listRoots() ) 3. Now in FileBrowserDialog.java class I create a sample button too.. along with the search text box. See the snippet below : final Button expandAll = new Button(area, SWT.PUSH); expandAll.setText("Expand Me"); expandAll.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { fViewer.setAutoExpandLevel(ITreeModelViewer.ALL_LEVELS); fViewer.expandAll(); } }); ... Now just run the code, it will show : /home/malu/emptyFolder as root node. Just try to push the "Expand Me" button. We can see the flickering/blinking issue.
Hi Malu, what format is the attachment, if possible can you post a git patch?
BTW, expanding all elements in a lazy-loading view is especially tricky. For an example, take a look at BreakpointsView.expandAllElementsInViewer(). Still, calling TreeViewer.expandAll() shouldn't send us in an infinite loop... unless the tree has infinite depth ;-)
Hi Pawel, I have re-attached a 'tar' format of the source since we are not using git here. Also I cannot say the issue is with 'expandAll' only. As said in the previous mail, we have implemented a 'search' feature too. If the searched string is not present also the entire view starts flickering / blinking.
Created attachment 227176 [details] a 'tar' format of previously added attachemet