private boolean shouldBeShown(@NotNull VirtualFile dir, ViewSettings settings) {
    if (!dir.isValid()) return false;
    return shouldShowExcludedFiles(settings)
           ? myFileIndex.isInProjectOrExcluded(dir)
           : myFileIndex.isInProject(dir) && !ProjectUtil.isProjectOrWorkspaceFile(dir);
  }
private boolean shouldBeShown(@NotNull VirtualFile dir, ViewSettings settings)