# WrapperStyle

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

```java
public abstract class WrapperStyle extends AbstractStyle implements NestedStyleContainer
```

Abstract base class for a screen style that wraps a single user-selectable style.

When you use this base class, you do not have to handle any life-cycle aspects of the nested style.
See [`NestedStyleContainer`](NestedStyleContainer.md) for more information on nesting styles in general.

The "customCode" sample project contains the class `SunnySkyBackgroundStyle` and its associated
`BeanInfo` that show you an example of 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.

## Inherited from

- [AbstractStyle](AbstractStyle.md) — 8 methods
- [NestedStyleContainer](NestedStyleContainer.md) — 1 methods
- [AbstractBean](../beans/AbstractBean.md) — 22 methods
- [Style](Style.md) — 6 methods
- [VisualContainerBean](../beans/VisualContainerBean.md) — 3 methods
- [StyleContextReceiver](StyleContextReceiver.md) — 1 methods
- [ControlButtonContainer](ControlButtonContainer.md) — 4 methods

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`protected getNestedStyleId()`](#protected-getnestedstyleid) | `String` | Returns the ID of the nested style. |
| [`protected createComponent(JComponent)`](#protected-createcomponent-jcomponent) | `JComponent` | Create the UI component for the style. |
| [`setStyleContext(StyleContext)`](#setstylecontext-stylecontext) | `void` |  |
| [`setControlButtonEnabled(ControlButtonType, boolean)`](#setcontrolbuttonenabled-controlbuttontype-boolean) | `void` |  |
| [`setControlButtonVisible(ControlButtonType, boolean)`](#setcontrolbuttonvisible-controlbuttontype-boolean) | `void` |  |
| [`setControlButtonText(ControlButtonType, String)`](#setcontrolbuttontext-controlbuttontype-string) | `void` |  |
| [`focusControlButton(ControlButtonType)`](#focuscontrolbutton-controlbuttontype) | `void` |  |
| [`createComponent()`](#createcomponent) | `JComponent` |  |
| [`isFillHorizontal()`](#isfillhorizontal) | `boolean` |  |
| [`isFillVertical()`](#isfillvertical) | `boolean` |  |
| [`getNestedStyleIds()`](#getnestedstyleids) | `Collection<String>` |  |
| [`willActivate()`](#willactivate) | `void` |  |
| [`activated()`](#activated) | `void` |  |
| [`deactivated()`](#deactivated) | `void` |  |

### protected getNestedStyleId()

```java
protected abstract String getNestedStyleId()
```

Returns the ID of the nested style. This method must be implemented by derived classes. To make a
`String` property user-selectable in the IDE, register it in the `BeanInfo` with the special context
[`Install4JPropertyDescriptor.CONTEXT_STYLE_ID`](../beaninfo/Install4JPropertyDescriptor.md#context-style-id).


**Returns:** the ID

### protected createComponent(JComponent)

```java
protected abstract JComponent createComponent(JComponent styleComponent)
```

Create the UI component for the style. Has the same responsibility as
[`WrapperStyle.createComponent`](WrapperStyle.md#createcomponent), only that the UI component of the nested screen style is passed as a parameter.


**Returns:** the UI component

### setStyleContext(StyleContext)

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

### setControlButtonEnabled(ControlButtonType, boolean)

```java
public void setControlButtonEnabled(ControlButtonType controlButtonType, boolean enabled)
```

### setControlButtonVisible(ControlButtonType, boolean)

```java
public void setControlButtonVisible(ControlButtonType controlButtonType, boolean visible)
```

### setControlButtonText(ControlButtonType, String)

```java
public void setControlButtonText(ControlButtonType controlButtonType, String text)
```

### focusControlButton(ControlButtonType)

```java
public void focusControlButton(ControlButtonType controlButtonType)
```

### createComponent()

```java
public final JComponent createComponent()
```

### isFillHorizontal()

```java
public boolean isFillHorizontal()
```

### isFillVertical()

```java
public boolean isFillVertical()
```

### getNestedStyleIds()

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

### willActivate()

```java
public void willActivate()
```

### activated()

```java
public void activated()
```

### deactivated()

```java
public void deactivated()
```

## Constructors

| Signature | Description |
|---|---|
| [`WrapperStyle()`](#wrapperstyle) |  |

### WrapperStyle()

```java
public WrapperStyle()
```

