<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[`TextFileView`](TextFileView) › [`setViewData`](TextFileView/setViewData)
## TextFileView.setViewData() method
Set the data to the editor. This is used to load the file contents.
If clear is set, then it means we're opening a completely different file. In that case, you should call clear(), or implement a slightly more efficient clearing mechanism given the new data to be set.
0.10.12
**Signature:**
```typescript
abstract setViewData(data: string, clear: boolean): void;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| <code>data</code> | <code>string</code> | |
| <code>clear</code> | <code>boolean</code> | |
**Returns:**
`void`