Singleton service for browser operations in Swing applications.
More...
|
| boolean | openInBrowser (String url) |
| | Attempts to open a URL in the default browser asynchronously with a 2-second timeout.
|
| |
|
| void | handleError (String message, Exception e, String url) |
| | Displays error dialog to user with failure details.
|
| |
| boolean | tryOpenBrowser (String url) |
| | Executes Desktop.browse or falls back to the native xdg-open command on Linux if the AWT Desktop API fails to support the BROWSE action.
|
| |
Singleton service for browser operations in Swing applications.
Provides robust URL opening with timeout protection using the Desktop API.
◆ handleError()
| void fr.softsf.canscan.util.BrowserHelper.handleError |
( |
String | message, |
|
|
Exception | e, |
|
|
String | url ) |
|
private |
Displays error dialog to user with failure details.
- Parameters
-
| message | error description |
| e | exception that occurred |
| url | the URL that failed to open |
◆ openInBrowser()
| boolean fr.softsf.canscan.util.BrowserHelper.openInBrowser |
( |
String | url | ) |
|
Attempts to open a URL in the default browser asynchronously with a 2-second timeout.
- Parameters
-
- Returns
true if the launch command completed successfully within the timeout;
false otherwise (error details are displayed via a dialog).
- Exceptions
-
| NullPointerException | if url is null. |
◆ tryOpenBrowser()
| boolean fr.softsf.canscan.util.BrowserHelper.tryOpenBrowser |
( |
String | url | ) |
|
|
private |
Executes Desktop.browse or falls back to the native xdg-open command on Linux if the AWT Desktop API fails to support the BROWSE action.
- Parameters
-
- Returns
true if the browser was successfully called; false on internal error.
◆ ERROR
| final String fr.softsf.canscan.util.BrowserHelper.ERROR = "ERROR" |
|
staticprivate |
◆ INSTANCE
| fr.softsf.canscan.util.BrowserHelper.INSTANCE |
◆ TIMEOUT_SECONDS
| final int fr.softsf.canscan.util.BrowserHelper.TIMEOUT_SECONDS = 2 |
|
staticprivate |
The documentation for this enum was generated from the following file: