FileChooserHandle (install4j API)
Description: declaration: package: com.install4j.api.test.ui, interface: FileChooserHandle

# Interface FileChooserHandle

public interface FileChooserHandle
A modal `JFileChooser` shown by a Browse button on a "Directory chooser" or "File chooser" form component.

Reach this handle via `Session.fileChooser()`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `approve()`
  Click the chooser's Approve button, typically "Open" or "Save".
  `void`
  `cancel()`
  Click the chooser's Cancel button.
  `File`
  `getCurrentDirectory()`
  The directory the chooser is currently showing.
  `File`
  `getSelectedFile()`
  The currently selected file, or `null` if none is selected.
  `FileChooserHandle`
  `selectDirectory(File directory)`
  Select the given directory in the chooser.
  `FileChooserHandle`
  `selectFile(File file)`
  Select the given file in the chooser.

- ## Method Details

  - ### selectFile

    @NotNull FileChooserHandle selectFile(@NotNull File file)
    Select the given file in the chooser.

  - ### selectDirectory

    @NotNull FileChooserHandle selectDirectory(@NotNull File directory)
    Select the given directory in the chooser.

  - ### approve

    void approve()
    Click the chooser's Approve button, typically "Open" or "Save".

  - ### cancel

    void cancel()
    Click the chooser's Cancel button.

  - ### getCurrentDirectory

    @NotNull File getCurrentDirectory()
    The directory the chooser is currently showing.

  - ### getSelectedFile

    @Nullable File getSelectedFile()
    The currently selected file, or `null` if none is selected.