@Override
  protected int getSelectedIndex() {
    if (myCanExpand) {
      return allPaths().indexOf(Conditions.equalTo(myComponent.getTree().getSelectionPath()));
    }
    int[] selectionRows = myComponent.getTree().getSelectionRows();
    return selectionRows == null || selectionRows.length == 0 ? -1 : selectionRows[0];
  }
@Override
  protected int getSelectedIndex()