Java Code Examples for java.awt.desktop.OpenFilesEvent

The following examples show how to use java.awt.desktop.OpenFilesEvent. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
void performUsing(final OpenFilesHandler handler, final _NativeEvent event) {
    // create file list from fileNames
    final List<String> fileNameList = event.get(0);
    final ArrayList<File> files = new ArrayList<File>(fileNameList.size());
    for (final String fileName : fileNameList) files.add(new File(fileName));

    // populate the properties map
    final String searchTerm = event.get(1);
    handler.openFiles(new OpenFilesEvent(files, searchTerm));
}
 
Example 2
Source Project: gcs   Source File: OpenCommand.java    License: Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void openFiles(OpenFilesEvent event) {
    for (File file : event.getFiles()) {
        // We call this rather than directly to open(Path) above to allow the file opening to be
        // deferred until startup has finished
        OpenDataFileCommand.open(file.toPath());
    }
}
 
Example 3
Source Project: netbeans   Source File: NbApplicationAdapterJDK9.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void openFiles(OpenFilesEvent e) {
    openFiles(e.getFiles());
}