use of org.jabref.model.database.event.EntryAddedEvent in project jabref by JabRef.
the class BibDatabase method insertEntries.
private synchronized void insertEntries(List<BibEntry> newEntries, EntryEventSource eventSource) throws KeyCollisionException {
Objects.requireNonNull(newEntries);
for (BibEntry entry : newEntries) {
String id = entry.getId();
if (containsEntryWithId(id)) {
throw new KeyCollisionException("ID is already in use, please choose another");
}
internalIDs.add(id);
entry.registerListener(this);
eventBus.post(new EntryAddedEvent(entry, eventSource));
}
entries.addAll(newEntries);
}
Aggregations