edu.stanford.ejalbert.launching.misc
Class UnixNetscapeBrowserLaunching

java.lang.Object
  extended byedu.stanford.ejalbert.launching.misc.UnixNetscapeBrowserLaunching
All Implemented Interfaces:
IBrowserLaunching
Direct Known Subclasses:
SunOSBrowserLaunching

public class UnixNetscapeBrowserLaunching
extends Object
implements IBrowserLaunching

Tries several browsers (mozilla, netscape, firefox, opera, and konqueror). Most users will have at least one of these installed. The types are defined in StandardUnixBrowser.

Author:
Markus Gebhard, Jeff Chapman

Field Summary
protected  AbstractLogger logger
           
 
Fields inherited from interface edu.stanford.ejalbert.launching.IBrowserLaunching
BROWSER_DEFAULT, PROTOCOL_FILE, PROTOCOL_HTTP, PROTOCOL_MAILTO
 
Constructor Summary
UnixNetscapeBrowserLaunching(AbstractLogger logger)
           
 
Method Summary
 List getBrowserList()
          Returns a list of browsers to be used for browser targetting.
 void initialize()
          Use the which command to find out which browsers are available.
 void openUrl(String urlString)
          This implementation will cause the calling thread to block until the browser exits.
 void openUrl(String browser, String urlString)
          Allows user to target a specific browser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final AbstractLogger logger
Constructor Detail

UnixNetscapeBrowserLaunching

public UnixNetscapeBrowserLaunching(AbstractLogger logger)
Method Detail

initialize

public void initialize()
                throws BrowserLaunchingInitializingException
Use the which command to find out which browsers are available.

Specified by:
initialize in interface IBrowserLaunching
Throws:
BrowserLaunchingInitializingException

openUrl

public void openUrl(String urlString)
             throws UnsupportedOperatingSystemException,
                    BrowserLaunchingExecutionException,
                    BrowserLaunchingInitializingException
This implementation will cause the calling thread to block until the browser exits. Calling methods MUST wrap the call in a separate thread.

Specified by:
openUrl in interface IBrowserLaunching
Parameters:
urlString - String
Throws:
BrowserLaunchingExecutionException
UnsupportedOperatingSystemException
BrowserLaunchingInitializingException

openUrl

public void openUrl(String browser,
                    String urlString)
             throws UnsupportedOperatingSystemException,
                    BrowserLaunchingExecutionException,
                    BrowserLaunchingInitializingException
Description copied from interface: IBrowserLaunching
Allows user to target a specific browser. The names of potential browsers can be accessed via the getBrowserList method.

If the call to the requested browser fails, the code will fail over to the default browser.

Specified by:
openUrl in interface IBrowserLaunching
Parameters:
browser - String
urlString - String
Throws:
BrowserLaunchingExecutionException
BrowserLaunchingInitializingException
UnsupportedOperatingSystemException

getBrowserList

public List getBrowserList()
Returns a list of browsers to be used for browser targetting. This list will always contain at least one item--the BROWSER_DEFAULT.

Specified by:
getBrowserList in interface IBrowserLaunching
Returns:
List