void (PsiType[] types) { if(myComboBoxModel == null) return; PsiType oldType; if (myComboBoxModel.getSize() > 0) { oldType = getSelectedType(); } else { oldType = null; } myComboBoxModel.setSuggestions(wrapToItems(types, myProject)); if(oldType != null) { int i = ArrayUtil.indexOf(types, oldType); if(i != -1) { ((JComboBox<?>) myComponent).setSelectedIndex(i); } } if (types.length > 0) { ((JComboBox<?>) myComponent).setSelectedIndex(0); } }