Top Fields Constructors Methods
org.jabref.gui.fieldeditors

public Class LinkedFileViewModel

extends AbstractViewModel
Class Inheritance
Imports
java.io.IOException, java.nio.file.Files, .Path, java.util.ArrayList, .Arrays, .List, .Optional, java.util.function.BiPredicate, javafx.beans.Observable, javafx.beans.binding.Bindings, .ObjectBinding, javafx.beans.property.BooleanProperty, .DoubleProperty, .SimpleBooleanProperty, .SimpleDoubleProperty, .StringProperty, javafx.scene.Node, org.jabref.gui.AbstractViewModel, .DialogService, org.jabref.gui.desktop.os.NativeDesktop, org.jabref.gui.externalfiles.PdfMergeDialog, org.jabref.gui.externalfiletype.ExternalFileType, .ExternalFileTypes, org.jabref.gui.icon.IconTheme, .JabRefIcon, org.jabref.gui.linkedfile.DeleteFileAction, .DownloadLinkedFileAction, .LinkedFileEditDialog, org.jabref.gui.mergeentries.MultiMergeEntriesView, org.jabref.gui.preferences.GuiPreferences, org.jabref.gui.util.ControlHelper, org.jabref.logic.FilePreferences, org.jabref.logic.externalfiles.LinkedFileHandler, org.jabref.logic.l10n.Localization, org.jabref.logic.util.TaskExecutor, org.jabref.logic.util.io.FileUtil, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.BibEntry, .LinkedFile, org.jabref.model.strings.StringUtil, org.jabref.model.util.OptionalUtil, 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.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private final BibDatabaseContext
private final DialogService
private final BooleanProperty
private final DoubleProperty
private final BibEntry
private final de.saxsys.mvvmfx.utils.validation.Validator
private final BooleanProperty
private final BooleanProperty
private final LinkedFile
private final LinkedFileHandler
private ObjectBinding<Node>
private static final Logger
private final GuiPreferences
private final TaskExecutor

Constructor Summary

AccessConstructor and Description
public
LinkedFileViewModel(LinkedFile linkedFile, BibEntry entry, BibDatabaseContext databaseContext, TaskExecutor taskExecutor, DialogService dialogService, GuiPreferences preferences)

Method Summary

Modifier and TypeMethod and Description
public void
public void
public boolean

Returns:

true if the linked file has been removed afterward from the entry (i.e., because it was deleted successfully, does not exist in the first place, or the user choose to remove it)
delete
()

Asks the user for confirmation that he really wants to the delete the file from disk (or just remove the link) and then proceeds accordingly.

public StringProperty
public void
download(boolean keepHtmlLink)

public BooleanProperty
public DoubleProperty
public void
edit()

public de.saxsys.mvvmfx.utils.validation.ValidationStatus
public Optional<Path>
findIn(List<Path> directories)

public static LinkedFileViewModel
fromLinkedFile(LinkedFile linkedFile, BibEntry entry, BibDatabaseContext databaseContext, TaskExecutor taskExecutor, DialogService dialogService, GuiPreferences preferences)

public String
public LinkedFile
public Observable[]
public JabRefIcon
public boolean
public BooleanProperty
public boolean

Returns:

true if the suggested filename is same as current filename.
isGeneratedNameSameAsOriginal
()

Gets the filename for the current linked file and compares it to the new suggested filename.

public boolean

Returns:

true if suggested filepath is same as existing filepath.
isGeneratedPathSameAsOriginal
()

Compares suggested directory of current linkedFile with existing filepath directory.

public BooleanProperty
public StringProperty
public void
public void
public void
public void
open()

public void
public void
private void
public void
public void
renameFileToName(String targetFileName)

public void
public ObjectBinding<Node>

Field Detail

databaseContextback to summary
private final BibDatabaseContext databaseContext
dialogServiceback to summary
private final DialogService dialogService
downloadOngoingback to summary
private final BooleanProperty downloadOngoing
downloadProgressback to summary
private final DoubleProperty downloadProgress
entryback to summary
private final BibEntry entry
fileExistsValidatorback to summary
private final de.saxsys.mvvmfx.utils.validation.Validator fileExistsValidator
isAutomaticallyFoundback to summary
private final BooleanProperty isAutomaticallyFound
isOfflinePdfback to summary
private final BooleanProperty isOfflinePdf
linkedFileback to summary
private final LinkedFile linkedFile
linkedFileHandlerback to summary
private final LinkedFileHandler linkedFileHandler
linkedFileIconBindingback to summary
private ObjectBinding<Node> linkedFileIconBinding
LOGGERback to summary
private static final Logger LOGGER
preferencesback to summary
private final GuiPreferences preferences
taskExecutorback to summary
private final TaskExecutor taskExecutor

Constructor Detail

LinkedFileViewModelback to summary
public LinkedFileViewModel(LinkedFile linkedFile, BibEntry entry, BibDatabaseContext databaseContext, TaskExecutor taskExecutor, DialogService dialogService, GuiPreferences preferences)

Method Detail

acceptAsLinkedback to summary
public void acceptAsLinked()
askForNameAndRenameback to summary
public void askForNameAndRename()
deleteback to summary
public boolean delete()

Asks the user for confirmation that he really wants to the delete the file from disk (or just remove the link) and then proceeds accordingly.

Returns:boolean

true if the linked file has been removed afterward from the entry (i.e., because it was deleted successfully, does not exist in the first place, or the user choose to remove it)

descriptionPropertyback to summary
public StringProperty descriptionProperty()
downloadback to summary
public void download(boolean keepHtmlLink)
downloadOngoingPropertyback to summary
public BooleanProperty downloadOngoingProperty()
downloadProgressPropertyback to summary
public DoubleProperty downloadProgressProperty()
editback to summary
public void edit()
fileExistsValidationStatusback to summary
public de.saxsys.mvvmfx.utils.validation.ValidationStatus fileExistsValidationStatus()
findInback to summary
public Optional<Path> findIn(List<Path> directories)
fromLinkedFileback to summary
public static LinkedFileViewModel fromLinkedFile(LinkedFile linkedFile, BibEntry entry, BibDatabaseContext databaseContext, TaskExecutor taskExecutor, DialogService dialogService, GuiPreferences preferences)
getDescriptionback to summary
public String getDescription()
getFileback to summary
public LinkedFile getFile()
getObservablesback to summary
public Observable[] getObservables()
getTypeIconback to summary
public JabRefIcon getTypeIcon()
isAutomaticallyFoundback to summary
public boolean isAutomaticallyFound()
isAutomaticallyFoundPropertyback to summary
public BooleanProperty isAutomaticallyFoundProperty()
isGeneratedNameSameAsOriginalback to summary
public boolean isGeneratedNameSameAsOriginal()

Gets the filename for the current linked file and compares it to the new suggested filename.

Returns:boolean

true if the suggested filename is same as current filename.

isGeneratedPathSameAsOriginalback to summary
public boolean isGeneratedPathSameAsOriginal()

Compares suggested directory of current linkedFile with existing filepath directory.

Returns:boolean

true if suggested filepath is same as existing filepath.

isOfflinePdfPropertyback to summary
public BooleanProperty isOfflinePdfProperty()
linkPropertyback to summary
public StringProperty linkProperty()
markAsAutomaticallyFoundback to summary
public void markAsAutomaticallyFound()
moveToDefaultDirectoryback to summary
public void moveToDefaultDirectory()
moveToDefaultDirectoryAndRenameback to summary
public void moveToDefaultDirectoryAndRename()
openback to summary
public void open()
openFolderback to summary
public void openFolder()
parsePdfMetadataAndShowMergeDialogback to summary
public void parsePdfMetadataAndShowMergeDialog()
performRenameWithConflictCheckback to summary
private void performRenameWithConflictCheck(String targetFileName)
redownloadback to summary
public void redownload()
renameFileToNameback to summary
public void renameFileToName(String targetFileName)
renameToSuggestionback to summary
public void renameToSuggestion()
typeIconPropertyback to summary
public ObjectBinding<Node> typeIconProperty()