Class GuideFlow

All Implemented Interfaces:
EventEmitterInterface, EventListener

public class GuideFlow extends EventEmitter implements EventListener
  • Field Details

  • Constructor Details

    • GuideFlow

      public GuideFlow(Supplier<GuidePanelAdapter> adapterSupplier)
      Constructs a new GuideFlow with the given adapter supplier.
      Parameters:
      adapterSupplier - A supplier that provides instances of GuidePanelAdapter.
  • Method Details

    • add

      public GuideFlow add(GuideInfo guideInfo)
      Adds a GuideInfo to the flow.
      Parameters:
      guideInfo - The guide information to add.
      Returns:
      This GuideFlow instance for method chaining.
    • back

      public void back()
    • start

      public void start()
      Starts the guide flow by displaying the first guide in the queue. If no guides are present, it shows a message dialog. It attaches listeners to the current guide and builds its UI.
    • finished

      public boolean finished()
      Checks if all guides in the flow have been processed.
      Returns:
      true if there are no more guides to show, false otherwise.
    • indexOf

      public int indexOf(GuideInfo i)
      Returns the index of a given GuideInfo within the set of all guides ever processed.
      Parameters:
      i - The GuideInfo to find the index of.
      Returns:
      The zero-based index of the guide, or -1 if the guide is not found.
    • totalSize

      public int totalSize()
      Returns the total number of guides that were initially added to this flow.
      Returns:
      The total count of guides.
    • onEvent

      public <K> void onEvent(EventType event, EventPayload<K> properties)
      Handles events, specifically EventType.GUIDE_CLOSING to advance the guide flow.
      Specified by:
      onEvent in interface EventListener
      Type Parameters:
      K - The type of the emitter of this event
      Parameters:
      event - The type of the event.
      properties - The payload containing event-specific data.