Class Wizard
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.orderedlayout.VerticalLayout
de.bytestore.hostinger.components.wizard.Wizard
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.ClickNotifier<com.vaadin.flow.component.orderedlayout.VerticalLayout>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasComponents,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasOrderedComponents,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.orderedlayout.FlexComponent,com.vaadin.flow.component.orderedlayout.ThemableLayout,Serializable
public class Wizard
extends com.vaadin.flow.component.orderedlayout.VerticalLayout
The Wizard class represents a structured component that guides users through a series of steps.
It is typically used in multi-step processes such as form submission wizards or installation steps.
The class defines a container with three main sections - a header, body, and footer.
Components:
- header: A
WizardHeader that serves as the top section of the wizard, providing a title and sub-header.
- body: A HorizontalLayout where the content of the active wizard step is displayed.
- footer: A WizardFooter containing navigation buttons (e.g., Back and Next).
- steps: A list of WizardStep that defines the sequence of steps in the wizard.
- current: The currently displayed WizardStep.
- left: A list of steps left to complete.
Features:
- The wizard allows users to dynamically add steps using the addStep(WizardStep stepIO) method.
- The current wizard page can be set using the setWizardPage(int pageIO) method to update the body layout with the desired step.
- The sizing of the components is handled programmatically to ensure appropriate layout and alignment.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.flow.component.orderedlayout.FlexComponent
com.vaadin.flow.component.orderedlayout.FlexComponent.Alignment, com.vaadin.flow.component.orderedlayout.FlexComponent.JustifyContentMode -
Constructor Summary
ConstructorsConstructorDescriptionWizard()The Wizard class represents a multi-step UI component designed to guide users through a sequence of steps in an organized and visually structured manner. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStep(WizardStep stepIO) Adds a WizardStep to the Wizard.voidsetBackwardsEnabled(boolean stateIO) Enables or disables the "Back" button in the wizard footer and sets the appropriate title for the button based on its state.voidsetForwardEnabled(boolean stateIO) Enables or disables the forward navigation button in the wizard footervoidsetWizardPage(int pageIO) Sets the current wizard page by updating the body layout.Methods inherited from class com.vaadin.flow.component.orderedlayout.VerticalLayout
addAndExpand, getAlignItems, getAlignSelf, getDefaultHorizontalComponentAlignment, getHorizontalComponentAlignment, setAlignItems, setAlignSelf, setDefaultHorizontalComponentAlignment, setHorizontalComponentAlignment, setPadding, setSpacingMethods inherited from class com.vaadin.flow.component.Component
findAncestor, from, getChildren, getElement, getId, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, isAttached, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, setId, setVisibleMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.ClickNotifier
addClickListener, addClickShortcut, addDoubleClickListener, addSingleClickListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.orderedlayout.FlexComponent
expand, getFlexGrow, getFlexShrink, getJustifyContentMode, replace, setFlexGrow, setFlexShrink, setJustifyContentModeMethods inherited from interface com.vaadin.flow.component.HasComponents
add, add, add, addComponentAsFirst, addComponentAtIndex, remove, remove, removeAllMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasOrderedComponents
getChildren, getComponentAt, getComponentCount, indexOfMethods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.orderedlayout.ThemableLayout
getBoxSizing, getSpacing, getThemeList, isMargin, isPadding, isSpacing, isWrap, setBoxSizing, setMargin, setSpacing, setSpacing, setWrap
-
Constructor Details
-
Wizard
public Wizard()The Wizard class represents a multi-step UI component designed to guide users through a sequence of steps in an organized and visually structured manner. This
-
-
Method Details
-
addStep
Adds a WizardStep to the Wizard.- Parameters:
stepIO- the WizardStep to be added
-
setWizardPage
public void setWizardPage(int pageIO) Sets the current wizard page by updating the body layout. This method removes all components currently in the body layout and replaces them with the specified wizard step, based on the provided index.- Parameters:
pageIO- the index of the wizard step to display in the body layout
-
setForwardEnabled
public void setForwardEnabled(boolean stateIO) Enables or disables the forward navigation button in the wizard footer -
setBackwardsEnabled
public void setBackwardsEnabled(boolean stateIO) Enables or disables the "Back" button in the wizard footer and sets the appropriate title for the button based on its state.- Parameters:
stateIO- A boolean value indicating whether the "Back" button should be enabled or disabled. If true, the button is enabled, and the title is set
-