MacOs2_0BrowserLaunching
, MacOs2_1BrowserLaunching
, MacOs3_0BrowserLaunching
, MacOs3_1BrowserLaunching
, MacOsBrowserLaunching
, SunOSBrowserLaunching
, UnixNetscapeBrowserLaunching
, WindowsBrowserLaunching
public interface IBrowserLaunching
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
BROWSER_DEFAULT |
Identifier for the system's default browser.
|
static java.lang.String |
BROWSER_SYSTEM_PROPERTY |
Key to system property containing name of users
preferred browser.
|
static java.lang.String |
PROP_KEY_BROWSER_PREFIX |
prefix used for property file keys that define a browser
|
static java.lang.String |
PROP_KEY_DELIMITER |
property file key for delimiter character used in other properties.
|
static java.lang.String |
PROTOCOL_FILE |
file protocol
|
static java.lang.String |
PROTOCOL_HTTP |
http protocol
|
static java.lang.String |
PROTOCOL_MAILTO |
mailto protocol
|
static java.lang.String |
WINDOWS_BROWSER_DISC_POLICY_DISK |
Value associated with WINDOWS_BROWSER_DISC_POLICY_PROPERTY.
|
static java.lang.String |
WINDOWS_BROWSER_DISC_POLICY_PROPERTY |
Key to system property that controls how browsers are discovered
when running on a Windows O/S.
|
static java.lang.String |
WINDOWS_BROWSER_DISC_POLICY_REGISTRY |
Value associated with WINDOWS_BROWSER_DISC_POLICY_PROPERTY.
|
Modifier and Type | Method | Description |
---|---|---|
java.util.List |
getBrowserList() |
Returns a list of browsers to be used for browser targetting.
|
boolean |
getNewWindowPolicy() |
Returns the policy used for opening a url in a browser.
|
void |
initialize() |
Performs any initialization needed for the particular O/S.
|
void |
openUrl(java.lang.String urlString) |
Opens the passed url in the system's default browser.
|
void |
openUrl(java.lang.String browser,
java.lang.String urlString) |
Allows user to target a specific browser.
|
void |
openUrl(java.util.List browsers,
java.lang.String urlString) |
Allows user to target several browsers.
|
void |
setNewWindowPolicy(boolean forceNewWindow) |
Sets the policy used for opening a url in a browser.
|
static final java.lang.String BROWSER_SYSTEM_PROPERTY
static final java.lang.String WINDOWS_BROWSER_DISC_POLICY_PROPERTY
The values are registry and disk.
static final java.lang.String WINDOWS_BROWSER_DISC_POLICY_DISK
static final java.lang.String WINDOWS_BROWSER_DISC_POLICY_REGISTRY
static final java.lang.String PROP_KEY_DELIMITER
static final java.lang.String PROP_KEY_BROWSER_PREFIX
static final java.lang.String PROTOCOL_HTTP
static final java.lang.String PROTOCOL_FILE
static final java.lang.String PROTOCOL_MAILTO
static final java.lang.String BROWSER_DEFAULT
void initialize() throws BrowserLaunchingInitializingException
void openUrl(java.lang.String urlString) throws UnsupportedOperatingSystemException, BrowserLaunchingExecutionException, BrowserLaunchingInitializingException
urlString
- StringUnsupportedOperatingSystemException
BrowserLaunchingExecutionException
BrowserLaunchingInitializingException
void openUrl(java.lang.String browser, java.lang.String urlString) throws UnsupportedOperatingSystemException, BrowserLaunchingExecutionException, BrowserLaunchingInitializingException
getBrowserList
method.
If the call to the requested browser fails, the code will fail over to the default browser.
browser
- StringurlString
- StringUnsupportedOperatingSystemException
BrowserLaunchingExecutionException
BrowserLaunchingInitializingException
void openUrl(java.util.List browsers, java.lang.String urlString) throws UnsupportedOperatingSystemException, BrowserLaunchingExecutionException, BrowserLaunchingInitializingException
getBrowserList
method.
The browsers from the list will be tried in order (first to last) until one of the calls succeeds. If all the calls to the requested browsers fail, the code will fail over to the default browser.
browsers
- ListurlString
- StringUnsupportedOperatingSystemException
BrowserLaunchingExecutionException
BrowserLaunchingInitializingException
java.util.List getBrowserList()
BROWSER_DEFAULT
.boolean getNewWindowPolicy()
If the policy is true, an attempt will be made to force the url to be opened in a new instance (window) of the browser.
If the policy is false, the url may open in a new window or a new tab.
Results will vary based on the O/S and browser being targetted.
void setNewWindowPolicy(boolean forceNewWindow)
forceNewWindow
- boolean