Package com.install4j.api.styles
Interface NestedStyleContainer
- All Known Implementing Classes:
WrapperStyle
public interface NestedStyleContainer
Implemented 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
String
property for the style ID and set its context in theBeanInfo
toInstall4JPropertyDescriptor.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 inStyleManager
so 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 implements
NestedStyleContainer
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 style with a graphical decoration. For more complex use cases, the source code
of WrapperStyle
can be used as a starting point.
-
Method Summary
Modifier and TypeMethodDescriptionReturn the IDs of all nested styles.
-
Method Details
-
getNestedStyleIds
Collection<String> getNestedStyleIds()Return the IDs of all nested styles. This allows the install4j IDE to collect all overridable properties.- Returns:
- the IDs
-