public final class FileChooserParams
extends java.lang.Object
DialogHandler.onFileChooser(FileChooserParams)
method.
Constructor and Description |
---|
FileChooserParams(Browser browser, FileChooserMode mode, java.lang.String defaultFileName) |
FileChooserParams(Browser browser, FileChooserMode mode, java.lang.String defaultFileName, java.lang.String filterDescription, java.util.Set<java.lang.String> acceptableExtensions) |
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.String> |
getAcceptableExtensions()
Returns the set of file extensions accepted by the file chooser.
返回文件选择器接受的文件扩展名集。 |
Browser |
getBrowser()
Returns the browser instance of the dialog.
返回对话框的浏览器实例。 |
java.lang.String |
getDefaultFileName()
Returns a string that represents default file name.
返回表示默认文件名的字符串。 |
java.lang.String |
getFilterDescription()
Returns a meaningful description of the extensions accepted by the file chooser.
返回文件选择器接受的扩展名的有意义的描述。 |
FileChooserMode |
getMode()
Returns the mode of the dialog.
返回对话框的模式。 |
java.lang.String |
getSelectedFile()
Returns the first item in the list of selected files or
返回所选文件列表中的第一项;如果列表为空,则返回null。 null if the list is empty.
|
java.util.List<java.lang.String> |
getSelectedFiles()
Returns the full path of the selected file or
返回所选文件的完整路径;如果未选择文件,则返回NULL。 NULL if file wasn't selected.
|
void |
setSelectedFiles(java.io.File... selectedFile)
Updates list of selected files.
更新所选文件的列表。 |
void |
setSelectedFiles(java.lang.String... selectedFileAbsolutePath)
Sets the full path of the selected file.
设置所选文件的完整路径。 |
java.lang.String |
toString() |
public FileChooserParams(Browser browser, FileChooserMode mode, java.lang.String defaultFileName)
public FileChooserParams(Browser browser, FileChooserMode mode, java.lang.String defaultFileName, java.lang.String filterDescription, java.util.Set<java.lang.String> acceptableExtensions)
public Browser getBrowser()
public java.lang.String getDefaultFileName()
public FileChooserMode getMode()
public java.lang.String getFilterDescription()
getAcceptableExtensions()
public java.util.Set<java.lang.String> getAcceptableExtensions()
accept
attribute of the HTML
input
tag. The extension set can be used for setting up a custom file extension filter for the select file dialog.
Returns an empty set in case of the
accept
attribute being absent or empty, which implies that all files are accepted.
Improperly formatted extensions or nonexistent MIME types in the
accept
attribute are ignored.
Example: {"png", "jpg", "bmp"}.
Extensions are stored without preceding dot or any other pattern.
getFilterDescription()
,
HTML input accept attribute
public java.util.List<java.lang.String> getSelectedFiles()
NULL
if file wasn't selected.
NULL
if file wasn't selected.
所选文件的完整路径,或者如果未选择文件。
public void setSelectedFiles(java.io.File... selectedFile)
public java.lang.String getSelectedFile()
null
if the list is empty.
public void setSelectedFiles(java.lang.String... selectedFileAbsolutePath)
selectedFileAbsolutePath
- the full path of the file.
-文件的完整路径。
public java.lang.String toString()
toString
in class
java.lang.Object