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/.
See https://stackoverflow.com/questions/18004150/desktop-api-is-not-supported-on-the-current-platform for more implementation hints. https://docs.oracle.com/javase/7/docs/api/java/awt/Desktop.html cannot be used as we don't want to rely on AWT.
For non-GUI things, see org..
| Modifier and Type | Field and Description |
|---|---|
| private static final Pattern |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| private static void | |
| public static NativeDesktop | |
| public abstract Path | |
| public Path | |
| public void | |
| public boolean | |
| public static void | openBrowser(String
the URL to open url, ExternalApplicationsPreferences externalApplicationsPreferences)Opens the given URL using the system browser |
| public static void | openBrowser(String
the URL to open url, ExternalApplicationsPreferences externalApplicationsPreferences, Consumer<IOException> invoked (from a background thread) when opening fails after this
method has already returned; synchronous failures throw instead onAsyncFailure)Opens the given URL using the system browser |
| pack-priv static void | openBrowser(String url, ExternalApplicationsPreferences externalApplicationsPreferences, Consumer<IOException> onAsyncFailure, NativeDesktop desktop)
|
| public static void | |
| public static void | openBrowserShowPopup(String
the URL to open url, DialogService dialogService, ExternalApplicationsPreferences externalApplicationsPreferences)Opens the url with the users standard Browser. |
| public static void | openConsole(Path
Location the console should be opened at. file, GuiPreferences preferences, DialogService dialogService)Opens a new console starting on the given file location |
| public abstract void | |
| public static void | |
| private static void | |
| public static boolean | Returns: false if the link couldn't be resolved, true otherwise.The database this file belongs to. databaseContext, ExternalApplicationsPreferences externalApplicationsPreferences, FilePreferences filePreferences, String The filename. link, final Optional<ExternalFileType> type)Open an external file, attempting to use the correct viewer for it. |
| private static void | openExternalFilePlatformIndependent(Optional<ExternalFileType> fileType, String filePath, ExternalApplicationsPreferences externalApplicationsPreferences)
|
| public static void | openExternalViewer(BibDatabaseContext databaseContext, GuiPreferences preferences, String initialLink, Field initialField, DialogService dialogService, BibEntry entry)
Open a http/pdf/ps viewer for the given link string. |
| public abstract void | openFile(String filePath, String fileType, ExternalApplicationsPreferences externalApplicationsPreferences)
|
| public abstract void | openFileWithApplication(String
The filename. filePath, String Link to the app that opens the file. application)Opens a file on an Operating System, using the given application. |
| public static void | openFolderAndSelectFile(Path
the location of the file fileLink, ExternalApplicationsPreferences externalApplicationsPreferences, DialogService dialogService)Opens a file browser of the folder of the given file. |
| public abstract void | |
| private static void | |
| public abstract void | openUrlWithSystemHandler(String url)
Hands the URL string, unmodified, to the OS's URL-aware handler. |
| private static void | |
| pack-priv boolean |
| REMOTE_LINK_PATTERN | back to summary |
|---|---|
| private static final Pattern REMOTE_LINK_PATTERN | |
| NativeDesktop | back to summary |
|---|---|
| public NativeDesktop() | |
| desktopBrowse | back to summary |
|---|---|
| pack-priv void desktopBrowse(URI uri) throws IOException Opens the URI via the AWT desktop integration. Overridable for tests. | |
| executeCommand | back to summary |
|---|---|
| private static void executeCommand(String command, String absolutePath, DialogService dialogService) | |
| get | back to summary |
|---|---|
| public static NativeDesktop get() | |
| getApplicationDirectory | back to summary |
|---|---|
| public abstract Path getApplicationDirectory() Returns the path to the system's applications folder.
| |
| getDefaultFileChooserDirectory | back to summary |
|---|---|
| public Path getDefaultFileChooserDirectory() Get the user's default file chooser directory
| |
| moveToTrash | back to summary |
|---|---|
| public void moveToTrash(Path path) Moves the given file to the trash.
| |
| moveToTrashSupported | back to summary |
|---|---|
| public boolean moveToTrashSupported() | |
| openBrowser | back to summary |
|---|---|
| public static void openBrowser(String url, ExternalApplicationsPreferences externalApplicationsPreferences) throws IOException Opens the given URL using the system browser
| |
| openBrowser | back to summary |
|---|---|
| public static void openBrowser(String url, ExternalApplicationsPreferences externalApplicationsPreferences, Consumer<IOException> onAsyncFailure) throws IOException Opens the given URL using the system browser
| |
| openBrowser | back to summary |
|---|---|
pack-priv static void openBrowser(String url, ExternalApplicationsPreferences externalApplicationsPreferences, Consumer<IOException> onAsyncFailure, NativeDesktop desktop) throws IOException
| |
| openBrowser | back to summary |
|---|---|
| public static void openBrowser(URI url, ExternalApplicationsPreferences externalApplicationsPreferences) throws IOException | |
| openBrowserShowPopup | back to summary |
|---|---|
| public static void openBrowserShowPopup(String url, DialogService dialogService, ExternalApplicationsPreferences externalApplicationsPreferences) Opens the url with the users standard Browser. If that fails a popup will be shown to instruct the user to open the link manually and the link gets copied to the clipboard
| |
| openConsole | back to summary |
|---|---|
| public static void openConsole(Path file, GuiPreferences preferences, DialogService dialogService) throws IOException Opens a new console starting on the given file location
| |
| openConsole | back to summary |
|---|---|
| public abstract void openConsole(String absolutePath, DialogService dialogService) throws IOException | |
| openCustomDoi | back to summary |
|---|---|
| public static void openCustomDoi(String link, GuiPreferences preferences, DialogService dialogService) | |
| openDoi | back to summary |
|---|---|
| private static void openDoi(String doi, GuiPreferences preferences) throws IOException | |
| openExternalFileAnyFormat | back to summary |
|---|---|
| public static boolean openExternalFileAnyFormat(final BibDatabaseContext databaseContext, ExternalApplicationsPreferences externalApplicationsPreferences, FilePreferences filePreferences, String link, final Optional<ExternalFileType> type) throws IOException Open an external file, attempting to use the correct viewer for it. If the "file" is an online link, instead open it with the browser
| |
| openExternalFilePlatformIndependent | back to summary |
|---|---|
| private static void openExternalFilePlatformIndependent(Optional<ExternalFileType> fileType, String filePath, ExternalApplicationsPreferences externalApplicationsPreferences) throws IOException | |
| openExternalViewer | back to summary |
|---|---|
| public static void openExternalViewer(BibDatabaseContext databaseContext, GuiPreferences preferences, String initialLink, Field initialField, DialogService dialogService, BibEntry entry) throws IOException Open a http/pdf/ps viewer for the given link string. Opening a PDF file at the file field is done at | |
| openFile | back to summary |
|---|---|
| public abstract void openFile(String filePath, String fileType, ExternalApplicationsPreferences externalApplicationsPreferences) throws IOException | |
| openFileWithApplication | back to summary |
|---|---|
| public abstract void openFileWithApplication(String filePath, String application) throws IOException Opens a file on an Operating System, using the given application. | |
| openFolderAndSelectFile | back to summary |
|---|---|
| public static void openFolderAndSelectFile(Path fileLink, ExternalApplicationsPreferences externalApplicationsPreferences, DialogService dialogService) throws IOException Opens a file browser of the folder of the given file. If possible, the file is selected
| |
| openFolderAndSelectFile | back to summary |
|---|---|
| public abstract void openFolderAndSelectFile(Path file) throws IOException | |
| openIsbn | back to summary |
|---|---|
| private static void openIsbn(String isbn, GuiPreferences preferences) throws IOException | |
| openUrlWithSystemHandler | back to summary |
|---|---|
| public abstract void openUrlWithSystemHandler(String url) throws IOException Hands the URL string, unmodified, to the OS's URL-aware handler.
Used when | |
| showManualOpenPopup | back to summary |
|---|---|
| private static void showManualOpenPopup(String url, DialogService dialogService, IOException exception) | |
| supportsDesktopBrowse | back to summary |
|---|---|
| pack-priv boolean supportsDesktopBrowse() Whether the AWT desktop integration can open URLs. Overridable for tests. | |