void (@NotNull JList list, final Object value, int index, final boolean selected, boolean hasFocus) { setPaintFocusBorder(false); setIcon(EmptyIcon.ICON_16); ApplicationManager.getApplication().runReadAction(() -> { if (isActionValue(value)) { final AnAction anAction = (AnAction)value; final Presentation templatePresentation = anAction.getTemplatePresentation(); Icon icon = templatePresentation.getIcon(); if (anAction instanceof ActivateToolWindowAction) { final String id = ((ActivateToolWindowAction)anAction).getToolWindowId(); ToolWindow toolWindow = ToolWindowManager.getInstance(myProject).getToolWindow(id); if (toolWindow != null) { icon = toolWindow.getIcon(); } } append(String.valueOf(templatePresentation.getText())); if (icon != null && icon.getIconWidth() <= 16 && icon.getIconHeight() <= 16) { setIcon(IconUtil.toSize(icon, 16, 16)); } } else if (isSetting(value)) { String text = getSettingText((OptionDescription)value); SimpleTextAttributes attrs = SimpleTextAttributes.REGULAR_ATTRIBUTES; if (value instanceof Changeable && ((Changeable)value).hasChanged()) { if (selected) { attrs = SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES; } else { SimpleTextAttributes base = SimpleTextAttributes.LINK_BOLD_ATTRIBUTES; attrs = base.derive(SimpleTextAttributes.STYLE_BOLD, base.getFgColor(), null, null); } } append(text, attrs); } else if (value instanceof OptionsTopHitProvider) { append(SearchTopHitProvider.getTopHitAccelerator() + ((OptionsTopHitProvider)value).getId()); //NON-NLS } else { ItemPresentation presentation = null; if (value instanceof ItemPresentation) { presentation = (ItemPresentation)value; } else if (value instanceof NavigationItem) { presentation = ((NavigationItem)value).getPresentation(); } if (presentation != null) { final String text = presentation.getPresentableText(); //noinspection HardCodedStringLiteral append(text == null ? value.toString() : text); Icon icon = presentation.getIcon(false); if (icon != null) setIcon(icon); } } }); }