This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


java.awt.peer
interface 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.


Method Summary
 void
browse(URI url)

          Launches the user default browser to display the given URI.
 void
edit(File file)

          Launches the associated editor and opens the given file for editing.
 boolean

          Returns whether the given action is supported on the current platform.
 void
mail(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.
 void
open(File file)

          Launches the associated application to open the given file.
 void
print(File file)

          Prints the given file with the native desktop printing facility, using the associated application's print command.
 

Method Detail

browse

public void browse(URI url)
            throws IOException
Launches the user default browser to display the given URI.

Parameters:
url
Throws:
IOException - If the user default browser is not found, or it fails to be launched.

edit

public void edit(File file)
          throws IOException
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.

Parameters:
file - the given file.
Throws:
IOException - If the given file has no associated editor, or the associated application fails to be launched.

isSupported

public boolean isSupported(Desktop.Action action)
Returns whether the given action is supported on the current platform.

Parameters:
action - the action type to be tested if it's supported on the current platform.
Returns:
true if the given action is supported on the current platform; false otherwise.

mail

public void mail(URI mailtoURL)
          throws IOException
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.

Parameters:
mailtoURL
Throws:
IOException - If the user default mail client is not found, or it fails to be launched.

open

public void open(File file)
          throws IOException
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.

Parameters:
file - the given file.
Throws:
IOException - If the given file has no associated application, or the associated application fails to be launched.

print

public void print(File file)
           throws IOException
Prints the given file with the native desktop printing facility, using the associated application's print command.

Parameters:
file - the given file.
Throws:
IOException - If the given file has no associated application that can be used to print it.


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.