@Override
  protected void actionPerformed(@NotNull Project p, @NotNull IdeaGateway gw, @NotNull AnActionEvent e) {
    String labelName = Messages.showInputDialog(p, LocalHistoryBundle.message("put.label.name"),
                                                LocalHistoryBundle.message("put.label.dialog.title"), null, "",
                                                new NonEmptyInputValidator());

    if (labelName == null) return;

    Label label = LocalHistory.getInstance().putUserLabel(p, labelName);
    if (label == Label.NULL_INSTANCE) {
      getLocalHistoryNotificationGroup()
        .createNotification(LocalHistoryBundle.message("notification.content.label.creation.failed", labelName),
                            NotificationType.ERROR)
        .setDisplayId(LABEL_CREATION_FAILED)
        .notify(p);
      return;
    }

    Notification notification = getLocalHistoryNotificationGroup()
      .createNotification(LocalHistoryBundle.message("notification.content.label.name.created", labelName),
                          NotificationType.INFORMATION)
      .setDisplayId(LABEL_CREATED);
    Set<VirtualFile> baseDirectories = BaseProjectDirectories.getBaseDirectories(p);
    if (canShowLocalHistoryFor(gw, baseDirectories)) {
      notification.addAction(NotificationAction.createSimple(LocalHistoryBundle.message("notification.action.view.local.history"), () -> {
        showLocalHistoryFor(p, gw, new ArrayList<>(baseDirectories));
      }));
    }
    notification.notify(p);
  }
@Override
  protected void actionPerformed(@NotNull Project p, @NotNull IdeaGateway gw, @NotNull AnActionEvent e)