FileDocCategorySizeDatePackage
DesktopPeer.javaAPI DocJava SE 6 API3200Tue Jun 10 00:25:28 BST 2008java.awt.peer

DesktopPeer

public interface DesktopPeer
The DesktopPeer interface provides methods for the operation of open, edit, print, browse and mail with the given URL or file, by launching the associated application.

Each platform has an implementation class for this interface.

Fields Summary
Constructors Summary
Methods Summary
public voidbrowse(java.net.URI url)
Launches the user default browser to display the given URI.

param
uri the given URI.
throws
IOException If the user default browser is not found, or it fails to be launched.

public voidedit(java.io.File file)
Launches the associated editor and opens the given file for editing. The associated editor is registered to be the default editor for the file type of the given file.

param
file the given file.
throws
IOException If the given file has no associated editor, or the associated application fails to be launched.

public booleanisSupported(java.awt.Desktop.Action action)
Returns whether the given action is supported on the current platform.

param
action the action type to be tested if it's supported on the current platform.
return
true if the given action is supported on the current platform; false otherwise.

public voidmail(java.net.URI mailtoURL)
Launches the mail composing window of the user default mail client, filling the message fields including to, cc, etc, with the values specified by the given mailto URL.

param
uri represents a mailto URL with specified values of the message. The syntax of mailto URL is defined by RFC2368: The mailto URL scheme
throws
IOException If the user default mail client is not found, or it fails to be launched.

public voidopen(java.io.File file)
Launches the associated application to open the given file. The associated application is registered to be the default file viewer for the file type of the given file.

param
file the given file.
throws
IOException If the given file has no associated application, or the associated application fails to be launched.

public voidprint(java.io.File file)
Prints the given file with the native desktop printing facility, using the associated application's print command.

param
file the given file.
throws
IOException If the given file has no associated application that can be used to print it.