Verified Owner
Top Description Fields Constructors Methods
org.jabref.gui.help

public Class VersionWorker

extends Object
Class Inheritance
Imports
java.io.IOException, java.util.List, .Optional, java.util.concurrent.TimeUnit, org.jabref.gui.DialogService, org.jabref.gui.frame.ExternalApplicationsPreferences, org.jabref.gui.preferences.GuiPreferences, org.jabref.logic.InternalPreferences, org.jabref.logic.l10n.Localization, org.jabref.logic.util.BackgroundTask, .TaskExecutor, .Version, org.jspecify.annotations.NonNull, org.slf4j.Logger, .LoggerFactory

This worker checks if there is a new version of JabRef available. If there is, it will display a dialog to the user offering him multiple options to proceed (see changelog, go to the download page, ignore this version, and remind later).

If the version check is executed manually and this is the latest version, it will also display a dialog to inform the user.

Field Summary

Modifier and TypeField and Description
private final DialogService
private final ExternalApplicationsPreferences
private final Version
installedVersion

The current version of the installed JabRef

private final InternalPreferences
private static final Logger
private final TaskExecutor

Constructor Summary

AccessConstructor and Description
public
VersionWorker(@NonNull Version installedVersion, @NonNull DialogService dialogService, @NonNull TaskExecutor taskExecutor, @NonNull GuiPreferences preferences)

Method Summary

Modifier and TypeMethod and Description
public void
public void
private Optional<Version>
getNewVersion()

Returns a newer version excluding any non-stable versions, except if the installed one is unstable too.

private void
showConnectionError(Exception exception, boolean manualExecution)

Prints the connection problem to the status bar and shows a dialog if it was executed manually

private void
showUpdateInfo(Optional<Version> newerVersion, boolean manualExecution)

Prints up-to-date to the status bar (and shows a dialog it was executed manually) if there is now new version.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dialogServiceback to summary
private final DialogService dialogService
externalApplicationsPreferencesback to summary
private final ExternalApplicationsPreferences externalApplicationsPreferences
installedVersionback to summary
private final Version installedVersion

The current version of the installed JabRef

internalPreferencesback to summary
private final InternalPreferences internalPreferences
LOGGERback to summary
private static final Logger LOGGER
taskExecutorback to summary
private final TaskExecutor taskExecutor

Constructor Detail

VersionWorkerback to summary
public VersionWorker(@NonNull Version installedVersion, @NonNull DialogService dialogService, @NonNull TaskExecutor taskExecutor, @NonNull GuiPreferences preferences)

Method Detail

checkForNewVersionAsyncback to summary
public void checkForNewVersionAsync()
checkForNewVersionDelayedback to summary
public void checkForNewVersionDelayed()
getNewVersionback to summary
private Optional<Version> getNewVersion() throws IOException

Returns a newer version excluding any non-stable versions, except if the installed one is unstable too. If no newer version was found, then an empty optional is returned.

showConnectionErrorback to summary
private void showConnectionError(Exception exception, boolean manualExecution)

Prints the connection problem to the status bar and shows a dialog if it was executed manually

showUpdateInfoback to summary
private void showUpdateInfo(Optional<Version> newerVersion, boolean manualExecution)

Prints up-to-date to the status bar (and shows a dialog it was executed manually) if there is now new version. Shows a "New Version" Dialog to the user if there is.