RefactoringElementListener (final PsiElement element, final Accessor<PsiClass> accessor) { if (element instanceof PsiClass) return getListeners((PsiClass)element, accessor); if (element instanceof PsiPackage) { final PsiClass aClass = accessor.getPsiElement(); if (aClass == null) return null; return getListener((PsiPackage)element, new ClassPackageAccessor(accessor)); } if (element instanceof PsiFile) return null; UClass uClass = UastContextKt.toUElement(element, UClass.class); if (uClass != null) { PsiClass aClass = accessor.getPsiElement(); if (uClass.equals(UastContextKt.toUElement(aClass, UClass.class))) { return new RefactorClass(accessor, ""); } } return null; }