public class CommonDialogs
extends java.lang.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 | Constructor and Description |
---|---|
private |
CommonDialogs() |
Modifier and Type | Method and Description |
---|---|
private static java.lang.String |
convertFolder(java.io.File folder) |
private static java.lang.String |
convertTitle(java.lang.String title) |
protected static CommonDialogs.FileChooserResult |
createFileChooserResult(java.lang.String[] files,
CommonDialogs.ExtensionFilter[] extensionFilters,
int index) |
static CommonDialogs.FileChooserResult |
showFileChooser(Window owner,
java.io.File folder,
java.lang.String filename,
java.lang.String title,
int type,
boolean multipleMode,
java.util.List<CommonDialogs.ExtensionFilter> extensionFilters,
int defaultFilterIndex)
Creates a native file chooser that lets the user select files.
|
static java.io.File |
showFolderChooser(Window owner,
java.io.File folder,
java.lang.String title)
Creates a native folder chooser that lets the user selects folder.
|
public static CommonDialogs.FileChooserResult showFileChooser(Window owner, java.io.File folder, java.lang.String filename, java.lang.String title, int type, boolean multipleMode, java.util.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 defaultjava.lang.IllegalArgumentException
- if the initial folder is an invalid folder;
if the type doesn't equal one of the constants from CommonDialogs.Type
public static java.io.File showFolderChooser(Window owner, java.io.File folder, java.lang.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 chooserprivate static java.lang.String convertFolder(java.io.File folder)
private static java.lang.String convertTitle(java.lang.String title)
protected static CommonDialogs.FileChooserResult createFileChooserResult(java.lang.String[] files, CommonDialogs.ExtensionFilter[] extensionFilters, int index)