String () { PsiClass aClass; if (myElement instanceof PsiClass) { aClass = (PsiClass)myElement; } else if (myElement instanceof PsiMember) { aClass = ((PsiMember)myElement).getContainingClass(); } else { aClass = PsiTreeUtil.getParentOfType(myElement, PsiClass.class); } if (aClass != null) { String qName = aClass.getQualifiedName(); if (qName != null) { String path = StringUtil.repeat("../", StringUtil.countChars(qName, '.')); return path.isEmpty() ? "" : path.substring(0, path.length() - 1); } } return ""; }