RefactoringElementListener (PsiElement element) { if (element instanceof PsiClass psiClass) { final String oldName = ClassUtil.getJVMClassName(psiClass); if (oldName != null) { final ComponentItem item = Palette.getInstance(element.getProject()).getItem(oldName); if (item != null) { return new MyRefactoringElementListener(item); } } } return null; }