void (FileChooserDescriptor descriptor) { int selected = myExcludeEntryDescriptions.size(); int savedSelected = selected; VirtualFile[] chosen = FileChooser.chooseFiles(descriptor, myProject, null); for (final VirtualFile chosenFile : chosen) { if (isFileExcluded(chosenFile)) { continue; } ExcludeEntryDescription description; if (chosenFile.isDirectory()) { description = new ExcludeEntryDescription(chosenFile, true, false, myProject); } else { description = new ExcludeEntryDescription(chosenFile, false, true, myProject); } myExcludeEntryDescriptions.add(selected, description); selected++; } if (selected > savedSelected) { // actually added something AbstractTableModel model = (AbstractTableModel)myExcludedTable.getModel(); model.fireTableRowsInserted(savedSelected, selected-1); myExcludedTable.setRowSelectionInterval(savedSelected, selected - 1); } }