boolean (@NotNull PsiElement element, @NotNull Editor editor, @NotNull PsiFile file, @NotNull DataContext context, @NotNull String place) { if (place.equals(ActionPlaces.REFACTORING_QUICKLIST)) { PsiElement caretElement = BaseRefactoringAction.getElementAtCaret(editor, file); if (PsiTreeUtil.isAncestor(element, caretElement, false)) { return isEnabledOnElements(new PsiElement[]{element}); } else { return isEnabledOnElements(new PsiElement[]{caretElement}); } } return super.isAvailableOnElementInEditorAndFile(element, editor, file, context, place); }