# FileEditorHandle

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

```java
interface FileEditorHandle extends FormComponentHandle
```

Handle for the "Text file editor" form component. The Swing widget is a `JTextArea`
that pre-loads its content from a file at screen activation and writes the edited content
back when the form is completed.

Reach this handle via [`ScreenHandle.fileEditor`](../ui/ScreenHandle.md#fileeditor).

## Inherited from

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

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`getFile()`](#getfile) | `File` | The file the editor reads from and writes back to, with variables substituted. |
| [`getText()`](#gettext) | `String` | The current text shown in the editor. |
| [`setText(String)`](#settext-string) | `FileEditorHandle` | Replace the editor's text. |
| [`clear()`](#clear) | `FileEditorHandle` | Clear the editor. |
| [`assertText(String)`](#asserttext-string) | `FileEditorHandle` | Assert that the editor's current text equals the expected value. |
| [`assertEnabled()`](#assertenabled) | `FileEditorHandle` |  |
| [`assertDisabled()`](#assertdisabled) | `FileEditorHandle` |  |
| [`assertVisible()`](#assertvisible) | `FileEditorHandle` |  |
| [`assertInvisible()`](#assertinvisible) | `FileEditorHandle` |  |

### getFile()

```java
File getFile()
```

The file the editor reads from and writes back to, with variables substituted.

### getText()

```java
String getText()
```

The current text shown in the editor.

### setText(String)

```java
FileEditorHandle setText(String text)
```

Replace the editor's text. The new content is only persisted to the underlying file when
the form is completed, that is, when [`ScreenHandle.nextScreen`](../ui/ScreenHandle.md#nextscreen) is invoked successfully.

### clear()

```java
FileEditorHandle clear()
```

Clear the editor.

### assertText(String)

```java
FileEditorHandle assertText(String expected)
```

Assert that the editor's current text equals the expected value.

### assertEnabled()

```java
FileEditorHandle assertEnabled()
```

### assertDisabled()

```java
FileEditorHandle assertDisabled()
```

### assertVisible()

```java
FileEditorHandle assertVisible()
```

### assertInvisible()

```java
FileEditorHandle assertInvisible()
```

