void () { myFileList.setModel(new AbstractListModel<>() { @Override public int getSize() { return myFiles.size(); } @Override public PresentableFileInfo getElementAt(final int index) { return myFiles.get(index); } }); boolean hasVcs = false; for (FileInfo info : myFiles) { if (info.hasVersionControl()) { hasVcs = true; HandleType handleType = info.getSelectedHandleType(); List<String> changelists = handleType.getChangelists(); String defaultChangelist = handleType.getDefaultChangelist(); myChangelist.setModel(new CollectionComboBoxModel<>(changelists, defaultChangelist)); myChangelist.setRenderer(new ColoredListCellRenderer<>() { @Override protected void customizeCellRenderer(@NotNull JList<? extends String> list, @NlsSafe String value, int index, boolean selected, boolean hasFocus) { if (value == null) return; String trimmed = StringUtil.first(value, 50, true); if (value.equals(defaultChangelist)) { append(trimmed, selected ? SELECTED_BOLD_ATTRIBUTES : BOLD_ATTRIBUTES); } else { append(trimmed, selected ? SimpleTextAttributes.SELECTED_SIMPLE_CELL_ATTRIBUTES : SimpleTextAttributes.SIMPLE_CELL_ATTRIBUTES); } } }); break; } } myUsingVcsRadioButton.setEnabled(hasVcs); }