Class ProgressStepper
java.lang.Object
org.patternfly.component.BaseComponent<HTMLOListElement,ProgressStepper>
org.patternfly.component.progressstepper.ProgressStepper
- All Implemented Interfaces:
Iterable<ProgressStep>,ElementAttributeMethods<HTMLOListElement,,ProgressStepper> ElementClassListMethods<HTMLOListElement,,ProgressStepper> ElementConsumerMethods<HTMLOListElement,,ProgressStepper> ElementContainerMethods<HTMLOListElement,,ProgressStepper> ElementEventMethods<HTMLOListElement,,ProgressStepper> ElementIdMethods<HTMLOListElement,,ProgressStepper> ElementQueryMethods<HTMLOListElement>,HTMLElementAttributeMethods<HTMLOListElement,,ProgressStepper> HTMLElementDataMethods<HTMLOListElement,,ProgressStepper> HTMLElementStyleMethods<HTMLOListElement,,ProgressStepper> HTMLElementVisibilityMethods<HTMLOListElement,,ProgressStepper> IsElement<HTMLOListElement>,TypedBuilder<HTMLOListElement,,ProgressStepper> Component,HasItems<HTMLOListElement,,ProgressStepper, ProgressStep> org.patternfly.style.Modifiers.Center<HTMLOListElement,,ProgressStepper> org.patternfly.style.Modifiers.Compact<HTMLOListElement,,ProgressStepper> org.patternfly.style.Modifiers.Vertical<HTMLOListElement,ProgressStepper>
public class ProgressStepper
extends BaseComponent<HTMLOListElement,ProgressStepper>
implements org.patternfly.style.Modifiers.Center<HTMLOListElement,ProgressStepper>, org.patternfly.style.Modifiers.Compact<HTMLOListElement,ProgressStepper>, HasItems<HTMLOListElement,ProgressStepper,ProgressStep>, org.patternfly.style.Modifiers.Vertical<HTMLOListElement,ProgressStepper>
A progress stepper displays a timeline of tasks in a workflow and tracks a
user's progress through the workflow.
The navigation semantics use a sentinel index interval of [-1, size]:
- -1 → underflow / before first element (no current step)
- 0..n-1 → valid current step indices
- size() → overflow / after last element (no current step)
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionadd(ProgressStep item) voidclear()booleanintReturns the index of the current progress step.first()Selects the first step (index 0) if available.first(Consumer<ProgressStep> actionForTheFirstStep, Consumer<ProgressStep> actionForThePreviousCurrentStep) Selects the first step (index 0) if available.booleanisEmpty()iterator()last()Selects the last step (index size-1) if present.last(Consumer<ProgressStep> actionForTheLastStep, Consumer<ProgressStep> actionForThePreviousCurrentStep) Selects the last step (index size-1) if present.next()Moves one step forward.next(BiConsumer<Optional<ProgressStep>, Integer> actionForTheNewCurrentWithIndex, Consumer<ProgressStep> actionForThePreviousCurrent) Moves one step forward with callbacks.previous()Moves one step backward.previous(BiConsumer<Optional<ProgressStep>, Integer> actionForTheNewCurrentStepWithIndex, Consumer<ProgressStep> actionForThePreviousCurrentStep) Moves one step backward with callbacks.static ProgressSteppersetupSteps(BiConsumer<ProgressStep, Integer> stepConsumerWithIndex) Applies the provided consumer to each step with its index in insertion order.intsize()that()<T> voidupdateItems(Iterable<T> items, Function<T, ProgressStep> display) Methods inherited from class org.patternfly.component.BaseComponent
componentType, elementMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jboss.elemento.ElementAttributeMethods
aria, aria, aria, attr, attr, attr, role, roleMethods inherited from interface org.jboss.elemento.ElementClassListMethods
classList, classList, css, toggle, toggle, toggleMethods inherited from interface org.jboss.elemento.ElementConsumerMethods
apply, runMethods inherited from interface org.jboss.elemento.ElementContainerMethods
add, add, add, add, addAll, addAll, addAll, addAll, addAll, addAllMethods inherited from interface org.jboss.elemento.ElementEventMethods
on, on, onMethods inherited from interface org.jboss.elemento.ElementIdMethods
id, uniqueIdMethods inherited from interface org.jboss.elemento.ElementQueryMethods
closest, querySelector, querySelectorAllMethods inherited from interface org.jboss.elemento.HTMLElementAttributeMethods
titleMethods inherited from interface org.jboss.elemento.HTMLElementDataMethods
dataMethods inherited from interface org.jboss.elemento.HTMLElementStyleMethods
style, style, style, style, style, styleMethods inherited from interface org.jboss.elemento.HTMLElementVisibilityMethods
hiddenMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.patternfly.style.Modifiers.Center
center, centerMethods inherited from interface org.patternfly.style.Modifiers.Compact
compact, compactMethods inherited from interface org.patternfly.style.Modifiers.Vertical
vertical, vertical
-
Method Details
-
progressStepper
-
add
- Specified by:
addin interfaceHasItems<HTMLOListElement,ProgressStepper, ProgressStep>
-
that
- Specified by:
thatin interfaceTypedBuilder<HTMLOListElement,ProgressStepper>
-
first
Selects the first step (index 0) if available. Does nothing if there are no steps or the first step is already current.- Returns:
- this instance
-
first
public ProgressStepper first(Consumer<ProgressStep> actionForTheFirstStep, Consumer<ProgressStep> actionForThePreviousCurrentStep) Selects the first step (index 0) if available. Previous current (if any) is cleared, then the first step is marked current. No change if empty or already at index 0.- Parameters:
actionForTheFirstStep- invoked with the first step after it becomes currentactionForThePreviousCurrentStep- invoked with the previous current step after it is cleared- Returns:
- this instance
-
previous
Moves one step backward.Transitions:
- size → size-1 (from overflow to last)
- i > 0 → i-1 (normal backward)
- 0 → -1 (underflow; no current)
- -1 → no change
- Returns:
- this instance
-
previous
public ProgressStepper previous(BiConsumer<Optional<ProgressStep>, Integer> actionForTheNewCurrentStepWithIndex, Consumer<ProgressStep> actionForThePreviousCurrentStep) Moves one step backward with callbacks. Seeprevious()for state transitions.- Parameters:
actionForTheNewCurrentStepWithIndex- receives Optional(new step) and its index, or Optional.empty() on underflowactionForThePreviousCurrentStep- receives the step that was current (if it existed) after clearing- Returns:
- this instance
-
next
Moves one step forward.Transitions:
- -1 → 0 (from underflow to first)
- i < size - 1 → i + 1 (normal forward)
- size - 1 → size (overflow; no current)
- size → no change
- Returns:
- this instance
-
next
public ProgressStepper next(BiConsumer<Optional<ProgressStep>, Integer> actionForTheNewCurrentWithIndex, Consumer<ProgressStep> actionForThePreviousCurrent) Moves one step forward with callbacks. Seenext()for state transitions.- Parameters:
actionForTheNewCurrentWithIndex- receives Optional(new step) and its index, or Optional.empty() on overflowactionForThePreviousCurrent- receives the step that was current (if it existed) after clearing- Returns:
- this instance
-
last
Selects the last step (index size-1) if present. Does nothing if empty or already at last.- Returns:
- this instance
-
last
public ProgressStepper last(Consumer<ProgressStep> actionForTheLastStep, Consumer<ProgressStep> actionForThePreviousCurrentStep) Selects the last step (index size-1) if present. Previous current (if valid) is cleared, then the last step is marked current.- Parameters:
actionForTheLastStep- invoked with the last step after it becomes currentactionForThePreviousCurrentStep- invoked with the previous current step after it is cleared- Returns:
- this instance
-
ariaLabel
-
updateItems
-
iterator
- Specified by:
iteratorin interfaceIterable<ProgressStep>
-
size
public int size()- Specified by:
sizein interfaceHasItems<HTMLOListElement,ProgressStepper, ProgressStep>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceHasItems<HTMLOListElement,ProgressStepper, ProgressStep>
-
contains
- Specified by:
containsin interfaceHasItems<HTMLOListElement,ProgressStepper, ProgressStep>
-
item
- Specified by:
itemin interfaceHasItems<HTMLOListElement,ProgressStepper, ProgressStep>
-
currentIndex
public int currentIndex()Returns the index of the current progress step. The interval is [-1, size], where -1 implies no current step (before first) and size implies no current step (after last). -
clear
public void clear()- Specified by:
clearin interfaceHasItems<HTMLOListElement,ProgressStepper, ProgressStep>
-
setupSteps
Applies the provided consumer to each step with its index in insertion order.- Parameters:
stepConsumerWithIndex- consumer receiving (step, index)- Returns:
- this instance
-