Verified Owner
Top Fields Constructors Methods
org.jabref.gui.fieldeditors

public Class LinkedFilesEditorViewModel

extends AbstractEditorViewModel
Class Inheritance
Imports
java.io.IOException, java.net.MalformedURLException, .URL, java.nio.file.Path, java.util.ArrayList, .Collection, .List, .Map, .Optional, java.util.stream.Collectors, javafx.beans.property.BooleanProperty, .DoubleProperty, .ListProperty, .ReadOnlyBooleanProperty, .SimpleBooleanProperty, .SimpleDoubleProperty, .SimpleListProperty, javafx.collections.FXCollections, .ListChangeListener, .ObservableList, org.jabref.gui.DialogService, org.jabref.gui.autocompleter.SuggestionProvider, org.jabref.gui.externalfiles.AutoSetFileLinksUtil, org.jabref.gui.externalfiletype.ExternalFileType, .ExternalFileTypes, .UnknownExternalFileType, org.jabref.gui.frame.ExternalApplicationsPreferences, org.jabref.gui.linkedfile.AttachFileFromURLAction, org.jabref.gui.preferences.GuiPreferences, org.jabref.gui.util.BindingsHelper, org.jabref.logic.bibtex.FileFieldWriter, org.jabref.logic.importer.FulltextFetchers, org.jabref.logic.importer.util.FileFieldParser, org.jabref.logic.integrity.FieldCheckers, org.jabref.logic.l10n.Localization, org.jabref.logic.undo.UndoManager, org.jabref.logic.util.BackgroundTask, .TaskExecutor, .URLUtil, org.jabref.logic.util.io.FileUtil, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.BibEntry, .LinkedFile, org.jabref.model.entry.field.Field, .StandardField, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private final BooleanProperty
private final BibDatabaseContext
private final DialogService
private final ListProperty<LinkedFileViewModel>
private final BooleanProperty
private static final Logger
private final DoubleProperty
private final GuiPreferences
private final TaskExecutor
Inherited from org.jabref.gui.fieldeditors.AbstractEditorViewModel:
entryfieldtextundoManager

Constructor Summary

AccessConstructor and Description
public
LinkedFilesEditorViewModel(Field field, SuggestionProvider<?> suggestionProvider, DialogService dialogService, BibDatabaseContext databaseContext, TaskExecutor taskExecutor, FieldCheckers fieldCheckers, GuiPreferences preferences, UndoManager undoManager)

Method Summary

Modifier and TypeMethod and Description
public void
private void
private void
public void
public void
public void
public boolean
public void
public ListProperty<LinkedFileViewModel>
private List<LinkedFileViewModel>
findAssociatedNotLinkedFiles(BibEntry entry)

Find files that are probably associated with the given entry but not yet linked.

public static LinkedFile
fromFile(Path file, List<Path> fileDirectories, ExternalApplicationsPreferences externalApplicationsPreferences)

Creates an instance of LinkedFile based on the given file.

public ReadOnlyBooleanProperty
public ObservableList<LinkedFileViewModel>
private static String
public UndoManager
getUndoManager()

For the linked-file context menu, whose actions record into this library's journal.

private List<LinkedFileViewModel>
private void
Inherited from org.jabref.gui.fieldeditors.AbstractEditorViewModel:
completegetFieldValidatortextProperty

Field Detail

anyDownloadOngoingback to summary
private final BooleanProperty anyDownloadOngoing
databaseContextback to summary
private final BibDatabaseContext databaseContext
dialogServiceback to summary
private final DialogService dialogService
filesback to summary
private final ListProperty<LinkedFileViewModel> files
fulltextLookupInProgressback to summary
private final BooleanProperty fulltextLookupInProgress
LOGGERback to summary
private static final Logger LOGGER
maxDownloadProgressback to summary
private final DoubleProperty maxDownloadProgress
preferencesback to summary
private final GuiPreferences preferences
taskExecutorback to summary
private final TaskExecutor taskExecutor

Constructor Detail

LinkedFilesEditorViewModelback to summary
public LinkedFilesEditorViewModel(Field field, SuggestionProvider<?> suggestionProvider, DialogService dialogService, BibDatabaseContext databaseContext, TaskExecutor taskExecutor, FieldCheckers fieldCheckers, GuiPreferences preferences, UndoManager undoManager)

Method Detail

addFromURLback to summary
public void addFromURL()
addFromURLAndDownloadback to summary
private void addFromURLAndDownload(URL url)
addFromURLAndDownloadback to summary
private void addFromURLAndDownload(URL url, Map<String, String> headers)
addNewLinkedFileback to summary
public void addNewLinkedFile(LinkedFile linkedFile)
bindToEntryback to summary
public void bindToEntry(BibEntry entry)

Overrides org.jabref.gui.fieldeditors.AbstractEditorViewModel.bindToEntry.

Annotations
@Override
deleteFileback to summary
public void deleteFile(LinkedFileViewModel file)
downloadFileback to summary
public boolean downloadFile(String urlText)
fetchFulltextback to summary
public void fetchFulltext()
filesPropertyback to summary
public ListProperty<LinkedFileViewModel> filesProperty()
findAssociatedNotLinkedFilesback to summary
private List<LinkedFileViewModel> findAssociatedNotLinkedFiles(BibEntry entry)

Find files that are probably associated with the given entry but not yet linked.

fromFileback to summary
public static LinkedFile fromFile(Path file, List<Path> fileDirectories, ExternalApplicationsPreferences externalApplicationsPreferences)

Creates an instance of LinkedFile based on the given file. We try to guess the file type and relativize the path against the given file directories.

Todo

Move this method to LinkedFile as soon as org.jabref.gui.externalfiletype.CustomExternalFileType lives in model.

fulltextLookupInProgressPropertyback to summary
public ReadOnlyBooleanProperty fulltextLookupInProgressProperty()
getFilesback to summary
public ObservableList<LinkedFileViewModel> getFiles()
getStringRepresentationback to summary
private static String getStringRepresentation(List<LinkedFileViewModel> files)
getUndoManagerback to summary
public UndoManager getUndoManager()

For the linked-file context menu, whose actions record into this library's journal.

parseToFileViewModelback to summary
private List<LinkedFileViewModel> parseToFileViewModel(String stringValue)
wireAggregateDownloadBindingsback to summary
private void wireAggregateDownloadBindings()