void (Property selection) { List<Property> propertyPath = new ArrayList<>(2); while (selection != null) { propertyPath.add(0, selection); selection = selection.getParent(); } int indexToSelect = -1; int size = propertyPath.size(); for (int i = 0; i < size; i++) { int index = findFullPathProperty(myProperties, propertyPath.get(i)); if (index == -1) { break; } if (i == size - 1) { indexToSelect = index; } else { expand(index); } } if (indexToSelect != -1) { getSelectionModel().setSelectionInterval(indexToSelect, indexToSelect); } else if (getRowCount() > 0) { indexToSelect = 0; for (int i = 0; i < myProperties.size(); i++) { if (!(myProperties.get(i) instanceof GroupProperty)) { indexToSelect = i; break; } } getSelectionModel().setSelectionInterval(indexToSelect, indexToSelect); } TableUtil.scrollSelectionToVisible(this); }