void (@NotNull Component component, boolean isAccessibleTree) { int count = getRowCount(); for (int i = 0; i < count; i++) { TreePath row = getPathForRow(i); Object last = row.getLastPathComponent(); if (last instanceof ComponentNode node) { if (isAccessibleTree && node.myAccessible == component || !isAccessibleTree && node.myComponent == component) { setSelectionPath(row); scrollPathToVisible(getSelectionPath()); break; } } } }