boolean (@NotNull Editor editor, @NotNull PsiFile file, @NotNull DataContext dataContext) { PsiElement element = PsiTreeUtil.findElementOfClassAtOffset(file, editor.getCaretModel().getOffset(), PsiElement.class, false); PsiClass psiClass = PsiTreeUtil.getParentOfType(element, PsiClass.class, false); return psiClass != null && RefactoringActionContextUtil.isClassWithExtendsOrImplements(psiClass) && RefactoringActionContextUtil.isJavaClassHeader(element); }