Class Wizard.LinearFlow

  • All Implemented Interfaces:
    Wizard.Flow
    Enclosing class:
    Wizard

    public static class Wizard.LinearFlow
    extends Object
    implements Wizard.Flow
    LinearFlow is an implementation of the Wizard.Flow interface, designed to support the most common type of wizard flow - namely, a linear wizard page flow (i.e. through all pages in the order that they are specified). Therefore, this Wizard.Flow implementation simply traverses a collections of WizardPanes.

    For example of how to use this API, please refer to the Wizard documentation

    See Also:
    Wizard, WizardPane
    • Constructor Detail

      • LinearFlow

        public LinearFlow​(Collection<WizardPane> pages)
        Creates a new LinearFlow instance that will allow for stepping through the given collection of WizardPane instances.
      • LinearFlow

        public LinearFlow​(WizardPane... pages)
        Creates a new LinearFlow instance that will allow for stepping through the given varargs array of WizardPane instances.
    • Method Detail

      • advance

        public Optional<WizardPane> advance​(WizardPane currentPage)
        Advances the wizard to the next page if possible.
        Specified by:
        advance in interface Wizard.Flow
        Parameters:
        currentPage - The current wizard page
        Returns:
        Optional value containing the next wizard page.
      • canAdvance

        public boolean canAdvance​(WizardPane currentPage)
        Check if advancing to the next page is possible
        Specified by:
        canAdvance in interface Wizard.Flow
        Parameters:
        currentPage - The current wizard page
        Returns:
        true if it is possible to advance to the next page, false otherwise.