# StyleContextReceiver

Import: `import com.install4j.api.styles.StyleContextReceiver;`

```java
interface StyleContextReceiver
```

Implemented by objects that handle screen style context changes. All [`Style`](Style.md) instances implement this interface,
but [`FormComponent`](../formcomponents/FormComponent.md)s can also implement it if they are used in styles and want to react to screen style context
changes. For example, you could implement it in a special form component that shows the screen title.

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`setStyleContext(StyleContext)`](#setstylecontext-stylecontext) | `void` | Called by the framework when the current screen changes. |

### setStyleContext(StyleContext)

```java
void setStyleContext(StyleContext styleContext)
```

Called by the framework when the current screen changes. This method is called before [`Style.createComponent`](Style.md#createcomponent)
where the [`StyleContext`](StyleContext.md) may be required for constructing the screen style component.

You have to delegate this method call to any nested styles, see [`NestedStyleContainer`](NestedStyleContainer.md) for more information.


**Parameters:**

- `styleContext` — the screen style context

