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>, Modifiers.Center<HTMLOListElement, ProgressStepper>, Modifiers.Compact<HTMLOListElement, ProgressStepper>, Modifiers.Vertical<HTMLOListElement, ProgressStepper>
public class ProgressStepper
extends BaseComponent<HTMLOListElement, ProgressStepper>
implements Modifiers.Center<HTMLOListElement, ProgressStepper>, Modifiers.Compact<HTMLOListElement, ProgressStepper>, HasItems<HTMLOListElement, ProgressStepper, ProgressStep>, 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 the first element (no current step)
- 0..n-1 → valid current step indices
- size() → overflow / after the last element (no current step)
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionadd(ProgressStep item) Adds an item to the component.voidclear()Clears all items from the component.booleanChecks whether the component contains an item associated with the given identifier.intReturns 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()Checks whether the collection of items in the component is empty.Retrieves the item associated with the specified identifier from the component.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.onAdd(AddItemHandler<ProgressStepper, ProgressStep> onAdd) Registers a callback to be invoked whenever a new item is added to the component.onRemove(RemoveItemHandler<ProgressStepper, ProgressStep> onRemove) Registers a callback to be invoked whenever an item is removed from the component.onUpdate(UpdateItemHandler<ProgressStepper, ProgressStep> onUpdate) Registers a callback to be invoked whenever an item is updated in the component.previous()Moves one step backward.previous(BiConsumer<Optional<ProgressStep>, Integer> actionForTheNewCurrentStepWithIndex, Consumer<ProgressStep> actionForThePreviousCurrentStep) Moves one step backward with callbacks.static ProgressSteppervoidremoveItem(String identifier) Removes an item from the component based on the provided identifier.setupSteps(BiConsumer<ProgressStep, Integer> stepConsumerWithIndex) Applies the provided consumer to each step with its index in insertion order.intsize()Retrieves the total number of items currently contained in the component.that()voidupdateItem(ProgressStep item) Updates an existing item in the component.Methods inherited from class BaseComponent
componentType, element, registerComponentMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ElementAttributeMethods
aria, aria, aria, attr, attr, attr, role, roleMethods inherited from interface ElementClassListMethods
classList, classList, css, toggle, toggle, toggleMethods inherited from interface ElementConsumerMethods
apply, runMethods inherited from interface ElementContainerMethods
add, add, add, add, addAll, addAll, addAll, addAll, addAll, addAllMethods inherited from interface ElementEventMethods
on, on, onMethods inherited from interface ElementIdMethods
id, uniqueIdMethods inherited from interface ElementQueryMethods
closest, querySelector, querySelectorAllMethods inherited from interface HasItems
addItem, addItems, items, replaceItemElement, updateItem, updateItemMethods inherited from interface HTMLElementAttributeMethods
titleMethods inherited from interface HTMLElementDataMethods
data, dataMethods inherited from interface HTMLElementVisibilityMethods
hiddenMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface Modifiers.Center
center, centerMethods inherited from interface Modifiers.Compact
compact, compactMethods inherited from interface Modifiers.Vertical
vertical, vertical
-
Method Details
-
progressStepper
-
add
Description copied from interface:HasItemsAdds an item to the component.- Specified by:
addin interfaceHasItems<HTMLOListElement, ProgressStepper, ProgressStep>- Parameters:
item- the item to be added to the component- Returns:
- the builder instance after the item has been added
-
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
-
onAdd
Description copied from interface:HasItemsRegisters a callback to be invoked whenever a new item is added to the component.- Specified by:
onAddin interfaceHasItems<HTMLOListElement, ProgressStepper, ProgressStep>- Parameters:
onAdd- aAddItemHandlerthat takes the builder instance and the item being added as arguments- Returns:
- the builder instance after adding the callback
-
onUpdate
Description copied from interface:HasItemsRegisters a callback to be invoked whenever an item is updated in the component.- Specified by:
onUpdatein interfaceHasItems<HTMLOListElement, ProgressStepper, ProgressStep>- Parameters:
onUpdate- aUpdateItemHandlerthat takes the component, the previous state of the item, and the updated state of the item as arguments- Returns:
- the builder instance after adding the callback
-
onRemove
Description copied from interface:HasItemsRegisters a callback to be invoked whenever an item is removed from the component.- Specified by:
onRemovein interfaceHasItems<HTMLOListElement, ProgressStepper, ProgressStep>- Parameters:
onRemove- aRemoveItemHandlerthat takes the component and the item being removed as arguments- Returns:
- the builder instance after adding the callback
-
iterator
- Specified by:
iteratorin interfaceIterable<ProgressStep>
-
size
public int size()Description copied from interface:HasItemsRetrieves the total number of items currently contained in the component.- Specified by:
sizein interfaceHasItems<HTMLOListElement, ProgressStepper, ProgressStep>- Returns:
- the number of items contained in the component
-
isEmpty
public boolean isEmpty()Description copied from interface:HasItemsChecks whether the collection of items in the component is empty.- Specified by:
isEmptyin interfaceHasItems<HTMLOListElement, ProgressStepper, ProgressStep>- Returns:
trueif the component contains no items;falseotherwise
-
contains
Description copied from interface:HasItemsChecks whether the component contains an item associated with the given identifier.- Specified by:
containsin interfaceHasItems<HTMLOListElement, ProgressStepper, ProgressStep>- Parameters:
identifier- the identifier of the item to be checked- Returns:
- true if the component contains an item associated with the provided identifier, false otherwise
-
item
Description copied from interface:HasItemsRetrieves the item associated with the specified identifier from the component.- Specified by:
itemin interfaceHasItems<HTMLOListElement, ProgressStepper, ProgressStep>- Parameters:
identifier- the identifier of the item to be retrieved- Returns:
- the item associated with the given identifier, or
nullif no item is found
-
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). -
setupSteps
Applies the provided consumer to each step with its index in insertion order.- Parameters:
stepConsumerWithIndex- consumer receiving (step, index)- Returns:
- this instance
-
updateItem
Description copied from interface:HasItemsUpdates an existing item in the component.- Specified by:
updateItemin interfaceHasItems<HTMLOListElement, ProgressStepper, ProgressStep>- Parameters:
item- the item to be updated
-
removeItem
Description copied from interface:HasItemsRemoves an item from the component based on the provided identifier.- Specified by:
removeItemin interfaceHasItems<HTMLOListElement, ProgressStepper, ProgressStep>- Parameters:
identifier- the identifier of the item to be removed
-
clear
public void clear()Description copied from interface:HasItemsClears all items from the component. This method removes any existing items within the component, leaving it empty. Any associated or registered callbacks related to the removal of items may be invoked as part of this operation.- Specified by:
clearin interfaceHasItems<HTMLOListElement, ProgressStepper, ProgressStep>
-