# DirectoryChooserHandle

Import: `import com.install4j.api.test.formcomponents.DirectoryChooserHandle;`

```java
interface DirectoryChooserHandle extends FormComponentHandle
```

Handle for the "Directory chooser" or "Installation directory chooser" form component.
The principal Swing widget is the `JTextField` holding the selected directory's path.

Reach this handle via [`ScreenHandle.directoryChooser`](../ui/ScreenHandle.md#directorychooser).

## Inherited from

- [FormComponentHandle](FormComponentHandle.md) — 7 methods

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`getDirectory()`](#getdirectory) | `File` | The currently selected directory. |
| [`setDirectory(File)`](#setdirectory-file) | `DirectoryChooserHandle` | Set the selected directory. |
| [`browse()`](#browse) | `DirectoryChooserHandle` | Click the Browse button. |
| [`assertDirectory(File)`](#assertdirectory-file) | `DirectoryChooserHandle` | Assert the currently selected directory equals the expected value, compared as absolute paths. |
| [`assertExists()`](#assertexists) | `DirectoryChooserHandle` | Assert the currently selected directory exists on disk. |
| [`assertEnabled()`](#assertenabled) | `DirectoryChooserHandle` |  |
| [`assertDisabled()`](#assertdisabled) | `DirectoryChooserHandle` |  |
| [`assertVisible()`](#assertvisible) | `DirectoryChooserHandle` |  |
| [`assertInvisible()`](#assertinvisible) | `DirectoryChooserHandle` |  |

### getDirectory()

```java
File getDirectory()
```

The currently selected directory.

### setDirectory(File)

```java
DirectoryChooserHandle setDirectory(File directory)
```

Set the selected directory.

### browse()

```java
DirectoryChooserHandle browse()
```

Click the Browse button. The resulting `JFileChooser` dialog is reachable via
`session.fileChooser`.

### assertDirectory(File)

```java
DirectoryChooserHandle assertDirectory(File expected)
```

Assert the currently selected directory equals the expected value, compared as absolute paths.

### assertExists()

```java
DirectoryChooserHandle assertExists()
```

Assert the currently selected directory exists on disk.

### assertEnabled()

```java
DirectoryChooserHandle assertEnabled()
```

### assertDisabled()

```java
DirectoryChooserHandle assertDisabled()
```

### assertVisible()

```java
DirectoryChooserHandle assertVisible()
```

### assertInvisible()

```java
DirectoryChooserHandle assertInvisible()
```

