Class FileChooserOptions


  • public class FileChooserOptions
    extends AbstractFileChooserOptions<File,​FileChooserOptions>

    A class for defining the options of a file chooser dialog.

    Instances of this class can be passed to a file chooser service to configure the behavior of a dialog for selecting a file to be loaded or saved. A directory or a file can already be preselected. It is further possible to define filters for specific file types (based on file extensions). The class offers a fluent API to set the single properties.

    Implementation note: Instances are not thread-safe.

    Since:
    1.4
    • Constructor Detail

      • FileChooserOptions

        public FileChooserOptions​(DialogResultCallback<File,​D> resultCallback,
                                  D data)
        Creates a new instance of FileChooserOptions and sets the callback to be notified with the dialog result and an additional data object to be passed to the callback.
        Type Parameters:
        D - the type of the data object
        Parameters:
        resultCallback - the result callback
        data - the data object for the callback
        Throws:
        IllegalArgumentException - if the result callback is null
      • FileChooserOptions

        public FileChooserOptions​(DialogResultCallback<File,​?> resultCallback)
        Creates a new instance of FileChooserOptions and sets the callback to be notified with the dialog result.
        Parameters:
        resultCallback - the result callback
        Throws:
        IllegalArgumentException - if the result callback is null