use of com.jetbrains.lang.dart.psi.DartMethodDeclaration in project intellij-plugins by JetBrains.
the class DartHierarchyNodeDescriptor method update.
@Override
public boolean update() {
boolean changes = super.update();
final CompositeAppearance oldText = myHighlightedText;
myHighlightedText = new CompositeAppearance();
NavigatablePsiElement element = (NavigatablePsiElement) getPsiElement();
if (element == null) {
return invalidElement();
}
final ItemPresentation presentation = element.getPresentation();
if (presentation != null) {
if (element instanceof DartMethodDeclaration) {
if (DartComponentType.typeOf(element) != DartComponentType.CONSTRUCTOR) {
// Do not print constructors as Class.Class.Class(args) Class
final DartClass cls = PsiTreeUtil.getParentOfType(element, DartClass.class);
if (cls != null) {
myHighlightedText.getEnding().addText(cls.getName() + ".");
}
}
}
myHighlightedText.getEnding().addText(presentation.getPresentableText());
PsiFile file = element.getContainingFile();
if (file != null) {
myHighlightedText.getEnding().addText(" (" + file.getName() + ")", HierarchyNodeDescriptor.getPackageNameAttributes());
}
}
myName = myHighlightedText.getText();
if (!Comparing.equal(myHighlightedText, oldText)) {
changes = true;
}
return changes;
}
Aggregations