java.awt
public class Desktop extends Object
open
command selects a default registered application for the
specified file type. For example, opening an odf file results in launching
OpenOffice. If an operation is not supported, or the application fails to
launch, an exception is generated.
Implementation note: As this class is used to manage Desktop
integration, we provide some extension to configure the behaviour of this
class depending on the type of dektop that is detected.gnu.java.awt.peer.Desktop.html.command
gnu.java.awt.peer.Desktop.mail.command
gnu.java.awt.peer.Desktop.edit.command
gnu.java.awt.peer.Desktop.print.command
gnu.java.awt.peer.Desktop.open.command
gnu.java.awt.peer.ClasspathDesktopPeer
. This node
contains a child for each supported operation. The key for each type is
always command
:
gnu.java.awt.peer.Desktop.html.command
gnu.java.awt.peer.Desktop.mail.command
gnu.java.awt.peer.Desktop.edit.command
gnu.java.awt.peer.Desktop.print.command
gnu.java.awt.peer.Desktop.open.command
gconftool-2 -g /apps/classpath/gnu/java/awt/peer/Desktop/html/command
Since: 1.6
Nested Class Summary | |
---|---|
static class | Desktop.Action
Represents an action type supported by a platform.
|
Method Summary | |
---|---|
void | browse(URI uri)
Launches the Desktop default browser to open the given uri .
|
void | edit(File file)
Launch the edit command to edit this file.
|
static Desktop | getDesktop()
Returns an istance of the Desktop Class.
|
boolean | isSupported(Desktop.Action action)
Check if the given Action is supported by this implementation.
|
void | mail()
Launches the Desktop default mailer.
|
void | mail(URI mailtoURI)
Launches the Desktop default mailer, with the given mailtoURI
as agrument. |
void | open(File file)
Launches the Desktop default application to open the given File.
|
void | print(File file)
Launch the print program to print this file.
|
uri
.
If a security manager exists and denies
AWTPermission("showWindowWithoutWarningBanner"),a SecurityException will
be generated.
Parameters: uri
Throws: IOException
Parameters: file
Throws: IOException
Throws: UnsupportedOperationException HeadlessException
Parameters: action
Returns:
Throws: IOException
mailtoURI
must conform to the
{@link http://www.ietf.org/rfc/rfc2368.txt The mailto URL scheme (RFC 2368)}
If a security manager exists and denies
AWTPermission("showWindowWithoutWarningBanner"), a SecurityException will
be generated.
Parameters: mailtoURI
Throws: IOException
file
is a directory, a file manager is launched.
Parameters: file
Throws: IOException
Parameters: file
Throws: IOException