Project: SWT
Bug 40102 [Viewers] ITreeViewerListener.treeExpanded() is called twice
Reported: 2003-07-15 10:05:30 | Status: resolved fixed

I am using TreeViewer, and my ContentProvider class also listens to tree collapse and tree expansions in the viewer by registering itself as a ITreeViewerListener with the TreeViewer. It has the required methods to implement: public void treeExpanded(TreeExpansionEvent event), and public void treeCollapsed(TreeExpansionEvent event). The problem is that when an item in the tree is expanded for the first time only, treeExpanded(TreeExpansionEvent) is called twice. treeCollapsed is only called once, as expected, and treeExpanded is only called one upon subsequent expansions of tree items.

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java