void (JComponent component, PsiType selectedType) { if (selectedType != null) { final String presentableText = selectedType.getPresentableText(); final int presentableTextWidth = component.getFontMetrics(component.getFont()).stringWidth(presentableText); ((ComboBox<?>)component).setMinimumAndPreferredWidth(presentableTextWidth); } }