Class OpenFilesEvent

All Implemented Interfaces:
Serializable
public final class OpenFilesEvent
extends FilesEvent

Event sent when the app is asked to open a list of files.

Since:
9
See Also:
OpenFilesHandler.openFiles(java.awt.desktop.OpenFilesEvent), Serialized Form

Fields

Fields declared in class java.util.EventObject

source

Constructors

Constructor Description
OpenFilesEvent​(List<File> files, String searchTerm)

Constructs an OpenFilesEvent.

Methods

Modifier and Type Method Description
String getSearchTerm()

Gets the search term.

Methods declared in class java.awt.desktop.FilesEvent

getFiles

Methods declared in class java.util.EventObject

getSource, toString

Methods declared in class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructors

OpenFilesEvent

public OpenFilesEvent(List<File> files,
                      String searchTerm)

Constructs an OpenFilesEvent.

Parameters:
files - the list of files
searchTerm - the search term
Throws:
HeadlessException - if GraphicsEnvironment.isHeadless() returns true
UnsupportedOperationException - if Desktop API is not supported on the current platform
See Also:
Desktop.isDesktopSupported(), GraphicsEnvironment.isHeadless()

Methods

getSearchTerm

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 Mac OS X, 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:
the search term used to find the files

© 1993, 2020, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/desktop/OpenFilesEvent.html