org.opensourcephysics.desktop
Class OSPDesktop

java.lang.Object
  extended by org.opensourcephysics.desktop.OSPDesktop

public class OSPDesktop
extends java.lang.Object

OSPDesktop invokes the java.awt.Desktop API using reflection for Java 1.5 compatibility.

Author:
Wolfgang Christian

Constructor Summary
OSPDesktop()
           
 
Method Summary
static boolean browse(java.lang.String uriName)
          Launches the default browser to display a URI.
static boolean browse(java.net.URI uri)
          Launches the default browser to display a URI.
static boolean displayURL(java.lang.String url)
          Display a URL in the system browser.
static boolean edit(java.io.File file)
          Launches the default application to edit a file.
static boolean isDesktopSupported()
          Determines if the desktop API is supported.
static boolean mail()
          Launches the default email program without a recipient.
static boolean mail(java.lang.String addr)
          Launches the default email program with the given address.
static boolean open(java.io.File file)
          Launches the default application to edit a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OSPDesktop

public OSPDesktop()
Method Detail

displayURL

public static boolean displayURL(java.lang.String url)
Display a URL in the system browser. Attempts to open URL with desktop API if available; attempts Ostermiller code otherwise.

Returns:
true if successful

isDesktopSupported

public static boolean isDesktopSupported()
Determines if the desktop API is supported.

Returns:
true if the desktop API is supported.

browse

public static boolean browse(java.lang.String uriName)
Launches the default browser to display a URI.

Parameters:
uriName -

browse

public static boolean browse(java.net.URI uri)
Launches the default browser to display a URI.

Parameters:
uri -
Returns:
true if successful

mail

public static boolean mail(java.lang.String addr)
Launches the default email program with the given address.

Parameters:
addr -
Returns:
true if successful

mail

public static boolean mail()
Launches the default email program without a recipient.

Returns:
true if successful

edit

public static boolean edit(java.io.File file)
Launches the default application to edit a file.

Parameters:
file -

open

public static boolean open(java.io.File file)
Launches the default application to edit a file.

Parameters:
file -