Skip to content

Implement mass addition of bib information #12025

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 75 commits into from
Jun 7, 2025
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
887dd35
feat: enhance right-click context menu with new actions (extract refe…
BojiZhang Oct 19, 2024
656facf
fix: Restore MERGE_WITH_FETCHED_ENTRY and add BATCH_MERGE_WITH_FETCHE…
BojiZhang Oct 19, 2024
0409856
Refactor and optimize FetchAndMergeEntry class
BojiZhang Oct 19, 2024
489b512
Merge branch 'JabRef:main' into fix-for-issue-#372
BojiZhang Oct 19, 2024
dc138ce
Updated CHANGELOG.md
BojiZhang Oct 19, 2024
0532df4
Added a period at the end of the description in CHANGELOG.md.
BojiZhang Oct 19, 2024
012dd9a
Updated JabRef_en.properties
BojiZhang Oct 19, 2024
f8267ac
Move and rename "Mass Getting bibliographic data" action
BojiZhang Oct 20, 2024
74f2473
Refactor FetchAndMergeEntry class for improved functionality and read…
BojiZhang Oct 20, 2024
29759a6
Merge branch 'main' into fix-for-issue-#372
koppor Oct 20, 2024
37cfeae
Refactor entry fetching and merging process
BojiZhang Oct 20, 2024
77e0d51
Updated CHANGELOG.md
BojiZhang Oct 20, 2024
e6f0ad2
Merge branch 'main' into fix-for-issue-#372
BojiZhang Oct 20, 2024
c5b7b4c
refactor: Separate UI and core logic in entry merging system
BojiZhang Oct 25, 2024
5b829b1
Merge remote-tracking branch 'upstream/fix-for-issue-#372' into fix-f…
BojiZhang Oct 25, 2024
350502e
Merge branch 'main' into fix-for-issue-#372
BojiZhang Oct 25, 2024
fe46c0c
Refactored updateFieldIfNecessaryWithUndo method in MergeEntriesHelpe…
BojiZhang Oct 25, 2024
8eac6a9
Merge remote-tracking branch 'upstream/fix-for-issue-#372' into fix-f…
BojiZhang Oct 25, 2024
5d54083
refactor: Replace String.format with string concatenation in MergingI…
BojiZhang Oct 25, 2024
93072cf
refactor: Fixed incorrect placeholder in updateProgress Method
BojiZhang Oct 25, 2024
262d25d
Updated JabRef_en.properties to fix the failing LocalizationConsisten…
BojiZhang Oct 25, 2024
4667124
Merge branch 'main' into fix-for-issue-#372
BojiZhang Oct 26, 2024
ae4df14
refactor: optimize BibEntry merging and fetching logic:
BojiZhang Oct 26, 2024
5ed3d70
Roll Back: FetchAndMergeEntry.java and MergeWithFetchedEntryAction.java.
BojiZhang Oct 27, 2024
74a6285
Merge branch 'main' into fix-for-issue-#372
koppor Oct 27, 2024
8d9bdce
Refactor: improve MergingIdBasedFetcher, BatchEntryMergeWithFetchedD…
BojiZhang Oct 27, 2024
95e9ae8
Fixed the minor import format issue.
BojiZhang Oct 27, 2024
9fdbbb4
Merge remote-tracking branch 'upstream/fix-for-issue-#372' into fix-f…
BojiZhang Oct 27, 2024
ce1ea3e
Merge branch 'main' into fix-for-issue-#372
BojiZhang Oct 27, 2024
7305f3c
Apply suggestions from code review
BojiZhang Oct 27, 2024
9dce81a
Refactor: Reorder parameters to (fetcher, library) in merge operations
BojiZhang Oct 27, 2024
5f24815
Merge branch 'main' into fix-for-issue-#372
BojiZhang Oct 27, 2024
d17fd88
Merge branch 'main' into fix-for-issue-#372
BojiZhang Oct 30, 2024
61f5a8f
Refactor: Deleted the empty line before package
BojiZhang Oct 31, 2024
86051ac
Merge branch 'main' into fix-for-issue-#372
BojiZhang Oct 31, 2024
198f2d0
Merge branch 'main' into fix-for-issue-#372
BojiZhang Oct 31, 2024
ace1975
Merge branch 'main' into fix-for-issue-#372
BojiZhang Nov 13, 2024
74681e1
Refactor: Deleted the empty line before package
BojiZhang Nov 16, 2024
3197ef4
refactor: Extract background processing into BatchEntryMergeTask, opt…
BojiZhang Nov 16, 2024
c04a2fa
Updated JabRef_en.properties
BojiZhang Nov 16, 2024
d2566db
Merge branch 'main' into fix-for-issue-#372
BojiZhang Nov 17, 2024
4d1b88d
Apply suggestions from code review
BojiZhang Nov 17, 2024
e8645a2
Modify log messages correspondingly.
BojiZhang Nov 17, 2024
ac8c59d
Refactor: Move string normalization from StringNormalizer to StringUtil
BojiZhang Nov 17, 2024
5172bc2
Merge branch 'main' into fix-for-issue-#372
BojiZhang Nov 18, 2024
05b3c42
Merge branch 'main' into fix-for-issue-#372
BojiZhang Dec 5, 2024
81043b7
Merge branch 'main' into fix-for-issue-#372
BojiZhang Feb 7, 2025
1a7bbb7
Merge branch 'main' into fix-for-issue-#372
BojiZhang Feb 23, 2025
b345e6b
Merge branch 'main' into fix-for-issue-#372
BojiZhang Mar 1, 2025
0ce2092
Modified the StringUtilClassIsSmall() test in StringUtilTest class.
BojiZhang Mar 1, 2025
2b208de
Added the cancellation feature to batch updating
BojiZhang Mar 1, 2025
e018398
Attempted to fix a failed test by modifying CHANGELOG.md.
BojiZhang Mar 1, 2025
cd4a318
Attempted to fix a conflict by modifying CHANGELOG.md.
BojiZhang Mar 10, 2025
96ff453
Merge branch 'main' into fix-for-issue-#372
BojiZhang Mar 10, 2025
c37cc82
Merge branch 'main' into fix-for-issue-#372
subhramit Mar 10, 2025
7c47166
Merge branch 'main' into fix-for-issue-#372
BojiZhang Mar 10, 2025
5ad79bb
Merge branch 'main' into fix-for-issue-#372
BojiZhang Mar 29, 2025
bcd1318
Attempted to fix an issue in RightClickMenu
BojiZhang Mar 29, 2025
ae9f742
Use named groups
subhramit Jun 5, 2025
9d0d1c4
Fix codespaces indent
subhramit Jun 5, 2025
b919860
Merge remote-tracking branch 'origin/main' into fix-for-issue-#372
koppor Jun 5, 2025
b0da898
Fix logger import
koppor Jun 5, 2025
a0d2c8f
Remove unnecessary separator
koppor Jun 5, 2025
a70195d
Remove obsolete comment
koppor Jun 5, 2025
8057a82
Reorder lookup menu
koppor Jun 5, 2025
da44233
Compilefix
koppor Jun 5, 2025
7f0d9c6
Merge branch 'main' into fix-for-issue-#372
koppor Jun 5, 2025
23b6172
add test case
calixtus Jun 6, 2025
1a7cf26
Remove normalize method
calixtus Jun 7, 2025
983091a
Refactor RemoveWhitespace to NonSpaceWhitespaceRemover
calixtus Jun 7, 2025
db3e91d
Fix CHANGELOG.md
calixtus Jun 7, 2025
e394341
Remove argument record
calixtus Jun 7, 2025
4dd5004
Simplify
calixtus Jun 7, 2025
c223e24
Rewrite
calixtus Jun 7, 2025
88ce43f
l10n
calixtus Jun 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We added automatic browser extension install on Windows for Chrome and Edge. [#6076](https://github.com/JabRef/jabref/issues/6076)
- We added a search bar for filtering keyboard shortcuts. [#11686](https://github.com/JabRef/jabref/issues/11686)
- By double clicking on a local citation in the Citation Relations Tab you can now jump the linked entry. [#11955](https://github.com/JabRef/jabref/pull/11955)
- Added functionality for mass addition of bibliographic information for multiple entries to the "Lookup" menu. [#372](https://github.com/JabRef/jabref/issues/372)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace "mass" by "batch". You used "batch" in the localization - and I like it.


### Changed

Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/jabref/gui/actions/StandardActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public enum StandardActions implements Action {
OPEN_URL(Localization.lang("Open URL or DOI"), IconTheme.JabRefIcons.WWW, KeyBinding.OPEN_URL_OR_DOI),
SEARCH_SHORTSCIENCE(Localization.lang("Search ShortScience")),
MERGE_WITH_FETCHED_ENTRY(Localization.lang("Get bibliographic data from %0", "DOI/ISBN/...")),
MASS_GET_BIBLIOGRAPHIC_DATA(Localization.lang("Get bibliographic data from %0 (fully automated)", "DOI/ISBN/...")),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename MASS_GET_BIBLIOGRAPHIC_DATA to MULTI_MERGE_WITH_FETCHED_ENTRY - to be (somehow) in line with the label and the other code. -- consistent terms from user to code.

ATTACH_FILE(Localization.lang("Attach file"), IconTheme.JabRefIcons.ATTACH_FILE),
ATTACH_FILE_FROM_URL(Localization.lang("Attach file from URL"), IconTheme.JabRefIcons.DOWNLOAD_FILE),
PRIORITY(Localization.lang("Priority"), IconTheme.JabRefIcons.PRIORITY),
Expand Down
16 changes: 15 additions & 1 deletion src/main/java/org/jabref/gui/frame/MainMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import org.jabref.gui.maintable.NewLibraryFromPdfActionOffline;
import org.jabref.gui.maintable.NewLibraryFromPdfActionOnline;
import org.jabref.gui.mergeentries.MergeEntriesAction;
import org.jabref.gui.mergeentries.MultiEntryMergeWithFetchedDataAction;
import org.jabref.gui.plaincitationparser.PlainCitationParserAction;
import org.jabref.gui.preferences.GuiPreferences;
import org.jabref.gui.preferences.ShowPreferencesAction;
Expand Down Expand Up @@ -273,7 +274,20 @@ private void createMenu() {

new SeparatorMenuItem(),

factory.createMenuItem(StandardActions.FIND_UNLINKED_FILES, new FindUnlinkedFilesAction(dialogService, stateManager))
factory.createMenuItem(StandardActions.FIND_UNLINKED_FILES, new FindUnlinkedFilesAction(dialogService, stateManager)),

new SeparatorMenuItem(),

factory.createMenuItem(
StandardActions.MASS_GET_BIBLIOGRAPHIC_DATA,
new MultiEntryMergeWithFetchedDataAction(
frame::getCurrentLibraryTab,
preferences,
dialogService,
stateManager,
taskExecutor
)
)
);

final MenuItem pushToApplicationMenuItem = factory.createMenuItem(pushToApplicationCommand.getAction(), pushToApplicationCommand);
Expand Down
214 changes: 98 additions & 116 deletions src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No empty line before "package"

package org.jabref.gui.mergeentries;

import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.TreeSet;

import javax.swing.undo.UndoManager;

import org.jabref.gui.DialogService;
import org.jabref.gui.preferences.GuiPreferences;
import org.jabref.gui.undo.NamedCompound;
import org.jabref.gui.undo.UndoableChangeType;
import org.jabref.gui.undo.UndoableFieldChange;
import org.jabref.logic.importer.EntryBasedFetcher;
import org.jabref.logic.importer.FetcherClientException;
import org.jabref.logic.importer.FetcherServerException;
import org.jabref.logic.importer.IdBasedFetcher;
import org.jabref.logic.importer.ImportCleanup;
import org.jabref.logic.importer.MergeEntriesHelper;
import org.jabref.logic.importer.WebFetcher;
import org.jabref.logic.importer.WebFetchers;
import org.jabref.logic.l10n.Localization;
Expand All @@ -28,22 +22,22 @@
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.field.Field;
import org.jabref.model.entry.field.FieldFactory;
import org.jabref.model.entry.field.StandardField;
import org.jabref.model.entry.types.EntryType;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Class for fetching and merging bibliographic information
*/
public class FetchAndMergeEntry {

// All identifiers listed here should also appear at {@link org.jabref.logic.importer.CompositeIdFetcher#performSearchById}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep my comment!

It is OK if AI deletes it. But then, re-add manually.

public static List<Field> SUPPORTED_FIELDS = Arrays.asList(StandardField.DOI, StandardField.EPRINT, StandardField.ISBN);

public static final List<Field> SUPPORTED_IDENTIFIER_FIELDS = Arrays.asList(StandardField.DOI, StandardField.EPRINT, StandardField.ISBN);

private static final Logger LOGGER = LoggerFactory.getLogger(FetchAndMergeEntry.class);
private static final String ERROR_FETCHING = "Error while fetching from %0";
private static final String MERGE_ENTRY_WITH = "Merge entry with %0 information";
private static final String UPDATED_ENTRY = "Updated entry with info from %0";
private static final String CANCELED_MERGING = "Canceled merging entries";

private final DialogService dialogService;
private final UndoManager undoManager;
private final BibDatabaseContext bibDatabaseContext;
Expand All @@ -63,124 +57,112 @@ public FetchAndMergeEntry(BibDatabaseContext bibDatabaseContext,
}

public void fetchAndMerge(BibEntry entry) {
fetchAndMerge(entry, SUPPORTED_FIELDS);
fetchAndMerge(entry, SUPPORTED_IDENTIFIER_FIELDS);
}

public void fetchAndMerge(BibEntry entry, Field field) {
fetchAndMerge(entry, Collections.singletonList(field));
fetchAndMerge(entry, List.of(field));
}

public void fetchAndMerge(BibEntry entry, List<Field> fields) {
for (Field field : fields) {
Optional<String> fieldContent = entry.getField(field);
if (fieldContent.isPresent()) {
Optional<IdBasedFetcher> fetcher = WebFetchers.getIdBasedFetcherForField(field, preferences.getImportFormatPreferences());
if (fetcher.isPresent()) {
BackgroundTask.wrap(() -> fetcher.get().performSearchById(fieldContent.get()))
.onSuccess(fetchedEntry -> {
ImportCleanup cleanup = ImportCleanup.targeting(bibDatabaseContext.getMode(), preferences.getFieldPreferences());
String type = field.getDisplayName();
if (fetchedEntry.isPresent()) {
cleanup.doPostCleanup(fetchedEntry.get());
showMergeDialog(entry, fetchedEntry.get(), fetcher.get());
} else {
dialogService.notify(Localization.lang("Cannot get info based on given %0: %1", type, fieldContent.get()));
}
})
.onFailure(exception -> {
LOGGER.error("Error while fetching bibliographic information", exception);
if (exception instanceof FetcherClientException) {
dialogService.showInformationDialogAndWait(Localization.lang("Fetching information using %0", fetcher.get().getName()), Localization.lang("No data was found for the identifier"));
} else if (exception instanceof FetcherServerException) {
dialogService.showInformationDialogAndWait(Localization.lang("Fetching information using %0", fetcher.get().getName()), Localization.lang("Server not available"));
} else {
dialogService.showInformationDialogAndWait(Localization.lang("Fetching information using %0", fetcher.get().getName()), Localization.lang("Error occurred %0", exception.getMessage()));
}
})
.executeWith(taskExecutor);
}
} else {
dialogService.notify(Localization.lang("No %0 found", field.getDisplayName()));
}
}
fields.forEach(field -> fetchAndMergeEntry(entry, field));
}

private void fetchAndMergeEntry(BibEntry entry, Field field) {
entry.getField(field)
.flatMap(fieldContent -> WebFetchers.getIdBasedFetcherForField(field, preferences.getImportFormatPreferences()))
.ifPresent(fetcher -> executeFetchTask(fetcher, field, entry));
}

private void executeFetchTask(IdBasedFetcher fetcher, Field field, BibEntry entry) {
entry.getField(field).ifPresent(fieldContent ->
BackgroundTask.wrap(() -> fetcher.performSearchById(fieldContent))
.onSuccess(fetchedEntry -> processFetchedEntry(fetchedEntry, entry, fetcher))
.onFailure(exception -> handleFetchException(exception, fetcher))
.executeWith(taskExecutor)
);
}

private void processFetchedEntry(Optional<BibEntry> fetchedEntry, BibEntry originalEntry, IdBasedFetcher fetcher) {
ImportCleanup cleanup = ImportCleanup.targeting(bibDatabaseContext.getMode(), preferences.getFieldPreferences());
fetchedEntry.ifPresentOrElse(
entry -> {
cleanup.doPostCleanup(entry);
showMergeDialog(originalEntry, entry, fetcher);
},
() -> notifyNoInfo(originalEntry)
);
}

private void notifyNoInfo(BibEntry entry) {
dialogService.notify(Localization.lang("Cannot get info based on given %0: %1",
entry.getType().getDisplayName(),
entry.getCitationKey().orElse("")));
}

private void handleFetchException(Exception exception, WebFetcher fetcher) {
LOGGER.error("Error while fetching bibliographic information", exception);
dialogService.showErrorDialogAndWait(
Localization.lang(ERROR_FETCHING, fetcher.getName()),
exception
);
}

private void showMergeDialog(BibEntry originalEntry, BibEntry fetchedEntry, WebFetcher fetcher) {
MergeEntriesDialog dialog = createMergeDialog(originalEntry, fetchedEntry, fetcher);
Optional<BibEntry> mergedEntry = dialogService.showCustomDialogAndWait(dialog)
.map(EntriesMergeResult::mergedEntry);

mergedEntry.ifPresentOrElse(
entry -> processMergedEntry(originalEntry, entry, fetcher),
() -> notifyCanceledMerge(originalEntry)
);
}

private MergeEntriesDialog createMergeDialog(BibEntry originalEntry, BibEntry fetchedEntry, WebFetcher fetcher) {
MergeEntriesDialog dialog = new MergeEntriesDialog(originalEntry, fetchedEntry, preferences);
dialog.setTitle(Localization.lang("Merge entry with %0 information", fetcher.getName()));
dialog.setTitle(Localization.lang(MERGE_ENTRY_WITH, fetcher.getName()));
dialog.setLeftHeaderText(Localization.lang("Original entry"));
dialog.setRightHeaderText(Localization.lang("Entry from %0", fetcher.getName()));
Optional<BibEntry> mergedEntry = dialogService.showCustomDialogAndWait(dialog).map(EntriesMergeResult::mergedEntry);

if (mergedEntry.isPresent()) {
NamedCompound ce = new NamedCompound(Localization.lang("Merge entry with %0 information", fetcher.getName()));

// Updated the original entry with the new fields
Set<Field> jointFields = new TreeSet<>(Comparator.comparing(Field::getName));
jointFields.addAll(mergedEntry.get().getFields());
Set<Field> originalFields = new TreeSet<>(Comparator.comparing(Field::getName));
originalFields.addAll(originalEntry.getFields());
boolean edited = false;

// entry type
EntryType oldType = originalEntry.getType();
EntryType newType = mergedEntry.get().getType();

if (!oldType.equals(newType)) {
originalEntry.setType(newType);
ce.addEdit(new UndoableChangeType(originalEntry, oldType, newType));
edited = true;
}

// fields
for (Field field : jointFields) {
Optional<String> originalString = originalEntry.getField(field);
Optional<String> mergedString = mergedEntry.get().getField(field);
if (originalString.isEmpty() || !originalString.equals(mergedString)) {
originalEntry.setField(field, mergedString.get()); // mergedString always present
ce.addEdit(new UndoableFieldChange(originalEntry, field, originalString.orElse(null),
mergedString.get()));
edited = true;
}
}

// Remove fields which are not in the merged entry, unless they are internal fields
for (Field field : originalFields) {
if (!jointFields.contains(field) && !FieldFactory.isInternalField(field)) {
Optional<String> originalString = originalEntry.getField(field);
originalEntry.clearField(field);
ce.addEdit(new UndoableFieldChange(originalEntry, field, originalString.get(), null)); // originalString always present
edited = true;
}
}

if (edited) {
ce.end();
undoManager.addEdit(ce);
dialogService.notify(Localization.lang("Updated entry with info from %0", fetcher.getName()));
} else {
dialogService.notify(Localization.lang("No information added"));
}
} else {
dialogService.notify(Localization.lang("Canceled merging entries"));
return dialog;
}

private void processMergedEntry(BibEntry originalEntry, BibEntry mergedEntry, WebFetcher fetcher) {
NamedCompound ce = new NamedCompound(Localization.lang(MERGE_ENTRY_WITH, fetcher.getName()));
MergeEntriesHelper.mergeEntries(originalEntry, mergedEntry, ce);

if (ce.hasEdits()) {
ce.end();
undoManager.addEdit(ce);
}

dialogService.notify(Localization.lang(UPDATED_ENTRY, fetcher.getName()));
}

private void notifyCanceledMerge(BibEntry entry) {
String citationKey = entry.getCitationKey().orElse(entry.getAuthorTitleYear(40));
dialogService.notify(Localization.lang(CANCELED_MERGING) + " [" + citationKey + "]");
}

public void fetchAndMerge(BibEntry entry, EntryBasedFetcher fetcher) {
BackgroundTask.wrap(() -> fetcher.performSearch(entry).stream().findFirst())
.onSuccess(fetchedEntry -> {
if (fetchedEntry.isPresent()) {
ImportCleanup cleanup = ImportCleanup.targeting(bibDatabaseContext.getMode(), preferences.getFieldPreferences());
cleanup.doPostCleanup(fetchedEntry.get());
showMergeDialog(entry, fetchedEntry.get(), fetcher);
} else {
dialogService.notify(Localization.lang("Could not find any bibliographic information."));
}
})
.onFailure(exception -> {
LOGGER.error("Error while fetching entry with {} ", fetcher.getName(), exception);
dialogService.showErrorDialogAndWait(Localization.lang("Error while fetching from %0", fetcher.getName()), exception);
})
.onSuccess(fetchedEntry -> processFetchedEntryForEntryBasedFetcher(fetchedEntry, entry, fetcher))
.onFailure(exception -> handleFetchException(exception, fetcher))
.executeWith(taskExecutor);
}

private void processFetchedEntryForEntryBasedFetcher(Optional<BibEntry> fetchedEntry, BibEntry originalEntry, EntryBasedFetcher fetcher) {
fetchedEntry
.map(this::cleanupFetchedEntry)
.ifPresentOrElse(
fe -> showMergeDialog(originalEntry, fe, fetcher),
() -> dialogService.notify(Localization.lang("Could not find any bibliographic information."))
);
}

private BibEntry cleanupFetchedEntry(BibEntry fetchedEntry) {
ImportCleanup cleanup = ImportCleanup.targeting(bibDatabaseContext.getMode(), preferences.getFieldPreferences());
cleanup.doPostCleanup(fetchedEntry);
return fetchedEntry;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public MergeWithFetchedEntryAction(DialogService dialogService,
this.undoManager = undoManager;

this.executable.bind(ActionHelper.needsEntriesSelected(1, stateManager)
.and(ActionHelper.isAnyFieldSetForSelectedEntry(FetchAndMergeEntry.SUPPORTED_FIELDS, stateManager)));
.and(ActionHelper.isAnyFieldSetForSelectedEntry(FetchAndMergeEntry.SUPPORTED_IDENTIFIER_FIELDS, stateManager)));
}

@Override
Expand All @@ -49,6 +49,14 @@ public void execute() {
}

BibEntry originalEntry = stateManager.getSelectedEntries().getFirst();
new FetchAndMergeEntry(stateManager.getActiveDatabase().get(), taskExecutor, preferences, dialogService, undoManager).fetchAndMerge(originalEntry);
FetchAndMergeEntry fetchAndMergeEntry = new FetchAndMergeEntry(
stateManager.getActiveDatabase().get(),
taskExecutor,
preferences,
dialogService,
undoManager
);

fetchAndMergeEntry.fetchAndMerge(originalEntry);
}
}
Loading