Class DirectoryChooserOptions


  • public class DirectoryChooserOptions
    extends AbstractDialogOptions<File,​DirectoryChooserOptions>

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

    Instances of this class can be passed to a file chooser service to configure the behavior of a directory chooser dialog. The class offers a fluent API to set the single properties.

    Implementation note: Instances are not thread-safe.

    Since:
    1.4
    • Constructor Detail

      • DirectoryChooserOptions

        public DirectoryChooserOptions​(DialogResultCallback<File,​D> resultCallback,
                                       D data)
        Creates a new instance of DirectoryChooserOptions 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
      • DirectoryChooserOptions

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

      • setInitialDirectory

        public DirectoryChooserOptions setInitialDirectory​(File directory)
        Allows setting the initial directory for the directory chooser dialog.
        Parameters:
        directory - the initial directory
        Returns:
        this object
      • getInitialDirectory

        public File getInitialDirectory()
        Returns the initial directory for the directory chooser dialog. Result can be null if no such directory has been set.
        Returns:
        the initial directory