public class DefaultUIDesktop extends Object implements UIDesktop
UIDesktop
Constructor and Description |
---|
DefaultUIDesktop() |
Modifier and Type | Method and Description |
---|---|
void |
browse(URI uri)
Launches the default browser to display a
URI . |
void |
edit(File file)
Launches the associated editor application and opens a file for editing.
|
protected Desktop |
getDesktop() |
void |
mail()
Launches the mail composing window of the user default mail client.
|
void |
mail(URI mailtoURI)
Launches the mail composing window of the user default mail client, filling the message fields specified by a
mailto: URI. |
void |
open(File file)
Launches the associated application to open the file.
|
void |
print(File file)
Prints a file with the native desktop printing facility, using the associated application's print command.
|
public void open(File file) throws IOException
UIDesktop
If the specified file is a directory, the file manager of the current platform is launched to open it.
open
in interface UIDesktop
file
- the file to be opened with the associated applicationIOException
- if the specified file has no associated application or the associated application fails to be
launchedpublic void edit(File file) throws IOException
UIDesktop
edit
in interface UIDesktop
file
- the file to be opened for editingIOException
- if the specified file has no associated editor, or the associated application fails to be
launchedpublic void print(File file) throws IOException
UIDesktop
print
in interface UIDesktop
file
- the file to be printedIOException
- if the specified file has no associated application that can be used to print itpublic void browse(URI uri) throws IOException
UIDesktop
URI
. If the default browser is not able to handle the specified
URI
, the application registered for handling URIs
of the specified type is invoked. The
application is determined from the protocol and path of the URI
, as defined by the URI
class.
browse
in interface UIDesktop
uri
- the URI to be displayed in the user default browserIOException
- if the user default browser is not found, or it fails to be launched, or the default handler
application failed to be launchedURI
,
AWTPermission
,
AppletContext
public void mail() throws IOException
UIDesktop
mail
in interface UIDesktop
IOException
- if the user default mail client is not found, or it fails to be launchedpublic void mail(URI mailtoURI) throws IOException
UIDesktop
mailto:
URI.
A mailto:
URI can specify message fields including "to", "cc", "subject",
"body", etc. See The mailto URL scheme (RFC 2368) for the
mailto:
URI specification details.
mail
in interface UIDesktop
mailtoURI
- the specified mailto:
URIIOException
- if the user default mail client is not found or fails to be launchedprotected Desktop getDesktop()
Copyright © 2016 JBoss by Red Hat. All rights reserved.