Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.Set;

import org.eclipse.core.commands.common.EventManager;
Expand Down Expand Up @@ -73,6 +74,15 @@ public void checkStateChanged(final CheckStateChangedEvent event) {
BusyIndicator.showWhile(treeViewer.getControl().getDisplay(),
() -> {
if (event.getCheckable().equals(treeViewer)) {
/*
* On Windows, checking an item does not automatically update the tree selection
* like on Linux environment. Force the checked element to become the current
* selection so SelectionListener and CheckListener stay in sync together
*/
Object currentSelection = treeViewer.getStructuredSelection().getFirstElement();
if (!Objects.equals(currentSelection, event.getElement())) {
treeViewer.setSelection(new StructuredSelection(event.getElement()), true);
}
treeItemChecked(event.getElement(), event
.getChecked());
} else {
Expand Down