void (VcsDirectoryMapping mapping) { List<MapInfo> items = new ArrayList<>(myModel.getItems()); items.add(MapInfo.registered(new VcsDirectoryMapping(mapping.getDirectory(), mapping.getVcs(), mapping.getRootSettings()), isMappingValid(mapping))); items.sort(MapInfo.COMPARATOR); myModel.setItems(items); }