Class AbstractInstallerScreen

  • All Implemented Interfaces:
    Bean, VisualContainerBean, InstallerScreen, Screen

    public abstract class AbstractInstallerScreen
    extends AbstractBean
    implements InstallerScreen
    Abstract base class for installer screens. All methods that have a reasonable default answer are overridden in the class. This class saves the installer context that is set by the framework and provides a getter for it.
    • Constructor Detail

      • AbstractInstallerScreen

        public AbstractInstallerScreen()
    • Method Detail

      • setInstallerContext

        public void setInstallerContext​(InstallerContext context)
        Description copied from interface: InstallerScreen
        This method is called by the framework to set the InstallerContext just after the screen has been constructed.
        Specified by:
        setInstallerContext in interface InstallerScreen
        Parameters:
        context - the installer context.
      • isNextVisible

        public boolean isNextVisible()
        Description copied from interface: Screen
        Returns whether the "Next" button is visible or not for this screen. If you just want to disable the button initially, please override activate and invoke setNextButtonEnabled in the WizardContext that is available from the Context in GUI mode.

        In console or unattended mode, this method is never called.

        Specified by:
        isNextVisible in interface Screen
        Returns:
        true or false. Default is true.
        See Also:
        WizardContext
      • isPreviousVisible

        public boolean isPreviousVisible()
        Description copied from interface: Screen
        Returns whether the "Back" button is visible or not for this screen. If you just want to disable the button initially, please override activate and invoke setPreviousButtonEnabled in the WizardContext that is available from the Context in GUI mode.

        In console or unattended mode, this method is never called.

        Specified by:
        isPreviousVisible in interface Screen
        Returns:
        true or false. Default is true.
        See Also:
        WizardContext
      • isCancelVisible

        public boolean isCancelVisible()
        Description copied from interface: Screen
        Returns whether the "Cancel" button is visible or not for this screen. If you just want to disable the button initially, please override activate and invoke setCancelButtonEnabled in the WizardContext that is available from the Context in GUI mode.

        In console or unattended mode, this method is never called.

        Specified by:
        isCancelVisible in interface Screen
        Returns:
        true or false. Default is true.
        See Also:
        WizardContext
      • isHiddenForNext

        public boolean isHiddenForNext()
        Description copied from interface: Screen
        Returns 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:
        isHiddenForNext in interface Screen
        Returns:
        true or false.
      • isHiddenForPrevious

        public boolean isHiddenForPrevious()
        Description copied from interface: Screen
        Returns 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:
        isHiddenForPrevious in interface Screen
        Returns:
        true or false.
      • activated

        public void activated()
        Description copied from interface: Screen
        Called by the framework just after the screen has been activated. Override this method to perform any special initialization.

        In console or unattended mode, this method is never called.

        Specified by:
        activated in interface Screen
      • deactivated

        public void deactivated()
        Description copied from interface: Screen
        Called 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:
        deactivated in interface Screen
      • next

        public boolean next()
        Description copied from interface: Screen
        Called when the user clicks the "Next" button for this screen. You can veto the change to the next screen if you return false.

        In console or unattended mode, this method is never called.

        Specified by:
        next in interface Screen
        Returns:
        whether the screen change is accepted or not.
      • previous

        public boolean previous()
        Description copied from interface: Screen
        Called when the user clicks the "Back" button for this screen. You can veto the change to the previous screen if you return false.

        In console or unattended mode, this method is never called.

        Specified by:
        previous in interface Screen
        Returns:
        whether the screen change is accepted or not.
      • cancel

        public boolean cancel()
        Description copied from interface: Screen
        Called when the user clicks the "Cancel" button for this screen. You can veto the cancel action if you return false.
        Specified by:
        cancel in interface Screen
        Returns:
        whether the cancellation is accepted or not.

        In console or unattended mode, this method is never called.

      • willActivate

        public void willActivate()
        Description copied from interface: Screen
        Called 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:
        willActivate in interface Screen
      • isHidden

        public boolean isHidden()
        Description copied from interface: Screen
        Returns whether this screen should be hidden. If this method returns true, it overrides the results of isHiddenForNext and isHiddenForPrevious.

        This method is also called in console or unattended mode.

        Specified by:
        isHidden in interface Screen
        Returns:
        true or false.
        See Also:
        Screen.isHiddenForNext(), Screen.isHiddenForPrevious()
      • handleUnattended

        public boolean handleUnattended()
        Description copied from interface: Screen
        Handle 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:
        handleUnattended in interface Screen
        Returns:
        whether the installer or uninstaller can proceed with the next screen or whether the process should be cancelled.
      • handleConsole

        public boolean handleConsole​(Console console)
                              throws UserCanceledException
        Description copied from interface: Screen
        Handle the console mode. This method is called when the screen is entered in console mode. You can use the Console object to interact with the user and replicate the GUI functionality on the terminal.

        If this screen has a form panel (i.e. hasFormPanel() returns true), you should call FormEnvironment.handleConsole in this method to handle console mode for the contained form components.

        Specified by:
        handleConsole in interface Screen
        Parameters:
        console - the Console object
        Returns:
        whether the installer or uninstaller can proceed with the next screen or whether the process should be cancelled.
        Throws:
        UserCanceledException - if the user cancels a question or notice. These exceptions are thrown by methods in the Console object.
        See Also:
        FormEnvironment.handleConsole(Console)
      • getProgressInterface

        public ProgressInterface getProgressInterface​(ProgressInterface defaultProgressInterface)
        Description copied from interface: Screen
        Replace 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:
        getProgressInterface in interface Screen
        Parameters:
        defaultProgressInterface - the default progress interface
        Returns:
        the replaced progress interface
      • isCreateLazily

        public boolean isCreateLazily()
        Description copied from interface: Screen
        This 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 install4 are not created lazily. If you depend on custom code, that has to be installed before Screen.createComponent() can be called, then you should return true in 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:
        isCreateLazily in interface Screen
        Returns:
        true or false.
      • getInstallerContext

        public InstallerContext getInstallerContext()
        Returns the InstallerContext that the framework has associated with this custom screen in setInstallerContext.
        Returns:
        the installer context.