private static @Nls String getCannotRefactorMessage(PsiClass containingClass) {
    if (containingClass == null) {
      return RefactorJBundle.message("the.caret.should.be.positioned.within.a.class.to.be.refactored");
    }
    if (containingClass.isInterface()) {
      return RefactorJBundle.message("the.selected.class.is.an.interface");
    }
    if (containingClass.isEnum()) {
      return RefactorJBundle.message("the.selected.class.is.an.enumeration");
    }
    if (containingClass.isAnnotationType()) {
      return RefactorJBundle.message("the.selected.class.is.an.annotation.type");
    }
    if (classIsInner(containingClass) && !containingClass.hasModifierProperty(PsiModifier.STATIC)) {
      return RefactorJBundle.message("the.refactoring.is.not.supported.on.non.static.inner.classes");
    }
    if (classIsTrivial(containingClass)) {
      return RefactorJBundle.message("the.selected.class.has.no.members.to.extract");
    }
    if (!containingClass.getManager().isInProject(containingClass)) {
      return RefactorJBundle.message("the.selected.class.should.belong.to.project.sources");
    }
    if (containingClass instanceof PsiImplicitClass) {
      return RefactorJBundle.message("refactoring.cannot.be.done.in.implicit.class");
    }
    return null;
  }
private static @Nls String getCannotRefactorMessage(PsiClass containingClass)