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

public Class GitPullAction

extends SimpleCommand
Class Inheritance
Imports
java.io.IOException, java.nio.file.Path, java.util.List, .Optional, .StringJoiner, org.jabref.gui.DialogService, .StateManager, org.jabref.gui.actions.ActionHelper, .SimpleCommand, org.jabref.gui.preferences.GuiPreferences, org.jabref.logic.JabRefException, org.jabref.logic.git.GitSyncService, org.jabref.logic.git.conflicts.GitConflictResolverStrategy, .ThreeWayEntryConflict, org.jabref.logic.git.io.GitFileWriter, org.jabref.logic.git.model.BookkeepingResult, .MergePlan, .PullPlan, org.jabref.logic.git.util.GitHandlerRegistry, org.jabref.logic.l10n.Localization, org.jabref.logic.util.BackgroundTask, .TaskExecutor, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.BibEntry, org.eclipse.jgit.api.errors.GitAPIException, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private final DialogService
private final GitHandlerRegistry
private final GuiPreferences
private static final Logger
private final StateManager
private final TaskExecutor
Inherited from org.jabref.gui.actions.SimpleCommand:
statusMessage

Constructor Summary

AccessConstructor and Description
public
GitPullAction(DialogService dialogService, StateManager stateManager, GuiPreferences guiPreferences, TaskExecutor taskExecutor, GitHandlerRegistry gitHandlerRegistry)

Method Summary

Modifier and TypeMethod and Description
public void
private Optional<PullPlan>

Returns:

An Optional containing the PullPlan if a merge is needed, or Optional.empty() if the local library is already up-to-date or ahead of the remote branch.
prepareMergeResult
(BibDatabaseContext databaseContext, Path bibPath, GitHandlerRegistry registry)

Prepares a merge plan for the given library and file path.

private BookkeepingResult
saveAndFinalize(Path bibPath, BibDatabaseContext databaseContext, PullPlan pullPlan)

private void
Inherited from org.jabref.gui.actions.SimpleCommand:
getProgressprogressPropertysetExecutablestatusMessageProperty

Field Detail

dialogServiceback to summary
private final DialogService dialogService
gitHandlerRegistryback to summary
private final GitHandlerRegistry gitHandlerRegistry
guiPreferencesback to summary
private final GuiPreferences guiPreferences
LOGGERback to summary
private static final Logger LOGGER
stateManagerback to summary
private final StateManager stateManager
taskExecutorback to summary
private final TaskExecutor taskExecutor

Constructor Detail

GitPullActionback to summary
public GitPullAction(DialogService dialogService, StateManager stateManager, GuiPreferences guiPreferences, TaskExecutor taskExecutor, GitHandlerRegistry gitHandlerRegistry)

Method Detail

executeback to summary
public void execute()
Annotations
@Override
prepareMergeResultback to summary
private Optional<PullPlan> prepareMergeResult(BibDatabaseContext databaseContext, Path bibPath, GitHandlerRegistry registry) throws IOException, GitAPIException, org.jabref.logic.JabRefException

Prepares a merge plan for the given library and file path.

Returns:Optional<PullPlan>

An Optional containing the PullPlan if a merge is needed, or Optional.empty() if the local library is already up-to-date or ahead of the remote branch.

saveAndFinalizeback to summary
private BookkeepingResult saveAndFinalize(Path bibPath, BibDatabaseContext databaseContext, PullPlan pullPlan) throws IOException, GitAPIException, org.jabref.logic.JabRefException
showPullErrorback to summary
private void showPullError(Throwable exception)