void (@NotNull Project project, @Nullable Editor editor, DataContext dataContext) { final PsiReference[] references = getReferences(dataContext); final PsiReference reference = getKnownReference(references); if (reference == null) return; if (reference instanceof JavaFxComponentIdReferenceProvider.JavaFxIdReferenceBase && ((JavaFxComponentIdReferenceProvider.JavaFxIdReferenceBase)reference).isBuiltIn()) { CommonRefactoringUtil.showErrorHint(project, editor, JavaFXBundle.message("javafx.property.rename.handler.error.message"), JavaFXBundle.message("javafx.property.rename.handler.error.title"), null); return; } if (reference instanceof JavaFxPropertyReference propertyReference && reference.resolve() != null) { final Map<PsiElement, String> elementsToRename = getElementsToRename(propertyReference, "a"); if (!canRename(project, editor, elementsToRename.keySet())) { return; } if (ApplicationManager.getApplication().isUnitTestMode()) { final String newName = PsiElementRenameHandler.DEFAULT_NAME.getData(dataContext); assert newName != null : "Rename property"; doRename(propertyReference, newName, false, false); return; } final PsiElement psiElement = JavaFxPropertyElement.fromReference(propertyReference); if (psiElement != null) { new PropertyRenameDialog(propertyReference, psiElement, project, editor).show(); } } if (reference instanceof JavaFxFieldIdReferenceProvider.JavaFxControllerFieldRef) { final XmlAttributeValue fxIdValueElement = ((JavaFxFieldIdReferenceProvider.JavaFxControllerFieldRef)reference).getXmlAttributeValue(); final Set<PsiElement> elementsToRename = new HashSet<>(); JavaFxRenameAttributeProcessor.visitReferencedElements(references, psiElement -> { if (psiElement != null) { elementsToRename.add(psiElement); } }); ContainerUtil.addIfNotNull(elementsToRename, getNestedControllerField(fxIdValueElement)); if (!canRename(project, editor, elementsToRename)) { return; } if (ApplicationManager.getApplication().isUnitTestMode()) { final String newName = PsiElementRenameHandler.DEFAULT_NAME.getData(dataContext); assert newName != null : "Rename property"; doRenameFxId(fxIdValueElement, newName, false, false); } else { new RenameFxIdDialog(fxIdValueElement, editor).show(); } } }