# NestedStyleContainer

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

```java
interface NestedStyleContainer
```

Implemented by styles that contain nested styles.

Some notes for working with nested styles:
- Use [`StyleManager.cloneStyleById`](StyleManager.md#clonestylebyid-string) to get a screen style instance from the ID of a nested style. This ensures
that you can use multiple copies of the same screen style on the same screen.
- Nested screen style can be configurable by the user if you add a `String` property for the style ID and set its context in the
`BeanInfo` to [`Install4JPropertyDescriptor.CONTEXT_STYLE_ID`](../beaninfo/Install4JPropertyDescriptor.md#context-style-id).
- Never call  [`Style.createComponent`](Style.md#createcomponent) on nested styles, but use [`StyleManager.createStyleComponent`](StyleManager.md#createstylecomponent-style) instead.
That method ensures that for styles that implement [`FormPanelContainer`](../screens/FormPanelContainer.md), a new
form panel has been set on the style.
- The methods [`Style.setStyleContext`](Style.md#setstylecontext-stylecontext), [`Style.willActivate`](Style.md#willactivate), [`Style.activated`](Style.md#activated) and
[`Style.deactivated`](Style.md#deactivated) have to be delegated to any nested styles. These methods should not be called directly,
but rather through the helper methods in [`StyleManager`](StyleManager.md) so that any associated configurable forms are handled as well.

To use a single nested style, it is advisable to derive from [`WrapperStyle`](WrapperStyle.md). That class already implements
[`NestedStyleContainer`](NestedStyleContainer.md) and performs all necessary delegations. The "customCode" sample project contains
the class `SunnySkyBackgroundStyle` and its associated `BeanInfo` that show you an example for wrapping
a user-selected screen style with a graphical decoration. For more complex use cases, the source code
of [`WrapperStyle`](WrapperStyle.md) can be used as a starting point.

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`getNestedStyleIds()`](#getnestedstyleids) | `Collection<String>` | Return the IDs of all nested styles. |

### getNestedStyleIds()

```java
Collection<String> getNestedStyleIds()
```

Return the IDs of all nested styles. This allows the install4j IDE to collect all overridable properties.


**Returns:** the IDs

