@Override
  public void invoke(@NotNull Project project,
                     PsiElement @NotNull [] elements,
                     @NotNull DataContext dataContext) {
    PsiElement element = elements.length == 1 ? elements[0] : null;
    if (element == null) element = PsiElementRenameHandler.getElement(dataContext);
    LOG.assertTrue(element != null);
    Editor editor = CommonDataKeys.EDITOR.getData(dataContext);
    if (checkAvailable(element, editor, dataContext)) {
      assert editor != null;
      doRename(element, editor, dataContext);
    }
  }
@Override
  public void invoke(@NotNull Project project,
                     PsiElement @NotNull [] elements,
                     @NotNull DataContext dataContext)