Top Fields Constructors Methods
org.jabref.gui.importer

public Class ImportEntriesViewModel

extends AbstractViewModel
Class Inheritance
Imports
java.io.IOException, .StringWriter, java.util.List, .Optional, javax.swing.undo.UndoManager, javafx.beans.property.ObjectProperty, .SimpleObjectProperty, .SimpleStringProperty, .StringProperty, javafx.collections.FXCollections, .ObservableList, org.jabref.gui.AbstractViewModel, .DialogService, .StateManager, org.jabref.gui.externalfiles.ImportHandler, org.jabref.gui.util.BackgroundTask, .TaskExecutor, org.jabref.logic.bibtex.BibEntryWriter, .FieldWriter, org.jabref.logic.database.DatabaseMerger, .DuplicateCheck, org.jabref.logic.exporter.BibWriter, org.jabref.logic.importer.ParserResult, org.jabref.logic.l10n.Localization, org.jabref.logic.util.OS, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.BibEntry, .BibEntryTypesManager, org.jabref.model.util.FileUpdateMonitor, org.jabref.preferences.PreferencesService, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private final BibDatabaseContext
private final DialogService
private final ObservableList<BibEntry>
private final BibEntryTypesManager
private final FileUpdateMonitor
private static final Logger
private final StringProperty
private ParserResult
private final PreferencesService
private final ObjectProperty<BibDatabaseContext>
private final StateManager
private final TaskExecutor
private final UndoManager

Constructor Summary

AccessConstructor and Description
public
ImportEntriesViewModel(BackgroundTask<ParserResult>
the task executed for parsing the selected files(s).
task
,
TaskExecutor taskExecutor, BibDatabaseContext
the database to import into
databaseContext
,
DialogService dialogService, UndoManager undoManager, PreferencesService preferences, StateManager stateManager, BibEntryTypesManager entryTypesManager, FileUpdateMonitor fileUpdateMonitor)

Method Summary

Modifier and TypeMethod and Description
private void
private Optional<BibEntry>

Returns:

A possible duplicate, if any, or null if none were found.
findInternalDuplicate
(BibEntry
The entry to search for duplicates of.
entry
)

Checks if there are duplicates to the given entry in the list of entries to be imported.

public ObservableList<BibEntry>
public String
public BibDatabaseContext
public String
public boolean
public void
importEntries(List<BibEntry>
subset of the entries contained in parserResult
entriesToImport
,
boolean shouldDownloadFiles)

Called after the user selected the entries to import.

public StringProperty
public ObjectProperty<BibDatabaseContext>

Field Detail

databaseContextback to summary
private final BibDatabaseContext databaseContext
dialogServiceback to summary
private final DialogService dialogService
entriesback to summary
private final ObservableList<BibEntry> entries
entryTypesManagerback to summary
private final BibEntryTypesManager entryTypesManager
fileUpdateMonitorback to summary
private final FileUpdateMonitor fileUpdateMonitor
LOGGERback to summary
private static final Logger LOGGER
messageback to summary
private final StringProperty message
parserResultback to summary
private ParserResult parserResult
preferencesback to summary
private final PreferencesService preferences
selectedDbback to summary
private final ObjectProperty<BibDatabaseContext> selectedDb
stateManagerback to summary
private final StateManager stateManager
taskExecutorback to summary
private final TaskExecutor taskExecutor
undoManagerback to summary
private final UndoManager undoManager

Constructor Detail

ImportEntriesViewModelback to summary
public ImportEntriesViewModel(BackgroundTask<ParserResult> task, TaskExecutor taskExecutor, BibDatabaseContext databaseContext, DialogService dialogService, UndoManager undoManager, PreferencesService preferences, StateManager stateManager, BibEntryTypesManager entryTypesManager, FileUpdateMonitor fileUpdateMonitor)
Parameters
task:BackgroundTask<ParserResult>

the task executed for parsing the selected files(s).

databaseContext:BibDatabaseContext

the database to import into

Method Detail

buildImportHandlerThenImportEntriesback to summary
private void buildImportHandlerThenImportEntries(List<BibEntry> entriesToImport)
findInternalDuplicateback to summary
private Optional<BibEntry> findInternalDuplicate(BibEntry entry)

Checks if there are duplicates to the given entry in the list of entries to be imported.

Parameters
entry:BibEntry

The entry to search for duplicates of.

Returns:Optional<BibEntry>

A possible duplicate, if any, or null if none were found.

getEntriesback to summary
public ObservableList<BibEntry> getEntries()
getMessageback to summary
public String getMessage()
getSelectedDbback to summary
public BibDatabaseContext getSelectedDb()
getSourceStringback to summary
public String getSourceString(BibEntry entry)
hasDuplicateback to summary
public boolean hasDuplicate(BibEntry entry)
importEntriesback to summary
public void importEntries(List<BibEntry> entriesToImport, boolean shouldDownloadFiles)

Called after the user selected the entries to import. Does the real import stuff.

Parameters
entriesToImport:List<BibEntry>

subset of the entries contained in parserResult

messagePropertyback to summary
public StringProperty messageProperty()
selectedDbPropertyback to summary
public ObjectProperty<BibDatabaseContext> selectedDbProperty()