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.
Modifier and Type | Method and Description |
---|---|
public default void | addAppEventListener(final SystemEventListener
listener listener)Adds sub-types of |
public void | |
public default boolean | Returns: returns true if successfully openedthe file file)Opens a folder containing the |
public default void | |
public void | |
public default void | |
public boolean | Returns: true if the given action is supported on
the current platform; false otherwise.the action type to be tested if it's supported on the
current platform. actionReturns whether the given action is supported on the current platform. |
public void | mail(URI
represents a mailto URL with specified values of the message.
The syntax of mailto URL is defined by
RFC2368: The mailto
URL scheme 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. |
public default boolean | Returns: returns true if successfully moved the file to the trash.the file file)Moves the specified file to the trash. |
public void | |
public default void | |
public void | |
public default void | removeAppEventListener(final SystemEventListener
listener listener)Removes sub-types of |
public default void | requestForeground(final boolean
if all windows of this application should be moved to
the foreground, or only the foremost one allWindows)Requests this application to move to the foreground. |
public default void | setAboutHandler(final AboutHandler
the handler to respond to the
aboutHandler)AboutHandler#handleAbout )} messageInstalls a handler to show a custom About window for your application. |
public default void | setDefaultMenuBar(final JMenuBar
to use when no other frames are active menuBar)Sets the default menu bar to use when there are no active frames. |
public default void | setOpenFileHandler(final OpenFilesHandler
handler openFileHandler)Installs the handler which is notified when the application is asked to open a list of files. |
public default void | setOpenURIHandler(final OpenURIHandler
handler openURIHandler)Installs the handler which is notified when the application is asked to open a URL. |
public default void | setPreferencesHandler(final PreferencesHandler
the handler to respond to the
preferencesHandler)java. Installs a handler to show a custom Preferences window for your application. |
public default void | setPrintFileHandler(final PrintFilesHandler
handler printFileHandler)Installs the handler which is notified when the application is asked to print a list of files. |
public default void | setQuitHandler(final QuitHandler
the handler that is called when the application is
asked to quit quitHandler)Installs the handler which determines if the application should quit. |
public default void | setQuitStrategy(final QuitStrategy
the way this application should be shutdown strategy)Sets the default strategy used to quit this application. |
addAppEventListener | back to summary |
---|---|
public default void addAppEventListener(final SystemEventListener listener) Adds sub-types of |
browse | back to summary |
---|---|
public void browse(URI uri) throws IOException Launches the user default browser to display the given URI.
|
browseFileDirectory | back to summary |
---|---|
public default boolean browseFileDirectory(File file) Opens a folder containing the
|
disableSuddenTermination | back to summary |
---|---|
public default void disableSuddenTermination() Prevents this application from being suddenly terminated. |
edit | back to summary |
---|---|
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.
|
enableSuddenTermination | back to summary |
---|---|
public default void enableSuddenTermination() Enables this application to be suddenly terminated. |
isSupported | back to summary |
---|---|
public boolean isSupported(Desktop. Returns whether the given action is supported on the current platform. |
back to summary | |
---|---|
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.
|
moveToTrash | back to summary |
---|---|
public default boolean moveToTrash(File file) Moves the specified file to the trash.
|
open | back to summary |
---|---|
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.
|
openHelpViewer | back to summary |
---|---|
public default void openHelpViewer() Opens the native help viewer application. |
back to summary | |
---|---|
public void print(File file) throws IOException Prints the given file with the native desktop printing facility, using the associated application's print command.
|
removeAppEventListener | back to summary |
---|---|
public default void removeAppEventListener(final SystemEventListener listener) Removes sub-types of |
requestForeground | back to summary |
---|---|
public default void requestForeground(final boolean allWindows) Requests this application to move to the foreground.
|
setAboutHandler | back to summary |
---|---|
public default void setAboutHandler(final AboutHandler aboutHandler) Installs a handler to show a custom About window for your application.
Setting the
|
setDefaultMenuBar | back to summary |
---|---|
public default void setDefaultMenuBar(final JMenuBar menuBar) Sets the default menu bar to use when there are no active frames.
|
setOpenFileHandler | back to summary |
---|---|
public default void setOpenFileHandler(final OpenFilesHandler openFileHandler) Installs the handler which is notified when the application is asked to open a list of files.
|
setOpenURIHandler | back to summary |
---|---|
public default void setOpenURIHandler(final OpenURIHandler openURIHandler) Installs the handler which is notified when the application is asked to
open a URL.
Setting the handler to
|
setPreferencesHandler | back to summary |
---|---|
public default void setPreferencesHandler(final PreferencesHandler preferencesHandler) Installs a handler to show a custom Preferences window for your application.
Setting the
|
setPrintFileHandler | back to summary |
---|---|
public default void setPrintFileHandler(final PrintFilesHandler printFileHandler) Installs the handler which is notified when the application is asked to print a list of files.
|
setQuitHandler | back to summary |
---|---|
public default void setQuitHandler(final QuitHandler quitHandler) Installs the handler which determines if the application should quit.
|
setQuitStrategy | back to summary |
---|---|
public default void setQuitStrategy(final QuitStrategy strategy) Sets the default strategy used to quit this application. The default is calling SYSTEM_EXIT_0.
|