ItemPresentation () { return new MarkdownBasePresentation() { @Nullable @Override public String getPresentableText() { if (!isValid()) { return null; } return getPresentableTagName(); } @Nullable @Override public String getLocationString() { if (!isValid()) { return null; } if (getCompositeChildren().size() == 0) { return shrinkTextTo(PRESENTABLE_TEXT_LENGTH); } else { return null; } } }; }