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.Files, .Path, java.util.ArrayList, .List, .Optional, java.util.stream.Collectors, javax.swing.undo.UndoManager, javafx.beans.property.BooleanProperty, .ListProperty, .ReadOnlyBooleanProperty, .SimpleBooleanProperty, .SimpleListProperty, javafx.collections.FXCollections, .ObservableList, org.jabref.gui.DialogService, org.jabref.gui.autocompleter.SuggestionProvider, org.jabref.gui.externalfiles.AutoSetFileLinksUtil, org.jabref.gui.externalfiletype.CustomExternalFileType, .ExternalFileType, .ExternalFileTypes, .UnknownExternalFileType, org.jabref.gui.linkedfile.AttachFileFromURLAction, org.jabref.gui.util.BackgroundTask, .BindingsHelper, .FileDialogConfiguration, .TaskExecutor, 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.util.io.FileNameCleaner, .FileUtil, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.BibEntry, .LinkedFile, org.jabref.model.entry.field.Field, .StandardField, org.jabref.preferences.FilePreferences, .PreferencesService, org.slf4j.Logger, .LoggerFactory

Field Summary

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

Constructor Summary

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

Method Summary

Modifier and TypeMethod and Description
public void
private void
public void
private void
addNewLinkedFile(Path correctPath, List<Path> fileDirectories)

public void
public void
public boolean
public void
public ListProperty<LinkedFileViewModel>
private List<LinkedFileViewModel>
findAssociatedNotLinkedFiles(BibEntry entry)

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

public static LinkedFile
fromFile(Path file, List<Path> fileDirectories, FilePreferences filePreferences)

Creates an instance of LinkedFile based on the given file.

public LinkedFileViewModel
fromFile(Path file, FilePreferences filePreferences)

public ReadOnlyBooleanProperty
public ObservableList<LinkedFileViewModel>
private static String
private List<LinkedFileViewModel>
Inherited from org.jabref.gui.fieldeditors.AbstractEditorViewModel:
completegetFieldValidatortextProperty

Field Detail

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
preferencesback to summary
private final PreferencesService 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, PreferencesService preferences, UndoManager undoManager)

Method Detail

addFromURLback to summary
public void addFromURL()
addFromURLAndDownloadback to summary
private void addFromURLAndDownload(URL url)
addNewFileback to summary
public void addNewFile()
addNewLinkedFileback to summary
private void addNewLinkedFile(Path correctPath, List<Path> fileDirectories)
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 to the given entry but not yet linked.

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

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 CustomExternalFileType lives in model.

fromFileback to summary
public LinkedFileViewModel fromFile(Path file, FilePreferences filePreferences)
fulltextLookupInProgressPropertyback to summary
public ReadOnlyBooleanProperty fulltextLookupInProgressProperty()
getFilesback to summary
public ObservableList<LinkedFileViewModel> getFiles()
getStringRepresentationback to summary
private static String getStringRepresentation(List<LinkedFileViewModel> files)
parseToFileViewModelback to summary
private List<LinkedFileViewModel> parseToFileViewModel(String stringValue)