ItemPresentation () { ItemPresentation custom = ItemPresentationProviders.getItemPresentation(this); if (custom != null) { return custom; } final YAMLFile yamlFile = (YAMLFile)getContainingFile(); final PsiElement value = getValue(); return new ItemPresentation() { @Override public String getPresentableText() { if (value instanceof YAMLScalar){ ItemPresentation presentation = ((YAMLScalar)value).getPresentation(); return presentation != null ? presentation.getPresentableText() : getValueText(); } return getName(); } @Override public String getLocationString() { return yamlFile.getName(); } @Override public Icon getIcon(boolean open) { return YAMLKeyValueImpl.this.getIcon(0); } }; }