public interface NestedStyleContainer
Some notes for working with nested styles:
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.
String
property for the style ID and set its context in the
BeanInfo
to Install4JPropertyDescriptor.CONTEXT_STYLE_ID
.
Style.createComponent()
on nested styles, but use StyleManager.createStyleComponent(Style)
instead.
That method ensures that for styles that implement FormPanelContainer
, a new
form panel has been set on the style.
StyleContextReceiver.setStyleContext(StyleContext)
, Style.willActivate()
, Style.activated()
and
Style.deactivated()
have to be delegated to any nested styles. These methods should no be called directly,
but rather through the helper methods in StyleManager
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.
Modifier and Type | Method and Description |
---|---|
java.util.Collection<java.lang.String> |
getNestedStyleIds()
Return the IDs of all nested styles.
|