Package org.sm.smtools.application.util
Class JDesktopAccess
java.lang.Object
org.sm.smtools.application.util.JDesktopAccess
public final class JDesktopAccess
extends java.lang.Object
The
JDesktopAccess
class allows easy access for launching the platform's
default browser, mail client, and applications for opening, editing, and printing files.
Note that this class cannot be subclassed!
- Version:
- 21/09/2007
- Author:
- Sven Maerivoet
-
Method Summary
Modifier and Type Method Description static void
executeBrowseApplication(java.lang.String url)
Executes the platform's default browser.static void
executeEditApplication(java.io.File file)
Executes the platform's default application for editing a certain file.static void
executeMailApplication(java.lang.String recipient, java.lang.String subject)
Executes the platform's default mail client.static void
executeOpenApplication(java.io.File file)
Executes the platform's default application for opening a certain file.static void
executePrintApplication(java.io.File file)
Executes the platform's default application for printing a certain file.Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
executeBrowseApplication
public static void executeBrowseApplication(java.lang.String url)Executes the platform's default browser.- Parameters:
url
- the target URL to browse to
-
executeMailApplication
public static void executeMailApplication(java.lang.String recipient, java.lang.String subject)Executes the platform's default mail client.Note that when specifying the
subject
parameter, all spaces are translated into "%20" character sequences (specifynull
if no subject should be given).- Parameters:
recipient
- the recipient's e-mail addresssubject
- the subject line for the e-mail
-
executeOpenApplication
public static void executeOpenApplication(java.io.File file)Executes the platform's default application for opening a certain file.- Parameters:
file
- the file to open
-
executeEditApplication
public static void executeEditApplication(java.io.File file)Executes the platform's default application for editing a certain file.If the specified file is a directory, the file manager of the current platform is launched to open it.
- Parameters:
file
- the file to edit
-
executePrintApplication
public static void executePrintApplication(java.io.File file)Executes the platform's default application for printing a certain file.- Parameters:
file
- the file to print
-