boolean (Object element, PsiElement context) { final PsiLiteralExpression literalExpression = (PsiLiteralExpression)context; PsiMethodCallExpression callExpression = PsiTreeUtil.getParentOfType(literalExpression, PsiMethodCallExpression.class); final PsiCallExpression superCall = PsiTreeUtil.getParentOfType(callExpression, PsiCallExpression.class, true); if (superCall instanceof PsiMethodCallExpression) { final PsiReferenceExpression methodExpression = ((PsiMethodCallExpression)superCall).getMethodExpression(); if ("load".equals(methodExpression.getReferenceName())) { final PsiExpression qualifierExpression = methodExpression.getQualifierExpression(); PsiClass psiClass = null; if (qualifierExpression instanceof PsiReferenceExpression) { final PsiElement resolve = ((PsiReferenceExpression)qualifierExpression).resolve(); if (resolve instanceof PsiClass) { psiClass = (PsiClass)resolve; } } else if (qualifierExpression != null) { psiClass = PsiUtil.resolveClassInType(qualifierExpression.getType()); } if (psiClass != null && JavaFxCommonNames.JAVAFX_FXML_FXMLLOADER.equals(psiClass.getQualifiedName())) { return true; } } } else if (superCall instanceof PsiNewExpression) { final PsiJavaCodeReferenceElement reference = ((PsiNewExpression)superCall).getClassOrAnonymousClassReference(); if (reference != null) { final PsiElement resolve = reference.resolve(); if (resolve instanceof PsiClass && JavaFxCommonNames.JAVAFX_FXML_FXMLLOADER.equals(((PsiClass)resolve).getQualifiedName())) { return true; } } } return false; }