Class AbstractInstallerScreen
- All Implemented Interfaces:
Bean, VisualContainerBean, InstallerScreen, Screen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled by the framework just after the screen has been activated.booleancancel()Called when the user clicks the "Cancel" button for this screen.voidCalled by the framework just after the screen has been deactivated.Returns a default value for the anchor of the screen component.Returns theInstallerContextthat the framework has associated with this custom screen insetInstallerContext(InstallerContext).getProgressInterface(ProgressInterface defaultProgressInterface) Replace the default progress interface for actions with a custom progress interface.Returns theWidgetStyleHandlerthat the framework has associated with this custom screen insetWidgetStyleHandler(WidgetStyleHandler).booleanhandleConsole(Console console) Handle the console mode.booleanHandle the unattended mode.booleanReturns whether the "Cancel" button is visible or not for this screen.booleanThis method is called by the framework to determine if the screen should only be created when it is shown.booleanisHidden()Returns whether this screen should be hidden.booleanReturns whether this screen should be hidden when the user traverses screens in the forward direction.booleanReturns whether this screen should be hidden when the user traverses screens in the backward direction.booleanReturns whether the "Next" button is visible or not for this screen.booleanReturns whether the "Back" button is visible or not for this screen.booleannext()Called when the user clicks the "Next" button for this screen.booleanprevious()Called when the user clicks the "Back" button for this screen.voidsetInstallerContext(InstallerContext context) This method is called by the framework to set theInstallerContextjust after the screen has been constructed.voidsetWidgetStyleHandler(WidgetStyleHandler widgetStyleHandler) This method is called by the framework to set theWidgetStyleHandlerjust after the screen has been constructed.voidCalled by the framework just before the screen is activated.Methods inherited from class AbstractBean
executeActionListAsync, executeActionListSync, getTextOverrideValue, replaceVariables, replaceVariables, replaceVariables, replaceVariables, replaceVariables, replaceVariables, replaceVariables, replaceVariables, replaceWithTextOverride, replaceWithTextOverride, replaceWithTextOverride, replaceWithTextOverride, replaceWithTextOverride, replaceWithTextOverride, replaceWithTextOverride, replaceWithTextOverride, replaceWithTextOverride, replaceWithTextOverride, rollbackActionListModifier and TypeMethodDescriptionstatic voidexecuteActionListAsync(ActionList actionList, Object... extraScriptParameters) Asynchronously execute an action list.static booleanexecuteActionListSync(ActionList actionList, Object... extraScriptParameters) Synchronously execute an action list.static <T> TgetTextOverrideValue(Bean bean, String propertyName, Class<T> resultType) Get the value for a property for which a text replacement has been configured in the IDE.static FilereplaceVariables(File file) Replace all installer variables and localization keys in a file name.static File[]replaceVariables(File[] files) Replace all installer variables and localization keys in a file array.static StringreplaceVariables(String value) Same asAbstractBean.replaceVariables(String, ReplacementMode, VariableErrorHandlingDescriptor), withReplacementMode.PLAINas the replacement mode andVariableErrorHandlingDescriptor.DEFAULTas the error handling descriptor.static String[]replaceVariables(String[] values) Same asAbstractBean.replaceVariables(String[], VariableErrorHandlingDescriptor), withVariableErrorHandlingDescriptor.DEFAULTas the error handling descriptor.static String[]replaceVariables(String[] values, VariableErrorHandlingDescriptor errorHandlingDescriptor) Replace all installer variables and localization keys in a string array.static StringreplaceVariables(String value, ReplacementMode replacementMode) Same asAbstractBean.replaceVariables(String, ReplacementMode, VariableErrorHandlingDescriptor), withVariableErrorHandlingDescriptor.DEFAULTas the error handling descriptor.static StringreplaceVariables(String value, ReplacementMode replacementMode, VariableErrorHandlingDescriptor errorHandlingDescriptor) Replace all installer variables and localization keys in a string.static StringreplaceVariables(String value, VariableErrorHandlingDescriptor errorHandlingDescriptor) Same asAbstractBean.replaceVariables(String, ReplacementMode, VariableErrorHandlingDescriptor), withReplacementMode.PLAINas the replacement mode.static <T> TreplaceWithTextOverride(Bean bean, String propertyName, T defaultValue, Class resultType) A convenience method forAbstractBean.getTextOverrideValue(Bean, String, Class)that returns a default value if no replacement has been configured.protected booleanreplaceWithTextOverride(String propertyName, boolean defaultValue) protected bytereplaceWithTextOverride(String propertyName, byte defaultValue) protected charreplaceWithTextOverride(String propertyName, char defaultValue) protected doublereplaceWithTextOverride(String propertyName, double defaultValue) protected floatreplaceWithTextOverride(String propertyName, float defaultValue) protected intreplaceWithTextOverride(String propertyName, int defaultValue) protected longreplaceWithTextOverride(String propertyName, long defaultValue) protected shortreplaceWithTextOverride(String propertyName, short defaultValue) protected <T> TreplaceWithTextOverride(String propertyName, T defaultValue, Class resultType) static voidrollbackActionList(ActionList actionList) Roll back an action list.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Screen
createComponent, getSubTitle, getTitleModifier and TypeMethodDescriptionReturn the visual component that is displayed for the screen.Returns the subtitle of this custom screen which is displayed at the top of the installer wizard just below the title of the screen.getTitle()Returns the title of this custom screen which is displayed at the top of the installer wizard.Methods inherited from interface VisualContainerBean
isFillHorizontal, isFillVerticalModifier and TypeMethodDescriptionbooleanReturns whether the visual component wants to grow in the horizontal direction.booleanReturns whether the visual component wants to grow in the vertical direction.
-
Constructor Details
-
AbstractInstallerScreen
public AbstractInstallerScreen()
-
-
Method Details
-
setInstallerContext
Description copied from interface:InstallerScreenThis method is called by the framework to set theInstallerContextjust after the screen has been constructed.- Specified by:
setInstallerContextin interfaceInstallerScreen- Parameters:
context- the installer context.
-
setWidgetStyleHandler
Description copied from interface:ScreenThis method is called by the framework to set theWidgetStyleHandlerjust after the screen has been constructed.- Specified by:
setWidgetStyleHandlerin interfaceScreen- Parameters:
widgetStyleHandler- the widget style handler.
-
isNextVisible
public boolean isNextVisible()Description copied from interface:ScreenReturns whether the "Next" button is visible or not for this screen. If you just want to disable the button initially, please overrideactivatedand invokesetNextButtonEnabledin theWizardContextthat is available from theContextin GUI mode.In console or unattended mode, this method is never called.
- Specified by:
isNextVisiblein interfaceScreen- Returns:
trueorfalse. Default istrue.- See Also:
-
isPreviousVisible
public boolean isPreviousVisible()Description copied from interface:ScreenReturns whether the "Back" button is visible or not for this screen. If you just want to disable the button initially, please overrideactivatedand invokesetBackButtonEnabledin theWizardContextthat is available from theContextin GUI mode.In console or unattended mode, this method is never called.
- Specified by:
isPreviousVisiblein interfaceScreen- Returns:
trueorfalse. Default istrue.- See Also:
-
isCancelVisible
public boolean isCancelVisible()Description copied from interface:ScreenReturns whether the "Cancel" button is visible or not for this screen. If you just want to disable the button initially, please overrideactivatedand invokesetCancelButtonEnabledin theWizardContextthat is available from theContextin GUI mode.In console or unattended mode, this method is never called.
- Specified by:
isCancelVisiblein interfaceScreen- Returns:
trueorfalse. Default istrue.- See Also:
-
isHiddenForNext
public boolean isHiddenForNext()Description copied from interface:ScreenReturns whether this screen should be hidden when the user traverses screens in the forward direction.This method is also called in console or unattended mode.
- Specified by:
isHiddenForNextin interfaceScreen- Returns:
trueorfalse.
-
isHiddenForPrevious
public boolean isHiddenForPrevious()Description copied from interface:ScreenReturns whether this screen should be hidden when the user traverses screens in the backward direction.This method is also called in console or unattended mode.
- Specified by:
isHiddenForPreviousin interfaceScreen- Returns:
trueorfalse.
-
activated
-
deactivated
public void deactivated()Description copied from interface:ScreenCalled by the framework just after the screen has been deactivated. Override this method to perform any special cleanup.In console or unattended mode, this method is never called.
- Specified by:
deactivatedin interfaceScreen
-
next
public boolean next()Description copied from interface:ScreenCalled when the user clicks the "Next" button for this screen. You can veto the change to the next screen if you returnfalse.In console or unattended mode, this method is never called.
-
previous
public boolean previous()Description copied from interface:ScreenCalled when the user clicks the "Back" button for this screen. You can veto the change to the previous screen if you returnfalse.In console or unattended mode, this method is never called.
-
cancel
public boolean cancel()Description copied from interface:ScreenCalled when the user clicks the "Cancel" button for this screen. You can veto the cancel action if you returnfalse. -
willActivate
public void willActivate()Description copied from interface:ScreenCalled by the framework just before the screen is activated. Override this method to perform any special initialization.In console or unattended mode, this method is never called.
- Specified by:
willActivatein interfaceScreen
-
getAnchor
Returns a default value for the anchor of the screen component.- Specified by:
getAnchorin interfaceVisualContainerBean- Returns:
Anchor.NORTHWEST- See Also:
-
isHidden
public boolean isHidden()Description copied from interface:ScreenReturns whether this screen should be hidden. If this method returnstrue, it overrides the results ofisHiddenForNextandisHiddenForPrevious.This method is also called in console or unattended mode.
-
handleUnattended
public boolean handleUnattended()Description copied from interface:ScreenHandle the unattended mode. This method is called when the screen is traversed in unattended mode. There is no way to interact with the user. This method might be necessary to mirror some behavior from the GUI mode, such as setting installer variables or configuring actions.- Specified by:
handleUnattendedin interfaceScreen- Returns:
- whether the installer or uninstaller can proceed with the next screen or whether the process should be canceled.
-
handleConsole
Description copied from interface:ScreenHandle the console mode. This method is called when the screen is entered in console mode. You can use theConsoleobject to interact with the user and replicate the GUI functionality on the terminal.If this screen has a form panel (i.e.
hasFormPanel()returnstrue), you should callFormEnvironment.handleConsolein this method to handle console mode for the contained form components.- Specified by:
handleConsolein interfaceScreen- Parameters:
console- theConsoleobject- Returns:
- whether the installer or uninstaller can proceed with the next screen or whether the process should be canceled.
- Throws:
UserCanceledException- if the user cancels a question or notice. These exceptions are thrown by methods in theConsoleobject.- See Also:
-
getProgressInterface
Description copied from interface:ScreenReplace the default progress interface for actions with a custom progress interface. When associated actions are run for a screen, a default progress interface is passed to them. If your screen has the possibility to show progress information, you can return a different progress interface here. Typically you would only implement methods regarding status and detail messages as well as methods that apply to a progress bar, other methods can be delegated to the default progress interface. This is the strategy employed by the "Installation screen" and the customizable "Progress screens".- Specified by:
getProgressInterfacein interfaceScreen- Parameters:
defaultProgressInterface- the default progress interface- Returns:
- the replaced progress interface
-
isCreateLazily
public boolean isCreateLazily()Description copied from interface:ScreenThis method is called by the framework to determine if the screen should only be created when it is shown. By default, all screens provided by install4j are not created lazily. If you depend on custom code that has to be installed beforeScreen.createComponent()can be called, then you should returntruein this method.If you have many screens that are created lazily and want to initialize them all at once, maybe after the "Install files" action, you can call
Context.initializeLazilyCreatedScreens().- Specified by:
isCreateLazilyin interfaceScreen- Returns:
trueorfalse.
-
getInstallerContext
Returns theInstallerContextthat the framework has associated with this custom screen insetInstallerContext(InstallerContext).- Returns:
- the installer context.
-
getWidgetStyleHandler
Returns theWidgetStyleHandlerthat the framework has associated with this custom screen insetWidgetStyleHandler(WidgetStyleHandler).- Returns:
- the widget style handler
-