GT-2383 tree focus when clicking on already selected node.

This commit is contained in:
dev747368 2019-08-06 16:02:40 -04:00
parent 06f8a90fc7
commit 8461e91758

View file

@ -1324,6 +1324,10 @@ public class GTree extends JPanel implements BusyListener {
protected void setSelectedPathNow(TreePath path) {
GTreeSelectionModel selectionModel = (GTreeSelectionModel) gTree.getSelectionModel();
selectionModel.setSelectionPaths(new TreePath[] { path }, USER_GENERATED);
// If the user clicked on the same node as was already selected, no events are generated
// and the tree might be left unfocused. Force the focus to the tree.
gTree.requestFocus();
}
}