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>

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 Details

    • progressStepper

      public static ProgressStepper progressStepper()
    • add

      public ProgressStepper add(ProgressStep item)
      Description copied from interface: HasItems
      Adds an item to the component.
      Specified by:
      add in interface HasItems<HTMLOListElement, ProgressStepper, ProgressStep>
      Parameters:
      item - the item to be added to the component
      Returns:
      the builder instance after the item has been added
    • that

      public ProgressStepper that()
      Specified by:
      that in interface TypedBuilder<HTMLOListElement, ProgressStepper>
    • first

      public 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 current
      actionForThePreviousCurrentStep - invoked with the previous current step after it is cleared
      Returns:
      this instance
    • previous

      public ProgressStepper 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. See previous() for state transitions.
      Parameters:
      actionForTheNewCurrentStepWithIndex - receives Optional(new step) and its index, or Optional.empty() on underflow
      actionForThePreviousCurrentStep - receives the step that was current (if it existed) after clearing
      Returns:
      this instance
    • next

      public ProgressStepper 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. See next() for state transitions.
      Parameters:
      actionForTheNewCurrentWithIndex - receives Optional(new step) and its index, or Optional.empty() on overflow
      actionForThePreviousCurrent - receives the step that was current (if it existed) after clearing
      Returns:
      this instance
    • last

      public ProgressStepper 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 current
      actionForThePreviousCurrentStep - invoked with the previous current step after it is cleared
      Returns:
      this instance
    • ariaLabel

      public ProgressStepper ariaLabel(String label)
    • onAdd

      Description copied from interface: HasItems
      Registers a callback to be invoked whenever a new item is added to the component.
      Specified by:
      onAdd in interface HasItems<HTMLOListElement, ProgressStepper, ProgressStep>
      Parameters:
      onAdd - a AddItemHandler that takes the builder instance and the item being added as arguments
      Returns:
      the builder instance after adding the callback
    • onUpdate

      Description copied from interface: HasItems
      Registers a callback to be invoked whenever an item is updated in the component.
      Specified by:
      onUpdate in interface HasItems<HTMLOListElement, ProgressStepper, ProgressStep>
      Parameters:
      onUpdate - a UpdateItemHandler that 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: HasItems
      Registers a callback to be invoked whenever an item is removed from the component.
      Specified by:
      onRemove in interface HasItems<HTMLOListElement, ProgressStepper, ProgressStep>
      Parameters:
      onRemove - a RemoveItemHandler that takes the component and the item being removed as arguments
      Returns:
      the builder instance after adding the callback
    • iterator

      public Iterator<ProgressStep> iterator()
      Specified by:
      iterator in interface Iterable<ProgressStep>
    • size

      public int size()
      Description copied from interface: HasItems
      Retrieves the total number of items currently contained in the component.
      Specified by:
      size in interface HasItems<HTMLOListElement, ProgressStepper, ProgressStep>
      Returns:
      the number of items contained in the component
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: HasItems
      Checks whether the collection of items in the component is empty.
      Specified by:
      isEmpty in interface HasItems<HTMLOListElement, ProgressStepper, ProgressStep>
      Returns:
      true if the component contains no items; false otherwise
    • contains

      public boolean contains(String identifier)
      Description copied from interface: HasItems
      Checks whether the component contains an item associated with the given identifier.
      Specified by:
      contains in interface HasItems<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

      public ProgressStep item(String identifier)
      Description copied from interface: HasItems
      Retrieves the item associated with the specified identifier from the component.
      Specified by:
      item in interface HasItems<HTMLOListElement, ProgressStepper, ProgressStep>
      Parameters:
      identifier - the identifier of the item to be retrieved
      Returns:
      the item associated with the given identifier, or null if 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

      public ProgressStepper setupSteps(BiConsumer<ProgressStep, Integer> stepConsumerWithIndex)
      Applies the provided consumer to each step with its index in insertion order.
      Parameters:
      stepConsumerWithIndex - consumer receiving (step, index)
      Returns:
      this instance
    • updateItem

      public void updateItem(ProgressStep item)
      Description copied from interface: HasItems
      Updates an existing item in the component.
      Specified by:
      updateItem in interface HasItems<HTMLOListElement, ProgressStepper, ProgressStep>
      Parameters:
      item - the item to be updated
    • removeItem

      public void removeItem(String identifier)
      Description copied from interface: HasItems
      Removes an item from the component based on the provided identifier.
      Specified by:
      removeItem in interface HasItems<HTMLOListElement, ProgressStepper, ProgressStep>
      Parameters:
      identifier - the identifier of the item to be removed
    • clear

      public void clear()
      Description copied from interface: HasItems
      Clears 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:
      clear in interface HasItems<HTMLOListElement, ProgressStepper, ProgressStep>