boolean (PsiElement element) { final PsiMember member = PsiTreeUtil.getParentOfType(element, PsiMethod.class, PsiClassInitializer.class, PsiField.class); if (member == null) { return false; } return member.hasModifierProperty(PsiModifier.STATIC); }