public void selectFile(@NotNull VirtualFile virtualFile, boolean addIfMissing) {
    VirtualFile file = virtualFile instanceof VirtualFileWindow ? ((VirtualFileWindow)virtualFile).getDelegate() : virtualFile;
    int[] rows = findRow(file, addIfMissing, false);
    if (rows.length == 0 && addIfMissing ) {
      doAddFiles(Collections.singletonList(virtualFile));
    }
    else {
      selectRows(rows, true);
    }
    myFileToSelect = file;
  }
public void selectFile(@NotNull VirtualFile virtualFile, boolean addIfMissing)