use of org.jabref.model.database.event.EntryRemovedEvent in project jabref by JabRef.
the class BibDatabase method removeEntry.
/**
* Removes the given entry.
* The Entry is removed based on the id {@link BibEntry#id}
*
* @param toBeDeleted Entry to delete
* @param eventSource Source the event is sent from
*/
public synchronized void removeEntry(BibEntry toBeDeleted, EntryEventSource eventSource) {
Objects.requireNonNull(toBeDeleted);
boolean anyRemoved = entries.removeIf(entry -> entry.getId().equals(toBeDeleted.getId()));
if (anyRemoved) {
internalIDs.remove(toBeDeleted.getId());
eventBus.post(new EntryRemovedEvent(toBeDeleted, eventSource));
}
}
Aggregations