APIdia Launch Partner
Top Description Fields Constructors Methods
java.awt.desktop

public final Class OpenFilesEvent

extends FilesEvent
Class Inheritance
Imports
java.awt.Desktop, .GraphicsEnvironment, .HeadlessException, java.io.File, .Serial, java.util.List

Event sent when the app is asked to open a list of files.
Since
9
See Also
OpenFilesHandler#openFiles

Field Summary

Modifier and TypeField and Description
pack-priv final String
private static final long
serialVersionUID

Hides java.awt.desktop.FilesEvent.serialVersionUID.

Use serialVersionUID from JDK 9 for interoperability.
Inherited from java.awt.desktop.FilesEvent:
files

Constructor Summary

AccessConstructor and Description
public
OpenFilesEvent(final List<File>
the list of files
files
,
final String
the search term
searchTerm
)

Constructs an OpenFilesEvent.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the search term used to find the files
getSearchTerm
()

Gets the search term.

Inherited from java.awt.desktop.FilesEvent:
getFiles

Field Detail

searchTermback to summary
pack-priv final String searchTerm
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.awt.desktop.FilesEvent.serialVersionUID.

Use serialVersionUID from JDK 9 for interoperability.

Annotations
@Serial

Constructor Detail

OpenFilesEventback to summary
public OpenFilesEvent(final List<File> files, final String searchTerm)

Constructs an OpenFilesEvent.

Parameters
files:List<File>

the list of files

searchTerm:String

the search term

Exceptions
HeadlessException:
if GraphicsEnvironment#isHeadless() returns true
UnsupportedOperationException:
if Desktop API is not supported on the current platform
See Also
Desktop#isDesktopSupported(), java.awt.GraphicsEnvironment#isHeadless

Method Detail

getSearchTermback to summary
public String getSearchTerm()

Gets the search term. The platform may optionally provide the search term that was used to find the files. This is for example the case on MacOS, when the files were opened using the Spotlight search menu or a Finder search window.

This is useful for highlighting the search term in the documents when they are opened.

Returns:String

the search term used to find the files