Package com.install4j.api.styles
Interface NestedStyleContainer
-
- All Known Implementing Classes:
WrapperStyle
public interface NestedStyleContainerImplemented by styles that contain nested styles.Some notes for working with nested styles:
-
Use
StyleManager.cloneStyleById(String)to get a style instance from the ID of a nested style. This ensures that you can use multiple copies of the same style on the same screen. -
Nested style can be configurable by the user if you add a
Stringproperty for the style ID and set its context in theBeanInfotoInstall4JPropertyDescriptor.CONTEXT_STYLE_ID. -
Never call
Style.createComponent()on nested styles, but useStyleManager.createStyleComponent(Style)instead. That method ensures that for styles that implementFormPanelContainer, a new form panel has been set on the style. -
The methods
StyleContextReceiver.setStyleContext(StyleContext),Style.willActivate(),Style.activated()andStyle.deactivated()have to be delegated to any nested styles. These methods should no be called directly, but rather through the helper methods inStyleManagerso that any associated configurable forms are handled as well.
To use a single nested style, it is advisable to derive from
WrapperStyle. That class already implementsNestedStyleContainerand performs all necessary delegations. The "customCode" sample project contains the classSunnySkyBackgroundStyleand its associatedBeanInfothat show you an example for wrapping a user-selected style with a graphical decoration. For more complex use cases, the source code ofWrapperStylecan be used as a starting point.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Collection<java.lang.String>getNestedStyleIds()Return the IDs of all nested styles.
-