|
JDIC API V2006 Release 0308 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.jdic.desktop.Desktop
public class Desktop
The Desktop
class provides several methods to interact with
the system applications and facilities. It cannot be instantiated.
The methods include invoking system programs associated with a particular
file type, invoking the system default browser to show a given URL, invoking
the system default mailer with or without a constructed Message
object, and making use of the printer to print a given file.
Message
,
DesktopException
Method Summary | |
---|---|
static void |
browse(java.net.URL url)
Launches the system default browser to show the given URL. |
static void |
edit(java.io.File file)
Launches the associated editor to edit the given file. |
static boolean |
isEditable(java.io.File file)
Tests whether the given file is editable. |
static boolean |
isPrintable(java.io.File file)
Tests whether the given file could be printed. |
static void |
mail()
Launches the message compose window of the default mailer. |
static void |
mail(Message msg)
Launches the message compose window of the default mailer, and fills in the message fields with the field values of the given Message
object. |
static void |
open(java.io.File file)
Launches the associated application to open a file |
static void |
print(java.io.File file)
Prints the given file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void open(java.io.File file) throws DesktopException
If the specified file is a directory, the file manager of the current platform is launched to open it.
file
- the given file.
DesktopException
- If the specified file has no associated
application, or the associated application fails to be launched.public static boolean isPrintable(java.io.File file)
file
- the given file.
true
if the given file is valid and is printable;
false
otherwise.public static void print(java.io.File file) throws DesktopException
file
- the given file.
DesktopException
- if the given file is not valid, or the given
file is not printable, or the given file fails to be printed.public static boolean isEditable(java.io.File file)
file
- the given file.
true
if the given file is valid and has an
associated editor; false
otherwise.public static void edit(java.io.File file) throws DesktopException
file
- the given file.
DesktopException
- if the given file is not valid, or the given
file is not editable, or the given editor fails to be launched.public static void browse(java.net.URL url) throws DesktopException
url
- the given URL.
DesktopException
- if the given url is null, or the system default
browser is not found, or the system browser fails to be launched.public static void mail() throws DesktopException
DesktopException
- if the system default mailer was not found,
or it fails to be launched.public static void mail(Message msg) throws DesktopException
Message
object.
msg
- the constructed Message
object.
DesktopException
- if the given message object is null, or the
system default mailer was not found, or it fails to be launched.
|
JDIC API V2006 Release 0308 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, working code examples, license terms and bug report information.
Copyright (c) 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.