@Override
  public boolean isAvailableOnDataContext(@NotNull final DataContext dataContext) {
    PsiDirectory directory = adjustForRename(dataContext, PsiElementRenameHandler.getElement(dataContext));
    if (directory != null) {
      final VirtualFile virtualFile = directory.getVirtualFile();
      final Project project = directory.getProject();
      if (Comparing.equal(project.getBaseDir(), virtualFile)) return false;
      if (ProjectRootManager.getInstance(project).getFileIndex().isInContent(virtualFile)) {
        return true;
      }
    }
    return false;
  }
@Override
  public boolean isAvailableOnDataContext(@NotNull final DataContext dataContext)