Class FileDialogResult
java.lang.Object
com.codename1.io.filechooser.FileDialogResult
The outcome of a file dialog, delivered to the callback on the EDT.
-
Constructor Summary
ConstructorsConstructorDescriptionFileDialogResult(FileDialogRequest<?> request, String[] paths, int selectedFilter, Map<String, String> optionValues) Creates a result; ports and the fallback dialogs build these. -
Method Summary
Modifier and TypeMethodDescriptionstatic FileDialogResultcancelled(FileDialogRequest<?> request) Creates the result of a dialog the user dismissed.getError()The failure of a save, or null.getOptionValue(String id) The value of aFileDialogOption, or its default where the platform shows no options.getPath()The first chosen file.String[]getPaths()The chosen files.The filter the user ended on; for a save this is the chosen format.intThe index of the filter the user ended on.booleanTrue when the user dismissed the dialog, or a save failed before a file existed.voidRecords a save failure; used by ports.
-
Constructor Details
-
FileDialogResult
public FileDialogResult(FileDialogRequest<?> request, String[] paths, int selectedFilter, Map<String, String> optionValues) Creates a result; ports and the fallback dialogs build these.
Parameters
request: the request being answeredpaths: the chosen paths, or null/empty when cancelledselectedFilter: the filter the user ended on, or -1optionValues: option id to value, or null for the defaults
-
-
Method Details
-
cancelled
Creates the result of a dialog the user dismissed.
Parameters
request: the request being answered
Returns
a cancelled result
-
isCancelled
public boolean isCancelled()True when the user dismissed the dialog, or a save failed before a file existed.
Returns
whether nothing was chosen
-
getPaths
The chosen files. For a save, the one file written.
Returns
a copy of the paths; empty when cancelled
-
getPath
The first chosen file.
Returns
the path, or null when cancelled
-
getSelectedFilterIndex
public int getSelectedFilterIndex()The index of the filter the user ended on.
Returns
the index, or -1 without filters
-
getSelectedFilter
The filter the user ended on; for a save this is the chosen format.
Returns
the filter, or null without filters
-
getOptionValue
-
getError
The failure of a save, or null. A failed save still reports the path it tried, so the partial file can be cleaned up.
Returns
the error
-
setError
Records a save failure; used by ports.
Parameters
error: the failure
-