boolean () { CompositeAppearance oldText = myHighlightedText; Icon oldIcon = getIcon(); boolean changes = super.update(); PsiMember enclosingElement = getEnclosingElement(); if (enclosingElement == null) { return invalidElement(); } installIcon(enclosingElement, changes); myHighlightedText = new CompositeAppearance(); TextAttributes mainTextAttributes = null; if (myColor != null) { mainTextAttributes = new TextAttributes(myColor, null, null, null, Font.PLAIN); } if (enclosingElement instanceof PsiMethod || enclosingElement instanceof PsiField) { if (enclosingElement instanceof SyntheticElement) { PsiFile file = enclosingElement.getContainingFile(); myHighlightedText.getEnding().addText(file != null ? file.getName() : JavaBundle.message("node.call.hierarchy.unknown.jsp"), mainTextAttributes); } else { PsiClass containingClass = enclosingElement.getContainingClass(); String className = containingClass == null ? null : ClassPresentationUtil.getNameForClass(containingClass, false); String methodName = enclosingElement instanceof PsiMethod ? PsiFormatUtil.formatMethod((PsiMethod)enclosingElement, PsiSubstitutor.EMPTY, PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_PARAMETERS, PsiFormatUtilBase.SHOW_TYPE) : enclosingElement.getName(); String fullMethodName = className == null ? methodName : containingClass.getContainingClass() == null ? className +"."+methodName : // in case of complex nested classes prefer "foo() in Inner in Outer" instead of confusing "Inner in Outer.foo()" JavaPsiBundle.message("class.context.display", methodName, className); myHighlightedText.getEnding().addText(fullMethodName, mainTextAttributes); } } else if (FileTypeUtils.isInServerPageFile(enclosingElement) && enclosingElement instanceof PsiFile) { PsiFile file = PsiUtilCore.getTemplateLanguageFile(enclosingElement); myHighlightedText.getEnding().addText(file.getName(), mainTextAttributes); } else { myHighlightedText.getEnding().addText(ClassPresentationUtil.getNameForClass((PsiClass)enclosingElement, false), mainTextAttributes); } if (myUsageCount > 1) { myHighlightedText.getEnding().addText(IdeBundle.message("node.call.hierarchy.N.usages", myUsageCount), HierarchyNodeDescriptor.getUsageCountPrefixAttributes()); } if (!(FileTypeUtils.isInServerPageFile(enclosingElement) && enclosingElement instanceof PsiFile)) { PsiClass containingClass = enclosingElement.getContainingClass(); if (containingClass != null) { String packageName = JavaHierarchyUtil.getPackageName(containingClass); myHighlightedText.getEnding().addText(" (" + packageName + ")", HierarchyNodeDescriptor.getPackageNameAttributes()); } } myName = myHighlightedText.getText(); changes |= !Comparing.equal(myHighlightedText, oldText) || !Comparing.equal(getIcon(), oldIcon); return changes; }