@Override
  public void update(@NotNull AnActionEvent e) {
    Presentation presentation = e.getPresentation();

    if (ActionPlaces.isPopupPlace(e.getPlace())) {
      presentation.setText(IdeBundle.messagePointer("action.delete.ellipsis"));
    }
    else {
      presentation.setText(IdeBundle.messagePointer("action.delete"));
    }
    if (e.isFromActionToolbar() && e.getPresentation().getIcon() == null) {
      e.getPresentation().setIcon(IconUtil.getRemoveIcon());
    }

    if (e.getProject() == null) {
      presentation.setEnabled(false);
      return;
    }

    CopyAction.updateWithProvider(e, getDeleteProvider(e.getDataContext()), false, provider -> {
      boolean isPopupPlace = ActionPlaces.isPopupPlace(e.getPlace());
      boolean enabled = provider.canDeleteElement(e.getDataContext());
      presentation.setEnabled(enabled);
      presentation.setVisible(!isPopupPlace || enabled);
      if (provider instanceof TitledHandler) {
        presentation.setText(((TitledHandler)provider).getActionTitle());
      }
    });
   }
@Override
  public void update(@NotNull AnActionEvent e)