@Override
  public void inlineElement(final Project project, final Editor editor, final PsiElement element) {
    if (DirectClassInheritorsSearch.search((PsiClass)element).findFirst() == null) {
      CommonRefactoringUtil.showErrorHint(project, editor, JavaRefactoringBundle.message("inline.super.no.inheritors.warning.message"),
                                          JavaRefactoringBundle.message("inline.super.class"), null);
      return;
    }
    PsiClass superClass = (PsiClass) element;
    if (!superClass.getManager().isInProject(superClass)) {
      CommonRefactoringUtil.showErrorHint(project, editor, JavaRefactoringBundle.message("inline.super.non.project.class.warning.message"),
                                          JavaRefactoringBundle.message("inline.super.class"), null);
      return;
    }

    PsiClass chosen = null;
    PsiReference reference = editor != null ? TargetElementUtil.findReference(editor, editor.getCaretModel().getOffset()) : null;
    if (reference != null) {
      final PsiElement resolve = reference.resolve();
      if (resolve == superClass) {
        final PsiElement referenceElement = reference.getElement();
        final PsiElement parent = referenceElement.getParent();
        if (parent instanceof PsiReferenceList) {
          final PsiElement gParent = parent.getParent();
          if (gParent instanceof PsiClass) {
            chosen = (PsiClass)gParent;
          }
        }
      }
    }
    new InlineSuperClassRefactoringDialog(project, superClass, chosen).show();
  }
@Override
  public void inlineElement(final Project project, final Editor editor, final PsiElement element)