boolean (@NotNull StringBuilder sb, @Nullable Component renderer) { if (renderer instanceof JLabel) { sb.append(((JLabel)renderer).getText()); } else if (renderer instanceof JTextComponent) { sb.append(((JTextComponent)renderer).getText()); } else if (renderer instanceof SimpleColoredComponent) { sb.append(((SimpleColoredComponent)renderer).getCharSequence(false)); } else { return false; } return true; }