NodeDescriptor (final Object element, final NodeDescriptor parentDescriptor) { return new PresentableNodeDescriptor(null, parentDescriptor) { @Override protected void update(@NotNull PresentationData presentation) { onElementAction("update", (NodeElement)element); presentation.clear(); presentation.addText(new ColoredFragment(getElement().toString(), SimpleTextAttributes.REGULAR_ATTRIBUTES)); if (myChanges.contains(element)) { myChanges.remove(element); presentation.setChanged(true); } } @Override public @Nullable PresentableNodeDescriptor getChildToHighlightAt(int index) { return null; } @Override public Object getElement() { return element; } @Override public String toString() { List<ColoredFragment> coloredText = getPresentation().getColoredText(); StringBuilder result = new StringBuilder(); for (ColoredFragment each : coloredText) { result.append(each.getText()); } return result.toString(); } }; }