public class ChooseFileOptions extends Object
ChooseFile
and
ChooseURL
.Modifier and Type | Field and Description |
---|---|
FileFilter |
activeFilter
Active filter of the dialog box.
|
boolean |
allowOverwrite
If
true , do not ask the user to confirm before
overwriting an existing file. |
List<FileFilter> |
filterList
File filters of the dialog box.
|
Boolean |
nativeDialog
If
Boolean.TRUE , use the native file chooser dialog box
rather than Swing's emulation of native file chooser dialog box. |
boolean |
previewImages
If
true , add an accessory to the file chooser in order to
display a thumbnail of the selected image file. |
boolean |
showHiddenFiles
If
true , also list the hidden files. |
Dimension |
size
Size of the dialog box.
|
String |
title
Title of the dialog box.
|
Constructor and Description |
---|
ChooseFileOptions() |
Modifier and Type | Method and Description |
---|---|
void |
addFilter(String extension)
Equivalent to
addFilter(new String[] { extension }) . |
void |
addFilter(String[] extensions)
Convenience method: add specified
FilterByExtension to
the list of filters. |
void |
setActiveFilter(String... extensions)
Convenience method: add specified
FilterByExtension to
the list of filters and make it the active filter. |
public String title
null
.
Default behavior: give the dialog box a default title (adapted to the operation performed by the dialog box).
public Dimension size
null
.
Default behavior: give the dialog box its intrinsic size.
Note that the size is updated to reflect the dialog box resize operation possibly performed by the user.
public Boolean nativeDialog
Boolean.TRUE
, use the native file chooser dialog box
rather than Swing's emulation of native file chooser dialog box.
If Boolean.FALSE
, use Swing's JFileChooser.
If null
, this depends on the user preferences.
If nothing is specified in the user preferences, then use
Swing's JFileChooser.public boolean showHiddenFiles
true
, also list the hidden files.
Default behavior: do not list the hidden files.public boolean previewImages
true
, add an accessory to the file chooser in order to
display a thumbnail of the selected image file.
Default: false
.
Ignored when nativeDialog
is Boolean.TRUE
and
when the file chooser is used to select directories.
public boolean allowOverwrite
true
, do not ask the user to confirm before
overwriting an existing file.
Default behavior: ask the user to confirm before overwriting an existing file.
public List<FileFilter> filterList
null
.
Default behavior: add the filter derived from the template file (if any) passed as an argument to the selection operation.
public FileFilter activeFilter
null
.
Must one of the filters contained in filterList
.
Default behavior: use as the active filter the filter derived from the template file (if any) passed as an argument to the selection operation.
public void addFilter(String extension)
addFilter(new String[] { extension })
.public void addFilter(String[] extensions)
FilterByExtension
to
the list of filters.public void setActiveFilter(String... extensions)
FilterByExtension
to
the list of filters and make it the active filter.filterList
,
activeFilter
,
addFilter(java.lang.String)