public class CommonDialogs extends Object
Modifier and Type | Class and Description |
---|---|
static class |
CommonDialogs.ExtensionFilter
Provides a mechanism to filter different kinds of file name extensions.
|
static class |
CommonDialogs.FileChooserResult
An object representing the result of showing a file chooser dialog.
|
static class |
CommonDialogs.Type
Available file chooser types.
|
Modifier and Type | Method and Description |
---|---|
protected static CommonDialogs.FileChooserResult |
createFileChooserResult(String[] files,
CommonDialogs.ExtensionFilter[] extensionFilters,
int index) |
static CommonDialogs.FileChooserResult |
showFileChooser(Window owner,
File folder,
String filename,
String title,
int type,
boolean multipleMode,
List<CommonDialogs.ExtensionFilter> extensionFilters,
int defaultFilterIndex)
Creates a native file chooser that lets the user select files.
|
static File |
showFolderChooser(Window owner,
File folder,
String title)
Creates a native folder chooser that lets the user selects folder.
|
public static CommonDialogs.FileChooserResult showFileChooser(Window owner, File folder, String filename, String title, int type, boolean multipleMode, List<CommonDialogs.ExtensionFilter> extensionFilters, int defaultFilterIndex)
owner
- the owner window for this file chooser (may be null)folder
- the initial folder, may be null
filename
- the initial file name for a SAVE dialog (may be null)title
- the title of the file choosertype
- the type of the file chooser, one of the constants from CommonDialogs.Type
multipleMode
- enables or disable multiple file selectionsextensionFilters
- the filters of the file chooserdefaultFilterIndex
- the zero-based index of the filter selected by defaultIllegalArgumentException
- if the initial folder is an invalid folder;
if the type doesn't equal one of the constants from CommonDialogs.Type
public static File showFolderChooser(Window owner, File folder, String title)
owner
- the owner window for this folder chooser (may be null)folder
- the initial folder, may be null
title
- the title of the folder chooserprotected static CommonDialogs.FileChooserResult createFileChooserResult(String[] files, CommonDialogs.ExtensionFilter[] extensionFilters, int index)
Copyright © 2020. All rights reserved.