Verified Owner
Top Inners Fields Constructors Methods
org.jabref.gui.newentry

public Class NewEntryViewModel

extends Object
Class Inheritance
Imports
java.util.HashMap, .List, .Map, .Objects, .Optional, javafx.beans.property.BooleanProperty, .ListProperty, .ObjectProperty, .ReadOnlyBooleanProperty, .SimpleBooleanProperty, .SimpleListProperty, .SimpleObjectProperty, .SimpleStringProperty, .StringProperty, javafx.collections.FXCollections, javafx.concurrent.Task, org.jabref.gui.DialogService, .LibraryTab, .StateManager, org.jabref.gui.externalfiles.ImportHandler, org.jabref.gui.importer.BookCoverFetcher, org.jabref.gui.preferences.GuiPreferences, org.jabref.gui.util.UiTaskExecutor, org.jabref.logic.ai.AiService, org.jabref.logic.importer.CompositeIdFetcher, .FetcherClientException, .FetcherException, .FetcherServerException, .IdBasedFetcher, .ParseException, .UrlBasedFetcher, .WebFetchers, org.jabref.logic.importer.fetcher.GenericUrlBasedFetcher, org.jabref.logic.importer.fileformat.BibtexParser, org.jabref.logic.importer.plaincitation.PlainCitationParser, .PlainCitationParserChoice, .PlainCitationParserFactory, org.jabref.logic.l10n.Localization, org.jabref.logic.layout.LayoutFormatter, org.jabref.logic.layout.format.DOIStrip, org.jabref.logic.util.BackgroundTask, .URLUtil, org.jabref.logic.util.strings.StringUtil, org.jabref.model.TransferInformation, .TransferMode, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.BibEntry, org.jabref.model.entry.field.StandardField, org.jabref.model.util.FileUpdateMonitor, de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator, de.saxsys.mvvmfx.utils.validation.ValidationMessage, de.saxsys.mvvmfx.utils.validation.ValidationStatus, de.saxsys.mvvmfx.utils.validation.Validator, org.jspecify.annotations.Nullable, org.slf4j.Logger, .LoggerFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class
private class
private class
private class

Field Summary

Modifier and TypeField and Description
private final AiService
private final StringProperty
private final de.saxsys.mvvmfx.utils.validation.Validator
private Task<Optional<List<BibEntry>>>
private final BookCoverFetcher
private final DialogService
private static final LayoutFormatter
private final Map<String, BibEntry>
private final de.saxsys.mvvmfx.utils.validation.Validator
private BibEntry
private final BooleanProperty
private final BooleanProperty
private final FileUpdateMonitor
private final ObjectProperty<IdBasedFetcher>
private final ListProperty<IdBasedFetcher>
private final de.saxsys.mvvmfx.utils.validation.Validator
private Task<Optional<BibEntry>>
private final StringProperty
private final de.saxsys.mvvmfx.utils.validation.Validator
private final ObjectProperty<PlainCitationParserChoice>
private final ListProperty<PlainCitationParserChoice>
private final StringProperty
private final de.saxsys.mvvmfx.utils.validation.Validator
private Task<Optional<List<BibEntry>>>
private final LibraryTab
private static final Logger
private final GuiPreferences
private final StateManager
private final UiTaskExecutor
private final UrlBasedFetcher
private final StringProperty
private final de.saxsys.mvvmfx.utils.validation.Validator
private Task<List<BibEntry>>

Constructor Summary

AccessConstructor and Description
public
NewEntryViewModel(GuiPreferences preferences, LibraryTab libraryTab, DialogService dialogService, StateManager stateManager, UiTaskExecutor taskExecutor, FileUpdateMonitor fileUpdateMonitor, AiService aiService)

Method Summary

Modifier and TypeMethod and Description
public StringProperty
public ReadOnlyBooleanProperty
public void
public Optional<de.saxsys.mvvmfx.utils.validation.ValidationMessage>
checkDOI(String doiInput)

public de.saxsys.mvvmfx.utils.validation.ValidationStatus
public ReadOnlyBooleanProperty
public void
public void
private void
executeInterpretCitationsInBackground()

LLM responses can take long, so the dialog closes right away and the entries are added once the LLM answered.

public void
executeLookupIdentifier(boolean searchComposite)

public void
public ReadOnlyBooleanProperty
public BibEntry
public ObjectProperty<IdBasedFetcher>
public ListProperty<IdBasedFetcher>
public ReadOnlyBooleanProperty
public StringProperty
public ReadOnlyBooleanProperty
private boolean
public ObjectProperty<PlainCitationParserChoice>
public ListProperty<PlainCitationParserChoice>
public StringProperty
public ReadOnlyBooleanProperty
private Optional<List<BibEntry>>
public void
private void
public StringProperty
public ReadOnlyBooleanProperty
private BibEntry
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

aiServiceback to summary
private final AiService aiService
bibtexTextback to summary
private final StringProperty bibtexText
bibtexTextValidatorback to summary
private final de.saxsys.mvvmfx.utils.validation.Validator bibtexTextValidator
bibtexWorkerback to summary
private Task<Optional<List<BibEntry>>> bibtexWorker
bookCoverFetcherback to summary
private final BookCoverFetcher bookCoverFetcher
dialogServiceback to summary
private final DialogService dialogService
DOI_STRIPback to summary
private static final LayoutFormatter DOI_STRIP
doiCacheback to summary
private final Map<String, BibEntry> doiCache
duplicateDoiValidatorback to summary
private final de.saxsys.mvvmfx.utils.validation.Validator duplicateDoiValidator
duplicateEntryback to summary
private BibEntry duplicateEntry
executedSuccessfullyback to summary
private final BooleanProperty executedSuccessfully
executingback to summary
private final BooleanProperty executing
fileUpdateMonitorback to summary
private final FileUpdateMonitor fileUpdateMonitor
idFetcherback to summary
private final ObjectProperty<IdBasedFetcher> idFetcher
idFetchersback to summary
private final ListProperty<IdBasedFetcher> idFetchers
idFetcherValidatorback to summary
private final de.saxsys.mvvmfx.utils.validation.Validator idFetcherValidator
idLookupWorkerback to summary
private Task<Optional<BibEntry>> idLookupWorker
idTextback to summary
private final StringProperty idText
idTextValidatorback to summary
private final de.saxsys.mvvmfx.utils.validation.Validator idTextValidator
interpretParserback to summary
private final ObjectProperty<PlainCitationParserChoice> interpretParser
interpretParsersback to summary
private final ListProperty<PlainCitationParserChoice> interpretParsers
interpretTextback to summary
private final StringProperty interpretText
interpretTextValidatorback to summary
private final de.saxsys.mvvmfx.utils.validation.Validator interpretTextValidator
interpretWorkerback to summary
private Task<Optional<List<BibEntry>>> interpretWorker
libraryTabback to summary
private final LibraryTab libraryTab
LOGGERback to summary
private static final Logger LOGGER
preferencesback to summary
private final GuiPreferences preferences
stateManagerback to summary
private final StateManager stateManager
taskExecutorback to summary
private final UiTaskExecutor taskExecutor
urlFetcherback to summary
private final UrlBasedFetcher urlFetcher
urlTextback to summary
private final StringProperty urlText
urlTextValidatorback to summary
private final de.saxsys.mvvmfx.utils.validation.Validator urlTextValidator
urlWorkerback to summary
private Task<List<BibEntry>> urlWorker

Constructor Detail

NewEntryViewModelback to summary
public NewEntryViewModel(GuiPreferences preferences, LibraryTab libraryTab, DialogService dialogService, StateManager stateManager, UiTaskExecutor taskExecutor, FileUpdateMonitor fileUpdateMonitor, AiService aiService)

Method Detail

bibtexTextPropertyback to summary
public StringProperty bibtexTextProperty()
bibtexTextValidatorPropertyback to summary
public ReadOnlyBooleanProperty bibtexTextValidatorProperty()
cancelback to summary
public void cancel()
checkDOIback to summary
public Optional<de.saxsys.mvvmfx.utils.validation.ValidationMessage> checkDOI(String doiInput)
duplicateDoiValidatorStatusback to summary
public de.saxsys.mvvmfx.utils.validation.ValidationStatus duplicateDoiValidatorStatus()
executedSuccessfullyPropertyback to summary
public ReadOnlyBooleanProperty executedSuccessfullyProperty()
executeEnterUrlback to summary
public void executeEnterUrl()
executeInterpretCitationsback to summary
public void executeInterpretCitations()
executeInterpretCitationsInBackgroundback to summary
private void executeInterpretCitationsInBackground()

LLM responses can take long, so the dialog closes right away and the entries are added once the LLM answered.

executeLookupIdentifierback to summary
public void executeLookupIdentifier(boolean searchComposite)
executeSpecifyBibtexback to summary
public void executeSpecifyBibtex()
executingPropertyback to summary
public ReadOnlyBooleanProperty executingProperty()
getDuplicateEntryback to summary
public BibEntry getDuplicateEntry()
idFetcherPropertyback to summary
public ObjectProperty<IdBasedFetcher> idFetcherProperty()
idFetchersPropertyback to summary
public ListProperty<IdBasedFetcher> idFetchersProperty()
idFetcherValidatorPropertyback to summary
public ReadOnlyBooleanProperty idFetcherValidatorProperty()
idTextPropertyback to summary
public StringProperty idTextProperty()
idTextValidatorPropertyback to summary
public ReadOnlyBooleanProperty idTextValidatorProperty()
importInterpretedCitationsback to summary
private boolean importInterpretedCitations(Optional<List<BibEntry>> result)
interpretParserPropertyback to summary
public ObjectProperty<PlainCitationParserChoice> interpretParserProperty()
interpretParsersPropertyback to summary
public ListProperty<PlainCitationParserChoice> interpretParsersProperty()
interpretTextPropertyback to summary
public StringProperty interpretTextProperty()
interpretTextValidatorPropertyback to summary
public ReadOnlyBooleanProperty interpretTextValidatorProperty()
parseCitationsback to summary
private Optional<List<BibEntry>> parseCitations(@Nullable String text, @Nullable PlainCitationParserChoice parserChoice) throws org.jabref.logic.importer.FetcherException
populateDOICacheback to summary
public void populateDOICache()
showInterpretCitationsFailureback to summary
private void showInterpretCitationsFailure(Throwable exception)
urlTextPropertyback to summary
public StringProperty urlTextProperty()
urlTextValidatorPropertyback to summary
public ReadOnlyBooleanProperty urlTextValidatorProperty()
withCoversDownloadedback to summary
private BibEntry withCoversDownloaded(BibEntry entry)
org.jabref.gui.newentry back to summary

private Class NewEntryViewModel.WorkerEnterUrl

extends Task<List<BibEntry>>
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected List<BibEntry>
call()

Implements abstract javafx.concurrent.Task.call.

Invoked when the Task is executed, the call method must be overridden and implemented by subclasses.

Inherited from javafx.concurrent.Task:
addEventFilteraddEventHandlerbuildEventDispatchChaincancelcancelcancelledexceptionPropertyfailedfireEventgetExceptiongetMessagegetOnCancelledgetOnFailedgetOnRunninggetOnScheduledgetOnSucceededgetProgressgetStategetTitlegetTotalWorkgetValuegetWorkDoneisRunningmessagePropertyonCancelledPropertyonFailedPropertyonRunningPropertyonScheduledPropertyonSucceededPropertyprogressPropertyremoveEventFilterremoveEventHandlerrunningrunningPropertyscheduledsetEventHandlersetOnCancelledsetOnFailedsetOnRunningsetOnScheduledsetOnSucceededstatePropertysucceededtitlePropertytotalWorkPropertyupdateMessageupdateProgressupdateProgressupdateTitleupdateValuevaluePropertyworkDoneProperty

Constructor Detail

WorkerEnterUrlback to summary
private WorkerEnterUrl()

Method Detail

callback to summary
protected List<BibEntry> call() throws org.jabref.logic.importer.FetcherException

Implements abstract javafx.concurrent.Task.call.

Doc from javafx.concurrent.Task.call.

Invoked when the Task is executed, the call method must be overridden and implemented by subclasses. The call method actually performs the background thread logic. Only the updateProgress, updateMessage, updateValue and updateTitle methods of Task may be called from code within this method. Any other interaction with the Task from the background thread will result in runtime exceptions.

Annotations
@Override
org.jabref.gui.newentry back to summary

private Class NewEntryViewModel.WorkerInterpretCitations

extends Task<Optional<List<BibEntry>>>
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected Optional<List<BibEntry>>
call()

Implements abstract javafx.concurrent.Task.call.

Invoked when the Task is executed, the call method must be overridden and implemented by subclasses.

Inherited from javafx.concurrent.Task:
addEventFilteraddEventHandlerbuildEventDispatchChaincancelcancelcancelledexceptionPropertyfailedfireEventgetExceptiongetMessagegetOnCancelledgetOnFailedgetOnRunninggetOnScheduledgetOnSucceededgetProgressgetStategetTitlegetTotalWorkgetValuegetWorkDoneisRunningmessagePropertyonCancelledPropertyonFailedPropertyonRunningPropertyonScheduledPropertyonSucceededPropertyprogressPropertyremoveEventFilterremoveEventHandlerrunningrunningPropertyscheduledsetEventHandlersetOnCancelledsetOnFailedsetOnRunningsetOnScheduledsetOnSucceededstatePropertysucceededtitlePropertytotalWorkPropertyupdateMessageupdateProgressupdateProgressupdateTitleupdateValuevaluePropertyworkDoneProperty

Constructor Detail

WorkerInterpretCitationsback to summary
private WorkerInterpretCitations()

Method Detail

callback to summary
protected Optional<List<BibEntry>> call() throws org.jabref.logic.importer.FetcherException

Implements abstract javafx.concurrent.Task.call.

Doc from javafx.concurrent.Task.call.

Invoked when the Task is executed, the call method must be overridden and implemented by subclasses. The call method actually performs the background thread logic. Only the updateProgress, updateMessage, updateValue and updateTitle methods of Task may be called from code within this method. Any other interaction with the Task from the background thread will result in runtime exceptions.

Annotations
@Override
org.jabref.gui.newentry back to summary

private Class NewEntryViewModel.WorkerLookupId

extends Task<Optional<BibEntry>>
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected Optional<BibEntry>
call()

Implements abstract javafx.concurrent.Task.call.

Invoked when the Task is executed, the call method must be overridden and implemented by subclasses.

Inherited from javafx.concurrent.Task:
addEventFilteraddEventHandlerbuildEventDispatchChaincancelcancelcancelledexceptionPropertyfailedfireEventgetExceptiongetMessagegetOnCancelledgetOnFailedgetOnRunninggetOnScheduledgetOnSucceededgetProgressgetStategetTitlegetTotalWorkgetValuegetWorkDoneisRunningmessagePropertyonCancelledPropertyonFailedPropertyonRunningPropertyonScheduledPropertyonSucceededPropertyprogressPropertyremoveEventFilterremoveEventHandlerrunningrunningPropertyscheduledsetEventHandlersetOnCancelledsetOnFailedsetOnRunningsetOnScheduledsetOnSucceededstatePropertysucceededtitlePropertytotalWorkPropertyupdateMessageupdateProgressupdateProgressupdateTitleupdateValuevaluePropertyworkDoneProperty

Constructor Detail

WorkerLookupIdback to summary
private WorkerLookupId()

Method Detail

callback to summary
protected Optional<BibEntry> call() throws org.jabref.logic.importer.FetcherException

Implements abstract javafx.concurrent.Task.call.

Doc from javafx.concurrent.Task.call.

Invoked when the Task is executed, the call method must be overridden and implemented by subclasses. The call method actually performs the background thread logic. Only the updateProgress, updateMessage, updateValue and updateTitle methods of Task may be called from code within this method. Any other interaction with the Task from the background thread will result in runtime exceptions.

Annotations
@Override
org.jabref.gui.newentry back to summary

private Class NewEntryViewModel.WorkerLookupTypedId

extends Task<Optional<BibEntry>>
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected Optional<BibEntry>
call()

Implements abstract javafx.concurrent.Task.call.

Invoked when the Task is executed, the call method must be overridden and implemented by subclasses.

Inherited from javafx.concurrent.Task:
addEventFilteraddEventHandlerbuildEventDispatchChaincancelcancelcancelledexceptionPropertyfailedfireEventgetExceptiongetMessagegetOnCancelledgetOnFailedgetOnRunninggetOnScheduledgetOnSucceededgetProgressgetStategetTitlegetTotalWorkgetValuegetWorkDoneisRunningmessagePropertyonCancelledPropertyonFailedPropertyonRunningPropertyonScheduledPropertyonSucceededPropertyprogressPropertyremoveEventFilterremoveEventHandlerrunningrunningPropertyscheduledsetEventHandlersetOnCancelledsetOnFailedsetOnRunningsetOnScheduledsetOnSucceededstatePropertysucceededtitlePropertytotalWorkPropertyupdateMessageupdateProgressupdateProgressupdateTitleupdateValuevaluePropertyworkDoneProperty

Constructor Detail

WorkerLookupTypedIdback to summary
private WorkerLookupTypedId()

Method Detail

callback to summary
protected Optional<BibEntry> call() throws org.jabref.logic.importer.FetcherException

Implements abstract javafx.concurrent.Task.call.

Doc from javafx.concurrent.Task.call.

Invoked when the Task is executed, the call method must be overridden and implemented by subclasses. The call method actually performs the background thread logic. Only the updateProgress, updateMessage, updateValue and updateTitle methods of Task may be called from code within this method. Any other interaction with the Task from the background thread will result in runtime exceptions.

Annotations
@Override
org.jabref.gui.newentry back to summary

private Class NewEntryViewModel.WorkerSpecifyBibtex

extends Task<Optional<List<BibEntry>>>
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected Optional<List<BibEntry>>
call()

Implements abstract javafx.concurrent.Task.call.

Invoked when the Task is executed, the call method must be overridden and implemented by subclasses.

Inherited from javafx.concurrent.Task:
addEventFilteraddEventHandlerbuildEventDispatchChaincancelcancelcancelledexceptionPropertyfailedfireEventgetExceptiongetMessagegetOnCancelledgetOnFailedgetOnRunninggetOnScheduledgetOnSucceededgetProgressgetStategetTitlegetTotalWorkgetValuegetWorkDoneisRunningmessagePropertyonCancelledPropertyonFailedPropertyonRunningPropertyonScheduledPropertyonSucceededPropertyprogressPropertyremoveEventFilterremoveEventHandlerrunningrunningPropertyscheduledsetEventHandlersetOnCancelledsetOnFailedsetOnRunningsetOnScheduledsetOnSucceededstatePropertysucceededtitlePropertytotalWorkPropertyupdateMessageupdateProgressupdateProgressupdateTitleupdateValuevaluePropertyworkDoneProperty

Constructor Detail

WorkerSpecifyBibtexback to summary
private WorkerSpecifyBibtex()

Method Detail

callback to summary
protected Optional<List<BibEntry>> call() throws org.jabref.logic.importer.ParseException

Implements abstract javafx.concurrent.Task.call.

Doc from javafx.concurrent.Task.call.

Invoked when the Task is executed, the call method must be overridden and implemented by subclasses. The call method actually performs the background thread logic. Only the updateProgress, updateMessage, updateValue and updateTitle methods of Task may be called from code within this method. Any other interaction with the Task from the background thread will result in runtime exceptions.

Annotations
@Override