Top Description Fields Constructors Methods
org.jabref.gui.maintable

public Class ExtractReferencesAction

extends SimpleCommand
Class Inheritance
Imports
java.nio.file.Path, java.util.Iterator, .List, .Optional, .StringJoiner, java.util.concurrent.Callable, java.util.regex.Matcher, .Pattern, org.jabref.gui.DialogService, .StateManager, org.jabref.gui.actions.ActionHelper, .SimpleCommand, org.jabref.gui.importer.ImportEntriesDialog, org.jabref.gui.util.BackgroundTask, .TaskExecutor, org.jabref.logic.importer.ParserResult, org.jabref.logic.importer.fileformat.BibliographyFromPdfImporter, org.jabref.logic.importer.util.GrobidService, org.jabref.logic.l10n.Localization, org.jabref.logic.util.io.FileUtil, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.BibEntry, .LinkedFile, org.jabref.model.entry.field.StandardField, org.jabref.preferences.PreferencesService, org.jspecify.annotations.NonNull, .Nullable

SIDE EFFECT: Sets the "cites" field of the entry having the linked files Mode choice A: online or offline Mode choice B: complete entry or single file (the latter is not implemented) The different modes should be implemented as sub classes. However, this was too complicated, thus we use variables at the constructor to parameterize this class.

Field Summary

Modifier and TypeField and Description
private final BibliographyFromPdfImporter
private final DialogService
private final BibEntry
private final int
private final LinkedFile
private final boolean
private final PreferencesService
private final StateManager
private final TaskExecutor
Inherited from org.jabref.gui.actions.SimpleCommand:
statusMessage

Constructor Summary

AccessConstructor and Description
public
ExtractReferencesAction(boolean online, DialogService dialogService, StateManager stateManager, PreferencesService preferencesService, TaskExecutor taskExecutor)

private
ExtractReferencesAction(boolean online, @NonNull DialogService dialogService, @NonNull StateManager stateManager, @NonNull PreferencesService preferencesService, @Nullable BibEntry
the entry to handle (can be null)
entry
,
@Nullable LinkedFile
the linked file (can be null)
linkedFile
,
@NonNull TaskExecutor taskExecutor)

Can be used to bind the action on a context menu in the linked file view (future work)

Method Summary

Modifier and TypeMethod and Description
public void
private void
private void
extractReferences(Iterator<Path> fileListIterator, ParserResult result, BibEntry currentEntry)

private @NonNull Callable<ParserResult>
private Optional<Callable<ParserResult>>
Inherited from org.jabref.gui.actions.SimpleCommand:
getProgressprogressPropertysetExecutablestatusMessageProperty

Field Detail

bibliographyFromPdfImporterback to summary
private final BibliographyFromPdfImporter bibliographyFromPdfImporter
dialogServiceback to summary
private final DialogService dialogService
entryback to summary
private final BibEntry entry
FILES_LIMITback to summary
private final int FILES_LIMIT
linkedFileback to summary
private final LinkedFile linkedFile
onlineback to summary
private final boolean online
preferencesServiceback to summary
private final PreferencesService preferencesService
stateManagerback to summary
private final StateManager stateManager
taskExecutorback to summary
private final TaskExecutor taskExecutor

Constructor Detail

ExtractReferencesActionback to summary
public ExtractReferencesAction(boolean online, DialogService dialogService, StateManager stateManager, PreferencesService preferencesService, TaskExecutor taskExecutor)
ExtractReferencesActionback to summary
private ExtractReferencesAction(boolean online, @NonNull DialogService dialogService, @NonNull StateManager stateManager, @NonNull PreferencesService preferencesService, @Nullable BibEntry entry, @Nullable LinkedFile linkedFile, @NonNull TaskExecutor taskExecutor)

Can be used to bind the action on a context menu in the linked file view (future work)

Parameters
entry:@Nullable BibEntry

the entry to handle (can be null)

linkedFile:@Nullable LinkedFile

the linked file (can be null)

Method Detail

executeback to summary
public void execute()
Annotations
@Override
extractReferencesback to summary
private void extractReferences()
extractReferencesback to summary
private void extractReferences(Iterator<Path> fileListIterator, ParserResult result, BibEntry currentEntry)
getParserResultCallableOfflineback to summary
private @NonNull Callable<ParserResult> getParserResultCallableOffline(BibDatabaseContext databaseContext, List<BibEntry> selectedEntries)
getParserResultCallableOnlineback to summary
private Optional<Callable<ParserResult>> getParserResultCallableOnline(BibDatabaseContext databaseContext, List<BibEntry> selectedEntries)