void (@NotNull Project project, PsiElement @NotNull [] elements, DataContext dataContext) { LOG.assertTrue(elements.length == 1); final InvertBooleanDelegate delegate = InvertBooleanDelegate.findInvertBooleanDelegate(elements[0]); if (delegate == null) { CommonRefactoringUtil.showErrorHint(project, null, RefactoringBundle.getCannotRefactorMessage( RefactoringBundle.message("error.wrong.caret.position.method.or.variable.name")), getRefactoringName(), INVERT_BOOLEAN_HELP_ID); return; } PsiElement element = delegate.adjustElement(elements[0], project, null); if (element != null && PsiElementRenameHandler.canRename(project, null, element)) { new InvertBooleanDialog(element).show(); } }