Interface Style
-
- All Superinterfaces:
Bean
,ControlButtonContainer
,StyleContextReceiver
,VisualContainerBean
- All Known Implementing Classes:
AbstractStyle
,WrapperStyle
public interface Style extends VisualContainerBean, StyleContextReceiver, ControlButtonContainer
All styles must implement this interface. You have to override all methods and provide a public constructor with no arguments. It is recommended that you chooseAbstractStyle
as as a super class.Styles are configurable in the install4j GUI on the "Installer->Styles" step. The life-cycle of style instances is controlled by the framework. Styles are only instantiated once and their
createComponent()
method is called for each screen that the style is used for.If you nest styles, implement
NestedStyleContainer
as well.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
activated()
This method is called by the framework just after a screen with this style has been activated.javax.swing.JComponent
createComponent()
Create the UI component for the style.void
deactivated()
This method is called by the framework just after a screen with this style has been deactivated.boolean
isStandalone()
Returns if the style is intended to by applied to installer applications, screens and screen groups.void
setContext(Context context)
This method is called by the framework to set theContext
just after the style has been constructed.void
willActivate()
This method is called by the framework just before a screen with this style is activated.-
Methods inherited from interface com.install4j.api.styles.ControlButtonContainer
focusControlButton, setControlButtonEnabled, setControlButtonText, setControlButtonVisible
-
Methods inherited from interface com.install4j.api.styles.StyleContextReceiver
setStyleContext
-
Methods inherited from interface com.install4j.api.beans.VisualContainerBean
getAnchor, isFillHorizontal, isFillVertical
-
-
-
-
Method Detail
-
setContext
void setContext(Context context)
This method is called by the framework to set theContext
just after the style has been constructed. This is either anInstallerContext
or anUninstallerContext
, depending on the whether the style is used in an installer or an uninstaller.When nesting other styles, this is earliest occasion that the style manager can be obtained by calling
context.getWizardContext().getStyleManager()
.- Parameters:
context
- the context.
-
createComponent
javax.swing.JComponent createComponent()
Create the UI component for the style. Depending on the return value of theVisualContainerBean.isFillHorizontal()
and theVisualContainerBean.isFillVertical()
methods, the component grows to fill all available horizontal or vertical space. The method must not returnnull
.Never call this method yourself. For nested styles, call
StyleManager.createStyleComponent(Style)
instead.Each style is only instantiated once, and this method is called multiple times for each screen that uses the style. In console or unattended mode, this method is never called.
- Returns:
- the UI component
- See Also:
VisualContainerBean.isFillHorizontal()
,VisualContainerBean.isFillVertical()
,NestedStyleContainer
-
isStandalone
boolean isStandalone()
Returns if the style is intended to by applied to installer applications, screens and screen groups. Only standalone styles are available in the corresponding style selectors and can be set as the default style. If this method returnsfalse
, the style can only be nested into other styles.- Returns:
true
orfalse
-
willActivate
void willActivate()
This method is called by the framework just before a screen with this style is activated. This call has to be delegated to nested styles by usingStyleManager.willActivate(Style)
.- See Also:
Screen.willActivate()
-
activated
void activated()
This method is called by the framework just after a screen with this style has been activated. This call has to be delegated to nested styles by usingStyleManager.activated(Style)
- See Also:
Screen.activated()
-
deactivated
void deactivated()
This method is called by the framework just after a screen with this style has been deactivated. This call has to be delegated to nested styles by usingStyleManager.deactivated(Style)
-
-