@Override
  public void actionPerformed(@NotNull AnActionEvent e) {
    Project project = e.getProject();
    if (project == null) return;
    ProjectFileIndex index = ProjectFileIndex.getInstance(project);
    List<VirtualFile> roots = JBIterable.of(e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY))
      .filter(o -> o.equals(index.getContentRootForFile(o))).toList();
    String target = AttachDirectoryUtils.getDisplayName(roots);
    String message = IdeBundle.message("detach.directory.dialog.message.detach.0", target);
    if (Messages.showOkCancelDialog(project, message, getConfirmDetachDialogTitle(),
                                    IdeBundle.message("detach.directory.dialog.button.detach"), Messages.getCancelButton(),
                                    Messages.getQuestionIcon()) == Messages.OK) {
      detachDirectoriesWithUndo(project, roots);
    }
  }
@Override
  public void actionPerformed(@NotNull AnActionEvent e)