Interface Screen
- All Superinterfaces:
Bean,VisualContainerBean
- All Known Subinterfaces:
InstallerScreen,UninstallerScreen
- All Known Implementing Classes:
AbstractInstallerOrUninstallerScreen,AbstractInstallerScreen,AbstractUninstallerScreen
-
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.Return the visual component that is displayed for the screen.voidCalled by the framework just after the screen has been deactivated.getProgressInterface(ProgressInterface defaultProgressInterface) Replace the default progress interface for actions with a custom progress interface.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.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.voidCalled by the framework just before the screen is activated.Methods inherited from interface com.install4j.api.beans.VisualContainerBean
getAnchor, isFillHorizontal, isFillVertical
-
Method Details
-
createComponent
JComponent createComponent()Return the visual component that is displayed for the screen. This method is only called once, so the result does not have to be cached.In console or unattended mode, this method is never called.
- Returns:
- the component
-
getTitle
String getTitle()Returns the title of this custom screen which is displayed at the top of the installer wizard.In console or unattended mode, this method is never called.
- Returns:
- the title.
-
getSubTitle
String getSubTitle()Returns the subtitle of this custom screen which is displayed at the top of the installer wizard just below the title of the screen.In unattended mode, this method is never called. In console mode, the result of this method will be displayed for each screen.
- Returns:
- the title.
-
isNextVisible
boolean isNextVisible()Returns whether the "Next" button is visible or not for this screen. If you just want to disable the button initially, please overrideactivateand invokesetNextButtonEnabledin theWizardContextthat is available from theContextin GUI mode.In console or unattended mode, this method is never called.
- Returns:
trueorfalse. Default istrue.- See Also:
-
isPreviousVisible
boolean isPreviousVisible()Returns whether the "Back" button is visible or not for this screen. If you just want to disable the button initially, please overrideactivateand invokesetPreviousButtonEnabledin theWizardContextthat is available from theContextin GUI mode.In console or unattended mode, this method is never called.
- Returns:
trueorfalse. Default istrue.- See Also:
-
isCancelVisible
boolean isCancelVisible()Returns whether the "Cancel" button is visible or not for this screen. If you just want to disable the button initially, please overrideactivateand invokesetCancelButtonEnabledin theWizardContextthat is available from theContextin GUI mode.In console or unattended mode, this method is never called.
- Returns:
trueorfalse. Default istrue.- See Also:
-
willActivate
void willActivate()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.
-
activated
void activated()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.
-
deactivated
void deactivated()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.
-
next
boolean next()Called 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.
- Returns:
- whether the screen change is accepted or not.
-
previous
boolean previous()Called 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.
- Returns:
- whether the screen change is accepted or not.
-
cancel
boolean cancel()Called when the user clicks the "Cancel" button for this screen. You can veto the cancel action if you returnfalse.- Returns:
- whether the cancellation is accepted or not.
In console or unattended mode, this method is never called.
-
isHiddenForNext
boolean isHiddenForNext()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.
- Returns:
trueorfalse.
-
isHiddenForPrevious
boolean isHiddenForPrevious()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.
- Returns:
trueorfalse.
-
isHidden
boolean isHidden()Returns 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.
- Returns:
trueorfalse.- See Also:
-
handleUnattended
boolean handleUnattended()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.- Returns:
- whether the installer or uninstaller can proceed with the next screen or whether the process should be canceled.
-
handleConsole
Handle 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.- 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
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".- Parameters:
defaultProgressInterface- the default progress interface- Returns:
- the replaced progress interface
-
isCreateLazily
boolean isCreateLazily()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 beforecreateComponent()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().- Returns:
trueorfalse.
-