String () { ItemPresentation presentation = getPresentation(); String text = presentation.getPresentableText(); if (!StringUtil.isEmpty(text)) { return text; } if (presentation instanceof PresentationData) { List<PresentableNodeDescriptor.ColoredFragment> fragments = ((PresentationData)presentation).getColoredText(); if (!fragments.isEmpty()) { StringBuilder result = new StringBuilder(); for (PresentableNodeDescriptor.ColoredFragment fragment : fragments) { result.append(fragment.getText()); } return result.toString(); } } return null; }