JComponent (SettingsEditorFragment<?, ?> fragment) { SimpleColoredComponent component = new SimpleColoredComponent(); component.append(fragment.getName().replace("\u001b", ""), SimpleTextAttributes.GRAYED_ATTRIBUTES); String shortcutText = getShortcutText(fragment); if (shortcutText != null) { String last = StringUtil.last(shortcutText, 1, false).toString(); component.append(" " + StringUtil.trimEnd(shortcutText, last), SimpleTextAttributes.GRAYED_ATTRIBUTES); component.append(last); } return component; }