Package com.oorian.html.layout
Class WizardLayout
java.lang.Object
- All Implemented Interfaces:
ClientEventListener,MouseClickListener,EventListener
A layout for multi-step wizard/stepper interfaces.
WizardLayout provides a structure for guiding users through multi-step processes such as checkout flows, registration wizards, onboarding sequences, and setup processes. It features a progress indicator, step content area, and navigation controls.
Structure:
┌──────────────────────────────────────┐ │ Header (optional) │ ├──────────────────────────────────────┤ │ Step 1 ─── Step 2 ─── Step 3 │ (Progress Bar) ├──────────────────────────────────────┤ │ │ │ Step Content │ │ │ │ │ ├──────────────────────────────────────┤ │ [Back] [Next] │ (Navigation) └──────────────────────────────────────┘
Features:
- Progress indicator area for step indicators
- Flexible step content area
- Navigation footer with back/next buttons
- Optional page header
- Centered or full-width content options
Usage:
// Basic wizard
WizardLayout wizard = new WizardLayout();
wizard.progress(stepIndicator)
.content(step1Content)
.navigation(backBtn, nextBtn);
// With header
WizardLayout wizard = new WizardLayout();
wizard.header(new H2("Setup Wizard"))
.progress(stepIndicator)
.content(currentStepContent);
// Centered content
WizardLayout wizard = new WizardLayout();
wizard.centerContent()
.setContentMaxWidth(600)
.progress(steps)
.content(formContent)
.navigation(prevBtn, nextBtn);
// Full viewport
wizard.fillViewport();
- Since:
- 2025
- Version:
- 1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a step with the specified label and content.Adds a step with the specified label, ID, and content.Centers the content area horizontally with a max width.Sets the step content.intReturns the currently active step index.Returns the content area for advanced customization.Returns the content container for advanced customization.Returns the header pane for advanced customization.Returns the navigation area for advanced customization.Returns the progress area for advanced customization.intReturns the number of steps.Returns the step indicators container for customization.Returns the steps deck for advanced customization.Sets the header content.protected voidBuilds the element tree for the layout.booleanChecks if the wizard is on the first step.booleanChecks if the wizard is on the last step.navigation(Element<?> backButton, Element<?> nextButton) Sets the navigation buttons.navigationContent(Element<?> navContent) Sets custom navigation content (for more complex navigation layouts).nextStep()Advances to the next step.voidonEvent(MouseClickedEvent event) Handles click events on step indicators.Returns to the previous step.Sets the progress indicator content.setContentBackground(String color) Sets the content area background color.setContentMaxWidth(int width) Sets the maximum width for centered content.setContentMaxWidth(String width) Sets the maximum width for centered content.setContentPadding(int padding) Sets padding for the content container.setContentPadding(String padding) Sets padding for the content container.setHeaderBackground(String color) Sets the header area background color.setHeaderPadding(int padding) Sets padding for the header area.setHeaderPadding(String padding) Sets padding for the header area.setNavigationBackground(String color) Sets the navigation area background color.setNavigationPadding(int padding) Sets padding for the navigation area.setNavigationPadding(String padding) Sets padding for the navigation area.setProgressBackground(String color) Sets the progress area background color.setProgressPadding(int padding) Sets padding for the progress area.setProgressPadding(String padding) Sets padding for the progress area.showNavigationBorder(String color) Adds a top border to the navigation area.showProgressBorder(String color) Adds a bottom border to the progress area.showStep(int index) Shows the step at the specified index.Shows the step with the specified ID.Methods inherited from class com.oorian.html.layout.PageLayout
createPane, createPane, fillParent, fillViewport, setBackgroundColor, setMinHeightMethods inherited from class com.oorian.html.StyledElement
addClass, addStyle, addStyle, addStyleAttribute, addTransition, animate, clearTransitions, getActiveStyle, getCssClass, getDisabledStyle, getFocusStyle, getFocusVisibleStyle, getHoverStyle, getHtml, getStyle, getStyleAttribute, hidden, hide, isDisplayed, isTransitionForwardActive, onHide, onRemovedFromPage, onShow, removeClass, setActiveStyle, setAlignContent, setAlignContent, setAlignItems, setAlignItems, setAlignSelf, setAlignSelf, setAnimation, setAnimationDelay, setAnimationDelay, setAnimationDelay, setAnimationDirection, setAnimationDirection, setAnimationDuration, setAnimationDuration, setAnimationDuration, setAnimationFillMode, setAnimationFillMode, setAnimationIterationCount, setAnimationIterationCount, setAnimationIterationCount, setAnimationName, setAnimationPlayState, setAnimationPlayState, setAnimationTimingFunction, setAnimationTimingFunction, setAnimationTimingFunction, setAnimationTimingFunction, setBackdropFilter, setBackdropFilter, setBackfaceVisibility, setBackfaceVisibility, setBackground, setBackground, setBackgroundAttachment, setBackgroundAttachment, setBackgroundBlendMode, setBackgroundBlendMode, setBackgroundClip, setBackgroundClip, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBackgroundImage, setBackgroundOrigin, setBackgroundOrigin, setBackgroundPosition, setBackgroundPosition, setBackgroundPosition, setBackgroundPosition, setBackgroundPosition, setBackgroundRepeat, setBackgroundRepeat, setBackgroundSize, setBackgroundSize, setBackgroundSize, setBackgroundSize, setBackgroundSize, setBlur, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorder, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottom, setBorderBottomColor, setBorderBottomColor, setBorderBottomLeftRadius, setBorderBottomLeftRadius, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderBottomRightRadius, setBorderBottomRightRadius, setBorderBottomStyle, setBorderBottomStyle, setBorderBottomWidth, setBorderBottomWidth, setBorderBottomWidth, setBorderBottomWidth, setBorderColor, setBorderColor, setBorderColor, setBorderColor, setBorderImage, setBorderImage, setBorderImageOutset, setBorderImageRepeat, setBorderImageSlice, setBorderImageSource, setBorderImageWidth, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeft, setBorderLeftColor, setBorderLeftColor, setBorderLeftStyle, setBorderLeftStyle, setBorderLeftWidth, setBorderLeftWidth, setBorderLeftWidth, setBorderLeftWidth, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRadius, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRight, setBorderRightColor, setBorderRightColor, setBorderRightStyle, setBorderRightStyle, setBorderRightWidth, setBorderRightWidth, setBorderRightWidth, setBorderRightWidth, setBorderStyle, setBorderStyle, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTop, setBorderTopColor, setBorderTopColor, setBorderTopLeftRadius, setBorderTopLeftRadius, setBorderTopLeftRadius, setBorderTopRightRadius, setBorderTopRightRadius, setBorderTopRightRadius, setBorderTopStyle, setBorderTopStyle, setBorderTopWidth, setBorderTopWidth, setBorderTopWidth, setBorderTopWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBorderWidth, setBottom, setBottom, setBottom, setBoxShadow, setBoxShadow, setBoxShadow, setBoxShadow, setBoxShadow, setBoxSizing, setBoxSizing, setBreakAfter, setBreakBefore, setBreakInside, setBrightness, setClass, setClear, setClear, setClip, setClipPath, setClipPath, setColGap, setColGap, setColor, setColor, setColumnCount, setColumnCount, setColumnFill, setColumnFill, setColumnGap, setColumnRule, setColumnRuleColor, setColumnRuleColor, setColumnRuleStyle, setColumnRuleStyle, setColumnRuleWidth, setColumnRuleWidth, setColumns, setColumns, setColumns, setColumnSpan, setColumnWidth, setColumnWidth, setColumnWidth, setContrast, setCounterIncrement, setCounterReset, setCursor, setCursor, setDirection, setDirection, setDisabledStyle, setDisplay, setDisplay, setFilter, setFilter, setFilterOpacity, setFlex, setFlexBasis, setFlexDirection, setFlexDirection, setFlexFlow, setFlexGrow, setFlexGrow, setFlexShrink, setFlexShrink, setFlexWrap, setFlexWrap, setFloat, setFloat, setFocusStyle, setFocusVisibleStyle, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFont, setFontFace, setFontFamily, setFontFamily, setFontFeatureSettings, setFontKerning, setFontLanguageOverride, setFontSize, setFontSize, setFontSize, setFontSizeAdjust, setFontStretch, setFontStretch, setFontStyle, setFontStyle, setFontSynthesis, setFontVariant, setFontVariant, setFontVariantAlternates, setFontVariantCaps, setFontVariantEastAsian, setFontVariantLigatures, setFontVariantNumeric, setFontVariantPosition, setFontWeight, setFontWeight, setGap, setGap, setGap, setGap, setGrayscale, setHangingPunctuation, setHangingPunctuation, setHeight, setHeight, setHeight, setHoverStyle, setHueRotate, setHyphens, setImageOrientation, setImageRendering, setImageResolution, setImeMode, setInvert, setJustifyContent, setJustifyContent, setKeyFrames, setLeft, setLeft, setLeft, setLetterSpacing, setLetterSpacing, setLetterSpacing, setLetterSpacing, setLineBreak, setLineHeight, setLineHeight, setLineHeight, setLineHeight, setMargin, setMargin, setMargin, setMargin, setMargin, setMarginBottom, setMarginBottom, setMarginBottom, setMarginLeft, setMarginLeft, setMarginLeft, setMarginRight, setMarginRight, setMarginRight, setMarginTop, setMarginTop, setMarginTop, setMark, setMarkAfter, setMarkBefore, setMarks, setMarqueeDirection, setMarqueePlayCount, setMarqueeSpeed, setMarqueeStyle, setMask, setMaskType, setMaxHeight, setMaxHeight, setMaxHeight, setMaxHeightToWindowHeight, setMaxWidth, setMaxWidth, setMaxWidth, setMaxWidthToWindowWidth, setMinHeight, setMinHeight, setMinHeightToWindowHeight, setMinWidth, setMinWidth, setMinWidth, setMinWidthToWindowWidth, setNavDown, setNavIndex, setNavIndex, setNavLeft, setNavRight, setNavUp, setObjectFit, setObjectPosition, setOnClickNavigateBack, setOnClickNavigateBack, setOnClickNavigateBack, setOnClickNavigateForward, setOnClickNavigateForward, setOnClickNavigateForward, setOnClickNavigateTo, setOnDblClick, setOnDblClickChange, setOpacity, setOpacity, setOrder, setOrder, setOrphans, setOutline, setOutline, setOutline, setOutline, setOutlineColor, setOutlineColor, setOutlineOffset, setOutlineOffset, setOutlineOffset, setOutlineStyle, setOutlineStyle, setOutlineWidth, setOutlineWidth, setOutlineWidth, setOutlineWidth, setOverflow, setOverflow, setOverflow, setOverflowWrap, setOverflowX, setOverflowX, setOverflowY, setOverflowY, setPadding, setPadding, setPadding, setPadding, setPadding, setPadding, setPadding, setPadding, setPaddingBottom, setPaddingBottom, setPaddingBottom, setPaddingLeft, setPaddingLeft, setPaddingLeft, setPaddingRight, setPaddingRight, setPaddingRight, setPaddingTop, setPaddingTop, setPaddingTop, setPageBreakAfter, setPageBreakAfter, setPageBreakBefore, setPageBreakBefore, setPageBreakInside, setPageBreakInside, setPerspective, setPerspective, setPerspective, setPerspectiveOrigin, setPerspectiveOrigin, setPerspectiveOrigin, setPerspectiveOrigin, setPhonemes, setPosition, setPosition, setPosition, setPosition, setPosition, setQuotes, setResize, setResize, setResizeToWindowHeight, setResizeToWindowHeight, setResizeToWindowWidth, setRest, setRestAfter, setRestBefore, setRight, setRight, setRight, setRotate, setRotate, setRowGap, setRowGap, setSaturate, setScale, setScale, setSepia, setShow, setSize, setSize, setSize, setSkewX, setSkewY, setStyle, setStyle, setTabSize, setTabSize, setTabSize, setTabSize, setTextAlign, setTextAlign, setTextAlignLast, setTextAlignLast, setTextCombineUpright, setTextCombineWeight, setTextDecoration, setTextDecoration, setTextDecorationColor, setTextDecorationColor, setTextDecorationLine, setTextDecorationLine, setTextDecorationStyle, setTextDecorationStyle, setTextIndent, setTextIndent, setTextIndent, setTextIndent, setTextJustify, setTextJustify, setTextOrientation, setTextOverflow, setTextOverflow, setTextSelectDisabled, setTextShadow, setTextShadow, setTextShadow, setTextShadow, setTextShadow, setTextTransform, setTextTransform, setTextUnderlinePosition, setTop, setTop, setTop, setTransform, setTransform, setTransformOrigin, setTransformOrigin, setTransformOrigin, setTransformOrigin, setTransformOrigin, setTransformStyle, setTransformStyle, setTransition, setTransitionDelay, setTransitionDelay, setTransitionDelay, setTransitionDuration, setTransitionDuration, setTransitionDuration, setTransitionProperty, setTransitionTimingFunction, setTransitionTimingFunction, setTransitionTimingFunction, setTransitionTimingFunction, setTranslateX, setTranslateY, setTranslateZ, setUnicodeBidi, setUnicodeBidi, setVerticalAlign, setVerticalAlign, setVisibility, setVisibility, setVoiceBalance, setVoiceDuration, setVoicePitch, setVoicePitchRange, setVoiceRate, setVoiceStress, setVoiceVolume, setWhiteSpace, setWhiteSpace, setWidows, setWidth, setWidth, setWidth, setWordBreak, setWordBreak, setWordSpacing, setWordSpacing, setWordSpacing, setWordSpacing, setWordWrap, setWordWrap, setWritingMode, setZIndex, setZIndex, show, shown, stopAnimation, transitionForward, transitionForward, transitionReverse, transitionReverse, updateStyle, updateStyle, updateStyleIfChangedMethods inherited from class com.oorian.html.VisualElement
clearOnClick, click, disable, enable, getAccessKey, getAutoCapitalize, getEnterKeyHint, getInputMode, getPopover, getRole, getTabIndex, getTitle, isAutoFocus, isContentEditable, isDisabled, isDraggable, isHidden, isInert, isSpellCheck, onDisabled, onEnabled, setAccessKey, setAriaAtomic, setAriaBusy, setAriaChecked, setAriaCheckedMixed, setAriaControls, setAriaCurrent, setAriaDescribedBy, setAriaDisabled, setAriaErrorMessage, setAriaExpanded, setAriaHasPopup, setAriaHasPopup, setAriaHidden, setAriaInvalid, setAriaLabel, setAriaLabelledBy, setAriaLevel, setAriaLive, setAriaModal, setAriaOwns, setAriaPressed, setAriaRequired, setAriaSelected, setAriaValueRange, setAriaValueText, setAutoCapitalize, setAutoFocus, setConsumeEvent, setContentEditable, setDisabled, setDraggable, setDropAllowed, setEnterKeyHint, setFocus, setHidden, setInert, setInputMode, setOnAnimationCancel, setOnAnimationEnd, setOnAnimationIteration, setOnAnimationStart, setOnAuxClick, setOnBeforeInput, setOnBeforeToggle, setOnBlur, setOnChange, setOnClick, setOnClickChange, setOnCompositionEnd, setOnCompositionStart, setOnCompositionUpdate, setOnContextMenu, setOnCopy, setOnCut, setOnDocumentResize, setOnFocus, setOnFocusIn, setOnFocusOut, setOnFormData, setOnGotPointerCapture, setOnInput, setOnInvalid, setOnKeyDown, setOnKeyPressed, setOnKeyUp, setOnLostPointerCapture, setOnMouseDown, setOnMouseEnter, setOnMouseLeave, setOnMouseMove, setOnMouseOut, setOnMouseOutChangeClass, setOnMouseOutChangeStyle, setOnMouseOutChangeStyle, setOnMouseOver, setOnMouseOverChangeClass, setOnMouseOverChangeStyle, setOnMouseOverChangeStyle, setOnMouseOverShow, setOnMouseUp, setOnPageLoad, setOnPaste, setOnPointerCancel, setOnPointerDown, setOnPointerEnter, setOnPointerLeave, setOnPointerMove, setOnPointerOut, setOnPointerOver, setOnPointerUp, setOnResize, setOnScroll, setOnScrollEnd, setOnSelect, setOnSelectionChange, setOnSelectStart, setOnToggle, setOnTouchCancel, setOnTouchEnd, setOnTouchMove, setOnTouchStart, setOnTransitionCancel, setOnTransitionEnd, setOnTransitionRun, setOnTransitionStart, setOnWheel, setOnWindowResize, setPopover, setRole, setRole, setSpellCheck, setTabIndex, setTitle, setTooltipMethods inherited from class com.oorian.html.Element
addAttribute, addAttribute, addAttribute, addAttribute, addElement, addLineBreak, addLineOfText, addLineOfText, addLineOfText, addParagraph, addParagraph, addSpacer, addText, addText, addText, addText, assignId, containsElement, containsElement, create, dispatchEvent, dispatchEvent, dispatchEvent, dispatchEvent, equals, excludeId, executeJs, executeJs, executeJs, getAccept, getAllElements, getAncestor, getAttribute, getAttributes, getComponent, getDir, getElement, getElementById, getElementCount, getElementCount, getElements, getElements, getElementsByComponentName, getElementsByTagName, getHtml, getId, getInnerHtml, getInnerHtml, getIs, getItemId, getItemProp, getItemRef, getItemType, getLang, getNextSibling, getPage, getParent, getPart, getPrevSibling, getSlot, getTagName, getTextContent, getUrl, hasAttribute, hasElements, insertElement, isChildOf, isClosedTag, isCreated, isDescendantOf, isDescendantOf, isInitialized, isItemScope, isTranslate, onCallback, onCreated, onElementAdded, onElementRemoved, onHashChange, onHidden, onInitialized, onJsReturn, onPageLoaded, onPageUnloaded, onRefresh, onShown, onUpdated, onUserEvent, prewrite, recreate, refresh, refresh, registerAddition, registerListener, registerListener, registerListener, registerListener, registerListener, registerListener, registerListener, registerSubtraction, registerUpdate, removeAllElements, removeAttribute, removeAttribute, removeElement, removeElement, removeFromParent, requestCallback, requestCallback, requestCallback, requestCallback, resetId, scrollTo, scrollToBottom, scrollToTop, self, sendCommand, sendUpdate, setAccept, setComponent, setDir, setDir, setElement, setId, setIs, setItemId, setItemProp, setItemRef, setItemScope, setItemType, setLang, setOnError, setOnLoad, setPage, setParent, setPart, setSlot, setTagName, setText, setText, setText, setText, setTranslate, toString, unregisterListener, update, updateAttributesMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.oorian.messaging.events.client.MouseClickListener
onEvent
-
Constructor Details
-
WizardLayout
public WizardLayout()Constructs a WizardLayout with default configuration.
-
-
Method Details
-
initialize
protected void initialize()Builds the element tree for the layout.- Overrides:
initializein classStyledElement<WizardLayout>
-
header
Sets the header content.- Parameters:
header- the header element- Returns:
- this WizardLayout for method chaining
-
progress
Sets the progress indicator content.- Parameters:
progress- the progress indicator element (stepper, breadcrumb, etc.)- Returns:
- this WizardLayout for method chaining
-
content
Sets the step content.- Parameters:
content- the step content element- Returns:
- this WizardLayout for method chaining
-
centerContent
Centers the content area horizontally with a max width.- Returns:
- this WizardLayout for method chaining
-
setContentMaxWidth
Sets the maximum width for centered content.- Parameters:
width- the max width in pixels- Returns:
- this WizardLayout for method chaining
-
setContentMaxWidth
Sets the maximum width for centered content.- Parameters:
width- the max width value (e.g., "800px", "60%")- Returns:
- this WizardLayout for method chaining
-
setProgressPadding
Sets padding for the progress area.- Parameters:
padding- the padding in pixels- Returns:
- this WizardLayout for method chaining
-
setProgressPadding
Sets padding for the progress area.- Parameters:
padding- the padding value (e.g., "24px", "1.5rem")- Returns:
- this WizardLayout for method chaining
-
setContentPadding
Sets padding for the content container.- Parameters:
padding- the padding in pixels- Returns:
- this WizardLayout for method chaining
-
setContentPadding
Sets padding for the content container.- Parameters:
padding- the padding value (e.g., "24px", "1.5rem")- Returns:
- this WizardLayout for method chaining
-
setHeaderPadding
Sets padding for the header area.- Parameters:
padding- the padding in pixels- Returns:
- this WizardLayout for method chaining
-
setHeaderPadding
Sets padding for the header area.- Parameters:
padding- the padding value (e.g., "16px", "1rem")- Returns:
- this WizardLayout for method chaining
-
setProgressBackground
Sets the progress area background color.- Parameters:
color- the background color- Returns:
- this WizardLayout for method chaining
-
setContentBackground
Sets the content area background color.- Parameters:
color- the background color- Returns:
- this WizardLayout for method chaining
-
setHeaderBackground
Sets the header area background color.- Parameters:
color- the background color- Returns:
- this WizardLayout for method chaining
-
showProgressBorder
Adds a bottom border to the progress area.- Parameters:
color- the border color- Returns:
- this WizardLayout for method chaining
-
getHeaderPane
Returns the header pane for advanced customization.- Returns:
- the header pane
-
getProgressArea
Returns the progress area for advanced customization.- Returns:
- the progress area div
-
getContentContainer
Returns the content container for advanced customization.- Returns:
- the content container div
-
getContentArea
Returns the content area for advanced customization.- Returns:
- the content area div
-
addStep
Adds a step with the specified label and content.This creates a clickable step indicator and adds the content to an internal Deck. Clicking the step indicator will show the corresponding content.
- Parameters:
label- the label for this stepcontent- the content to display when this step is active- Returns:
- this WizardLayout for method chaining
-
addStep
Adds a step with the specified label, ID, and content.This creates a clickable step indicator and adds the content to an internal Deck. Clicking the step indicator will show the corresponding content.
- Parameters:
label- the label for this stepid- optional ID for programmatic access (if null, generated from label)content- the content to display when this step is active- Returns:
- this WizardLayout for method chaining
-
showStep
Shows the step at the specified index.- Parameters:
index- the step index (0-based)- Returns:
- this WizardLayout for method chaining
-
showStep
Shows the step with the specified ID.- Parameters:
id- the step ID- Returns:
- this WizardLayout for method chaining
-
nextStep
Advances to the next step.- Returns:
- this WizardLayout for method chaining
-
previousStep
Returns to the previous step.- Returns:
- this WizardLayout for method chaining
-
getActiveStepIndex
public int getActiveStepIndex()Returns the currently active step index.- Returns:
- the active step index, or -1 if no step is active
-
getStepCount
public int getStepCount()Returns the number of steps.- Returns:
- the step count
-
isFirstStep
public boolean isFirstStep()Checks if the wizard is on the first step.- Returns:
- true if on the first step
-
isLastStep
public boolean isLastStep()Checks if the wizard is on the last step.- Returns:
- true if on the last step
-
onEvent
Handles click events on step indicators.- Specified by:
onEventin interfaceMouseClickListener- Parameters:
event- the mouse click event
-
getStepIndicators
Returns the step indicators container for customization.- Returns:
- the step indicators HStack
-
getStepsDeck
Returns the steps deck for advanced customization.- Returns:
- the steps Deck
-