Bug 569469 - AbstractTreeViewer collapseAll() sets selection on first element on WIN
Summary: AbstractTreeViewer collapseAll() sets selection on first element on WIN
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.19   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-04 09:45 EST by Nicolas Huber CLA
Modified: 2020-12-04 09:45 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Huber CLA 2020-12-04 09:45:48 EST
I found out that when calling collapseAll() on a treeViewer, depending on the operating system the first element of the tree is selected or not.
On Windows the first item in the tree is selected. On Mac the first item in the tree is not selected. 
So if "link with editor" is enabled and you press a "collapse all" button (f.ex. in outline view) on Windows the editor jumps to the source code position of the first element of the tree, because it is selected in the tree. On mac the editor stays where it is.

In the plugin for Windows org.eclipse.swt.win32.win32.x86_64....jar
in TreeItem.class (org.eclipse.swt.widgets) in method setExpanded(boolean expanded) a Selection Event is sent:
parent.sendSelectionEvent (SWT.Selection, event, true);

In the mac implementation the event is not sent.

Why does collapseAll() work different for these operating systems?
Is it intended or is it a bug?