boolean (@NotNull PsiElement element) { if (element instanceof PsiField field) { if (!isImplicitFxmlAccess(field)) return false; final String fieldName = field.getName(); final PsiClass containingClass = field.getContainingClass(); if (containingClass == null) return false; final String qualifiedName = containingClass.getQualifiedName(); if (qualifiedName == null) return false; final Project project = element.getProject(); if (isInjectedByFxmlLoader(field)) { return true; } final Collection<VirtualFile> containingFiles = JavaFxIdsIndex.getContainingFiles(project, fieldName); if (containingFiles.isEmpty()) return false; // is the field declared in a controller class? final List<VirtualFile> fxmls = JavaFxControllerClassIndex.findFxmlsWithController(project, qualifiedName); for (VirtualFile fxml : fxmls) { if (containingFiles.contains(fxml)) return true; } // is the field declared in a superclass of a controller class? return isFxmlUsage(field, GlobalSearchScope.filesScope(project, containingFiles)); } return false; }