Verified Owner
Top Description Constructors Methods
org.jabref.gui.desktop.os

public Class Windows

extends NativeDesktop
Class Inheritance
Imports
java.io.IOException, java.nio.file.Path, java.util.Optional, org.jabref.gui.DialogService, org.jabref.gui.externalfiletype.ExternalFileType, .ExternalFileTypes, org.jabref.gui.frame.ExternalApplicationsPreferences, org.jabref.logic.util.Directories, com.sun.jna.platform.win32.KnownFolders, .Shell32Util, .ShlObj, .Win32Exception, org.slf4j.LoggerFactory

This class contains Windows specific implementations for file directories and file/application open handling methods.

We cannot use a static logger instance here in this class as the Logger first needs to be configured in the JabKit#initLogging. The configuration of tinylog will become immutable as soon as the first log entry is issued. See https://tinylog.org/v2/configuration/.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Path
getApplicationDirectory()

Implements abstract org.jabref.gui.desktop.os.NativeDesktop.getApplicationDirectory.

Returns the path to the system's applications folder.

public Path
public void
public void
openFile(String filePath, String fileType, ExternalApplicationsPreferences externalApplicationsPreferences)

Implements abstract org.jabref.gui.desktop.os.NativeDesktop.openFile.

public void
openFileWithApplication(String filePath, String application)

Implements abstract org.jabref.gui.desktop.os.NativeDesktop.openFileWithApplication.

Opens a file on an Operating System, using the given application.

public void
public void
openUrlWithSystemHandler(String url)

Implements abstract org.jabref.gui.desktop.os.NativeDesktop.openUrlWithSystemHandler.

Hands the URL string, unmodified, to the OS's URL-aware handler.

Inherited from org.jabref.gui.desktop.os.NativeDesktop:
desktopBrowsegetmoveToTrashmoveToTrashSupportedopenBrowseropenBrowseropenBrowseropenBrowseropenBrowserShowPopupopenConsoleopenCustomDoiopenExternalFileAnyFormatopenExternalVieweropenFolderAndSelectFilesupportsDesktopBrowse

Constructor Detail

Windowsback to summary
public Windows()

Method Detail

getApplicationDirectoryback to summary
public Path getApplicationDirectory()

Implements abstract org.jabref.gui.desktop.os.NativeDesktop.getApplicationDirectory.

Doc from org.jabref.gui.desktop.os.NativeDesktop.getApplicationDirectory.

Returns the path to the system's applications folder.

Annotations
@Override
getDefaultFileChooserDirectoryback to summary
public Path getDefaultFileChooserDirectory()

Overrides org.jabref.gui.desktop.os.NativeDesktop.getDefaultFileChooserDirectory.

Doc from org.jabref.gui.desktop.os.NativeDesktop.getDefaultFileChooserDirectory.

Get the user's default file chooser directory

Annotations
@Override
openConsoleback to summary
public void openConsole(String absolutePath, DialogService dialogService) throws IOException

Implements abstract org.jabref.gui.desktop.os.NativeDesktop.openConsole.

Annotations
@Override
openFileback to summary
public void openFile(String filePath, String fileType, ExternalApplicationsPreferences externalApplicationsPreferences) throws IOException

Implements abstract org.jabref.gui.desktop.os.NativeDesktop.openFile.

Annotations
@Override
openFileWithApplicationback to summary
public void openFileWithApplication(String filePath, String application) throws IOException

Implements abstract org.jabref.gui.desktop.os.NativeDesktop.openFileWithApplication.

Doc from org.jabref.gui.desktop.os.NativeDesktop.openFileWithApplication.

Opens a file on an Operating System, using the given application.

Annotations
@Override
openFolderAndSelectFileback to summary
public void openFolderAndSelectFile(Path filePath) throws IOException

Implements abstract org.jabref.gui.desktop.os.NativeDesktop.openFolderAndSelectFile.

Annotations
@Override
openUrlWithSystemHandlerback to summary
public void openUrlWithSystemHandler(String url) throws IOException

Implements abstract org.jabref.gui.desktop.os.NativeDesktop.openUrlWithSystemHandler.

Doc from org.jabref.gui.desktop.os.NativeDesktop.openUrlWithSystemHandler.

Hands the URL string, unmodified, to the OS's URL-aware handler. Used when Desktop.browse is unsupported, not applicable, or failed; the URL must never be run through Path.of, which mangles it.

Annotations
@Override