int (LookupElementPresentation presentation, FontMetrics normalMetrics, FontMetrics boldMetrics) { int result; if (ExperimentalUI.isNewUI()) { Insets insets = selectionInsets(); result = insets.left + insets.right; } else { result = 0; } result += getStringWidth(presentation.getItemText(), presentation.isItemTextBold() ? boldMetrics : normalMetrics); result += getStringWidth(presentation.getTailText(), normalMetrics); final String typeText = presentation.getTypeText(); if (StringUtil.isNotEmpty(typeText)) { result += getStringWidth("W", normalMetrics); // nice tail-type separation result += getStringWidth(typeText, normalMetrics); } result += getStringWidth("W", boldMetrics); //for unforeseen Swing size adjustments final Icon typeIcon = presentation.getTypeIcon(); if (typeIcon != null) { result += typeIcon.getIconWidth(); } return result; }