String () { final StringBuilder b = new StringBuilder(); b.append("default colors: foreground=").append(myDefaultForeground).append(", background=").append(myDefaultBackground) .append("; output infos: "); boolean first = true; MarkupIterator it = new MarkupIterator(); while (it.hasNext()) { if (first) { b.append(','); } it.processNext(new MarkupHandler() { @Override public void handleText(int startOffset, int endOffset) { b.append("text(").append(startOffset).append(",").append(endOffset).append(")"); } @Override public void handleForeground(int foregroundId) { b.append("foreground(").append(foregroundId).append(")"); } @Override public void handleBackground(int backgroundId) { b.append("background(").append(backgroundId).append(")"); } @Override public void handleFont(int fontNameId) { b.append("font(").append(fontNameId).append(")"); } @Override public void handleStyle(int style) { b.append("style(").append(style).append(")"); } @Override public boolean canHandleMore() { return true; } }); first = false; } return b.toString(); }