void (LookupElement item, boolean isSelected, LookupElementPresentation presentation, Color foreground, int allowedWidth, boolean nonFocusedSelection, FontMetrics fontMetrics) { int style = getStyle(presentation.isStrikeout(), false, false); for (LookupElementPresentation.TextFragment fragment : presentation.getTailFragments()) { if (allowedWidth < 0) { return; } String trimmed = trimLabelText(fragment.text, allowedWidth, fontMetrics); @SimpleTextAttributes.StyleAttributeConstant int fragmentStyle = fragment.isItalic() ? style | SimpleTextAttributes.STYLE_ITALIC : style; SimpleTextAttributes baseAttributes = new SimpleTextAttributes(fragmentStyle, getTailTextColor(isSelected, fragment, foreground, nonFocusedSelection)); myTailComponent.append(trimmed, baseAttributes); allowedWidth -= getStringWidth(trimmed, fontMetrics); } renderItemNameDecoration(myTailComponent, presentation.getItemTailDecorations(), item); }