|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.co.mullsoft.jean.components.Browser
public class Browser
open URLs in the system browser on Windows and Unix.
| Field Summary | |
|---|---|
protected static uk.co.mullsoft.jean.components.Browser.BrowserDialog |
dialog
The dialog that allows user configuration of the options for this class. |
static java.lang.String[] |
exec
A list of commands to try in order to display the url. |
protected static java.util.ResourceBundle |
labels
Locale specific strings displayed to the user. |
| Constructor Summary | |
|---|---|
Browser()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
checkURL(java.lang.String url)
|
static java.lang.String[] |
checkURLs(java.lang.String[] url)
|
static java.lang.String[] |
defaultCommands()
Retrieve the default commands to open a browser for this system. |
static boolean |
dialogConfiguration(java.awt.Frame owner)
Show a dialog that allows the user to configure the command lines used for starting a browser on their system. |
static boolean |
dialogConfiguration(java.awt.Frame owner,
java.util.Properties props)
Deprecated. Use the uk.co.mullsoft.jean.components.Browser resource bundle to set strings for the given locale. |
static void |
displayURL(java.lang.String url1)
Display a URL in the system browser. |
static void |
displayURL(java.lang.String url,
java.lang.String namedWindow)
Display the URL in the named window. |
static void |
displayURLinNew(java.lang.String url)
Display the URL in a new window. |
static void |
displayURLs(java.lang.String[] urls1)
Display the URLs, each in their own window, in the system browser. |
static void |
displayURLs(java.lang.String[] urls,
java.lang.String namedWindow)
Display the URLs the first in the given named window. |
static void |
displayURLs(java.lang.String[] urls1,
java.lang.String[] namedWindows)
Display the URLs in the named windows. |
static void |
displayURLsinNew(java.lang.String[] urls1)
Display the URLs, each in their own window, in the system browser and the first in the named window. |
static void |
init()
Determine appropriate commands to start a browser on the current operating system. |
static void |
load(java.util.Properties props)
Load the options for this class from the given properties file. |
static void |
main(java.lang.String[] args)
Open the url(s) specified on the command line in your browser. |
static void |
save(java.util.Properties props)
Save the options used to the given properties file. |
static void |
setLocale(java.util.Locale locale)
Set the locale used for getting localized strings. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static uk.co.mullsoft.jean.components.Browser.BrowserDialog dialog
protected static java.util.ResourceBundle labels
public static java.lang.String[] exec
rundll32 url.dll,FileProtocolHandler {0}
netscape {0}
| Constructor Detail |
|---|
public Browser()
| Method Detail |
|---|
public static void setLocale(java.util.Locale locale)
locale - Locale used for i18n.public static void init()
rundll32 url.dll,FileProtocolHandler {0}
On other operating systems, the "which" command is used to
test if Mozilla, netscape, and lynx(xterm) are available (in that
order).
public static java.lang.String[] defaultCommands()
public static void save(java.util.Properties props)
props - properties file to which configuration is saved.public static void load(java.util.Properties props)
props - properties file from which configuration is loaded.public static java.lang.String[] checkURLs(java.lang.String[] url)
public static java.lang.String checkURL(java.lang.String url)
public static void displayURL(java.lang.String url1)
throws java.io.IOException
url - the url to display
java.io.IOException - if the url is not valid or the browser fails to star
public static void displayURLs(java.lang.String[] urls1)
throws java.io.IOException
urls - the list of urls to display
java.io.IOException - if the url is not valid or the browser fails to star
public static void displayURLinNew(java.lang.String url)
throws java.io.IOException
url - the url to display in a new window.
java.io.IOException - if the url is not valid or the browser fails to star
public static void displayURLsinNew(java.lang.String[] urls1)
throws java.io.IOException
urls - the list of urls to display
java.io.IOException - if the url is not valid or the browser fails to star
public static void displayURL(java.lang.String url,
java.lang.String namedWindow)
throws java.io.IOException
url - the url to displaynamedWindow - the name of the desired window.
java.io.IOException - if the url is not valid or the browser fails to star
public static void displayURLs(java.lang.String[] urls1,
java.lang.String[] namedWindows)
throws java.io.IOException
urls - the list of urls to displaynamedWindows - the list of names for the windows.
java.io.IOException - if the url is not valid or the browser fails to star
public static void displayURLs(java.lang.String[] urls,
java.lang.String namedWindow)
throws java.io.IOException
urls - the list of urls to displaynamedWindow - the name of the first window to use.
java.io.IOException - if the url is not valid or the browser fails to starpublic static void main(java.lang.String[] args)
args - Command line arguments (URLs)public static boolean dialogConfiguration(java.awt.Frame owner)
owner - The frame that owns the dialog.
public static boolean dialogConfiguration(java.awt.Frame owner,
java.util.Properties props)
Properties that are used:
uk.co.mullsoft.jean.components.BrowserDialog.title
uk.co.mullsoft.jean.components.BrowserDialog.description
uk.co.mullsoft.jean.components.BrowserDialog.label
uk.co.mullsoft.jean.components.BrowserDialog.defaults
uk.co.mullsoft.jean.components.BrowserDialog.browse
uk.co.mullsoft.jean.components.BrowserDialog.ok
uk.co.mullsoft.jean.components.BrowserDialog.cancel
owner - The frame that owns this dialog.props - contains the strings used in the dialog.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||