public boolean isSelected(VirtualFile file) {
    int index = ((DefaultListModel<?>)list.getModel()).indexOf(file);
    return index != -1 && list.isSelectedIndex(index);
  }
public boolean isSelected(VirtualFile file)