edu.stanford.ejalbert.launching.macos
Class MacOs2_1BrowserLaunching

java.lang.Object
  extended by edu.stanford.ejalbert.launching.macos.MacOsBrowserLaunching
      extended by edu.stanford.ejalbert.launching.macos.MacOs2_1BrowserLaunching
All Implemented Interfaces:
IBrowserLaunching

public class MacOs2_1BrowserLaunching
extends MacOsBrowserLaunching
implements IBrowserLaunching

Author:
Markus Gebhard

Field Summary
private  java.lang.String browser
           
private static java.lang.String FINDER_TYPE
          The file type of the Finder on a Macintosh.
private  java.lang.reflect.Method findFolder
           
private  java.lang.reflect.Method getFileCreator
           
private  java.lang.reflect.Method getFileType
           
private  java.lang.Object kSystemFolderType
           
 
Fields inherited from class edu.stanford.ejalbert.launching.macos.MacOsBrowserLaunching
FINDER_CREATOR
 
Fields inherited from interface edu.stanford.ejalbert.launching.IBrowserLaunching
BROWSER_DEFAULT, PROTOCOL_FILE, PROTOCOL_HTTP, PROTOCOL_MAILTO
 
Constructor Summary
MacOs2_1BrowserLaunching()
           
 
Method Summary
private  java.lang.String getBrowser()
           
 java.util.List getBrowserList()
          Returns a list of browsers to be used for browser targetting.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FINDER_TYPE

private static final java.lang.String FINDER_TYPE
The file type of the Finder on a Macintosh. Hardcoding "Finder" would keep non-U.S. English systems from working properly.

See Also:
Constant Field Values

kSystemFolderType

private java.lang.Object kSystemFolderType

findFolder

private java.lang.reflect.Method findFolder

getFileCreator

private java.lang.reflect.Method getFileCreator

getFileType

private java.lang.reflect.Method getFileType

browser

private java.lang.String browser
Constructor Detail

MacOs2_1BrowserLaunching

public MacOs2_1BrowserLaunching()
Method Detail

initialize

public void initialize()
                throws BrowserLaunchingInitializingException
Description copied from interface: IBrowserLaunching
Performs any initialization needed for the particular O/S.

Specified by:
initialize in interface IBrowserLaunching
Throws:
BrowserLaunchingInitializingException

getBrowser

private java.lang.String getBrowser()
                             throws BrowserLaunchingInitializingException
Throws:
BrowserLaunchingInitializingException

openUrl

public void openUrl(java.lang.String urlString)
             throws UnsupportedOperatingSystemException,
                    BrowserLaunchingExecutionException,
                    BrowserLaunchingInitializingException
Description copied from interface: IBrowserLaunching
Opens the passed url in the system's default browser.

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

openUrl

public void openUrl(java.lang.String browser,
                    java.lang.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:
UnsupportedOperatingSystemException
BrowserLaunchingExecutionException
BrowserLaunchingInitializingException

getBrowserList

public java.util.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