# FileAssociationsHandle

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

```java
interface FileAssociationsHandle extends FormComponentHandle
```

Handle for the "File associations selector" form component. The widget is a checklist whose
entries correspond to the `CreateFileAssociationAction`s reachable from this screen.
The extensions in this catalog are platform-filtered, Unix actions on Linux and macOS, Windows
actions on Windows, and require an `InstallFilesAction` downstream of the screen.
Without those preconditions the form component renders zero checkboxes and [`FileAssociationsHandle.getExtensions`](FileAssociationsHandle.md#getextensions)
returns the empty list.

Reach this handle via [`ScreenHandle.fileAssociations`](../ui/ScreenHandle.md#fileassociations).

## Inherited from

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

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`getExtensions()`](#getextensions) | `List<String>` | The primary extension of every association on this form, in document order. |
| [`isSelected(String)`](#isselected-string) | `boolean` | Whether the association whose primary extension equals the given value is currently checked. |
| [`getSelectedExtensions()`](#getselectedextensions) | `List<String>` | The primary extensions of all associations currently checked. |
| [`setSelected(String, boolean)`](#setselected-string-boolean) | `FileAssociationsHandle` | Check or uncheck the association whose primary extension equals the given value. |
| [`selectAll()`](#selectall) | `FileAssociationsHandle` | Check every association on this form. |
| [`selectNone()`](#selectnone) | `FileAssociationsHandle` | Uncheck every association on this form. |
| [`assertEnabled()`](#assertenabled) | `FileAssociationsHandle` |  |
| [`assertDisabled()`](#assertdisabled) | `FileAssociationsHandle` |  |
| [`assertVisible()`](#assertvisible) | `FileAssociationsHandle` |  |
| [`assertInvisible()`](#assertinvisible) | `FileAssociationsHandle` |  |

### getExtensions()

```java
List<String> getExtensions()
```

The primary extension of every association on this form, in document order.

### isSelected(String)

```java
boolean isSelected(String extension)
```

Whether the association whose primary extension equals the given value is currently checked.
Throws [`ComponentNotFoundException`](../exceptions/ComponentNotFoundException.md) if the form has no such association.

### getSelectedExtensions()

```java
List<String> getSelectedExtensions()
```

The primary extensions of all associations currently checked.

### setSelected(String, boolean)

```java
FileAssociationsHandle setSelected(String extension, boolean selected)
```

Check or uncheck the association whose primary extension equals the given value.
Throws [`ComponentNotFoundException`](../exceptions/ComponentNotFoundException.md) if the form has no such association.

### selectAll()

```java
FileAssociationsHandle selectAll()
```

Check every association on this form.

### selectNone()

```java
FileAssociationsHandle selectNone()
```

Uncheck every association on this form.

### assertEnabled()

```java
FileAssociationsHandle assertEnabled()
```

### assertDisabled()

```java
FileAssociationsHandle assertDisabled()
```

### assertVisible()

```java
FileAssociationsHandle assertVisible()
```

### assertInvisible()

```java
FileAssociationsHandle assertInvisible()
```

