Component (JList<? extends PopupFactoryImpl.ActionItem> list, PopupFactoryImpl.ActionItem value, int index, boolean isSelected, boolean cellHasFocus) { if (value != null) { final var action = value.getAction(); if (action instanceof HighlightAction highlightAction) { final TextAttributes attributes = highlightAction.getTextAttributes(); myTextComponent.setText(action.getTemplateText(), attributes, false); myTextComponent.setSize(myTextComponent.getPreferredSize()); return myTextPanel; } else { //noinspection DialogTitleCapitalization myLabel.setText(action.getTemplateText()); return mySeparatorPanel; } } return null; }