Class WizardStep

All Implemented Interfaces:
Animatable<WizardStep>, CanDrop<WizardStep>, Clickable<WizardStep>, Draggable<WizardStep>, HandleMouseEvents<WizardStep>, Scrollable<WizardStep>, Touchable<WizardStep>

Wizard step component

The component is not a standalone component, it is used by the Wizard. The component represents a wizard step. You can use it to create components and forms, fill them with data, set them and add them to a wizard step. The step is displayed and managed by the wizard component.

The step component has its own events implemented. The events handlers are associated with the events “leave step”, “show step” and “proceed to next one”. Event handlers enable you to validate the data entered by the user or to cancel navigation. If the user enters incorrect data, you can cancel navigation and the user is unable to leave the step until correct data is entered.

Supported events:

AnimationStart AnimationEnd, Click, DoubleClick, MouseDown, MouseDown, MouseLeave, MouseMove, MouseOver, MouseOut, MouseUp, Wheel, Scrollable TouchCancel, TouchEnd, TouchMove, TouchStart, Drop, DragStart, DragEnd BackHandler NextHandler ShowHandler LeaveHandler InitHandler

Since:
4.0
Author:
JBStrap
See Also:
  • Constructor Details

    • WizardStep

      public WizardStep(String name)
      Creates a wizard step with the specified name.
      Parameters:
      name - Wizard step name, must be unique within the Wizard
      Throws:
      NullPointerException - Thrown if the specified name is null
    • WizardStep

      public WizardStep(String name, Icon icon)
      Creates a wizard step with the specified name and icon.
      Parameters:
      name - Wizard step name, must be unique within the Wizard
      icon - Wizard step icon displayed in the header Available icons are listed in the enum Icon. If not specified or set to null, no step icon is displayed.
      Throws:
      NullPointerException - Thrown if the specified name is null
    • WizardStep

      public WizardStep(String name, Icon icon, String title)
      Creates a wizard step with the specified name, icon and title.
      Parameters:
      name - Wizard step name, must be unique within the Wizard
      icon - Wizard step icon displayed in the header Available icons are listed in the enum Icon. If not specified or set to null, no step icon is displayed.
      title - Wizard step title, displayed when the user hovers with the mouse over the step icon If not specified or set to null, no step title is displayed
      Throws:
      NullPointerException - Thrown if the specified name is null
    • WizardStep

      public WizardStep(String name, Icon icon, String title, String description)
      Creates a wizard step with the specified name, icon, title and description.
      Parameters:
      name - Wizard step name, must be unique within the Wizard
      icon - Wizard step icon displayed in the header Available icons are listed in the enum Icon. If not specified or set to null, no step icon is displayed.
      title - Wizard step title, displayed when the user hovers with the mouse over the step icon If null is displayed, no step title is displayed.
      description - Step description The description specified here is displayed if the user hovers with the mouse over the step icon. If not specified or set to null, no step description is displayed.
      Throws:
      NullPointerException - Thrown if the specified name is null
    • WizardStep

      public WizardStep(String name, Icon icon, String title, String description, Component<?>... content)
      Creates a wizard step with the specified name, icon, title and description; adds components to the step.
      Parameters:
      name - Wizard step name, must be unique within the Wizard
      icon - Wizard step icon displayed in the header Available icons are listed in the enum Icon. If not specified or set to null, no wizard step is displayed.
      title - Wizard step title, displayed when the user hovers with the mouse over the step icon If not specified or null, no step title is displayed.
      description - Step description The description specified here is displayed if the user hovers with the mouse over the step icon. If not specified or set to null, no step description is displayed.
      content - An enumeration of all components to be added to the step Components are added to the step following the order of this enumeration.
      Throws:
      NullPointerException - Thrown if the specified name is null
  • Method Details

    • getIcon

      public final Icon getIcon()
      Gets the step icon.
      Returns:
      Step icon or null if no icon is specified
    • setIcon

      public final WizardStep setIcon(Icon icon)
      Sets the step icon.
      Parameters:
      icon - Step icon Available icons are listed in the enum Icon. If null is specified, no step icon is displayed.
      Returns:
      Wizard step
    • getName

      public final String getName()
      Gets the wizard step name.
      Overrides:
      getName in class Component<WizardStep>
      Returns:
      Wizard step name
    • getTitle

      public final String getTitle()
      Gets the wizard step title.
      Returns:
      Step title or null if no title is specified
    • setTitle

      public final WizardStep setTitle(String title)
      Specifies the wizard step title. The title specified here is displayed if the user hovers with the mouse over the icon.
      Parameters:
      title - Step title * If null is specified, no step title is displayed.
      Returns:
      Wizard step
    • getDescription

      public final String getDescription()
      Gets the step icon.
      Returns:
      Step description or null if no title is specified
    • setDescription

      public final WizardStep setDescription(String description)
      Sets the step description. The description specified here is displayed if the user hovers with the mouse over the icon.
      Parameters:
      description - Step description If null is specified, no step description is displayed.
      Returns:
      Wizard step
    • getIconComponent

      protected Component<?> getIconComponent()
      Returns:
      Icon component
    • getIndex

      public final int getIndex()
      Gets the step index.
      Returns:
      Step index within the wizard component Start index is 0. If the wizard step is not added to a component, the index has a value of -1.
    • setIndex

      protected WizardStep setIndex(int index)
      Parameters:
      index - Step index If the step is removed from the wizard component, it must be set to -1.
      Returns:
      Wizard step
    • setParent

      protected WizardStep setParent(Wizard parent)
      Parameters:
      parent - Wizard component instance associated with the step
      Returns:
      Wizard step
    • setState

      public final WizardStep setState(WizardStepState state)
      Parameters:
      state - Step state Available states are listed in the enum WizardStepState.
      Returns:
      Wizard step
    • setActive

      protected WizardStep setActive(boolean active)
      Parameters:
      active - If true, the step is designated enabled, otherwise not
      Returns:
      Wizard step
    • getState

      public final WizardStepState getState()
      Gets the current step state.
      Returns:
      Current step state
      See Also:
    • setNextHandler

      public final WizardStep setNextHandler(StepNextHandler handler)
      Sets the event handler for the “Next” button.
      Parameters:
      handler - Event handler implementation for the “next step” event
      Returns:
      Wizard step
      See Also:
    • getNextHandler

      public final StepNextHandler getNextHandler()
      Gets the next step event handler.
      Returns:
      An instance of the “next step” event or null if no “next step” event handler is set
    • setBackHandler

      public final WizardStep setBackHandler(StepBackHandler handler)
      Sets the event handler for the “previous step” event.
      Parameters:
      handler - Event handler implementation for the “previous step” event
      Returns:
      Wizard step
      See Also:
    • getBackHandler

      public final StepBackHandler getBackHandler()
      Gets the event handler for the “previous step” event.
      Returns:
      An instance of the “previous step” event handler or null if no “previous step” event handler is set
    • setLeaveHandler

      public final WizardStep setLeaveHandler(StepLeaveHandler handler)
      Sets the event handler for the “leave step” event.
      Parameters:
      handler - Event handler implementation for the “leave step” event
      Returns:
      Wizard step
      See Also:
    • getLeaveHandler

      public final StepLeaveHandler getLeaveHandler()
      Gets the event handler for the “leave step” event.
      Returns:
      Event handler instance or null if no “leave step” event is specified for the step
    • setShowHandler

      public final WizardStep setShowHandler(StepShowHandler handler)
      Sets the event handler for the “show step” event.
      Parameters:
      handler - Event handler implementation for the “show step” event
      Returns:
      Wizard step
      See Also:
    • getShowHandler

      public final StepShowHandler getShowHandler()
      Gets the event handler for the “show step” event.
      Returns:
      Event handler instance or null if no “show step” event is specified for the step
    • setInitHandler

      public final WizardStep setInitHandler(StepInitHandler handler)
      Sets the event handler for the “initialize step” event.
      Parameters:
      handler - Event handler implementation for the “initialize step” event
      Returns:
      Wizard step
      See Also:
    • getInitHandler

      public final StepInitHandler getInitHandler()
      Gets the event handler for the “initialize step” event.
      Returns:
      Event handler instance or null if no “initialize step” event is specified for the step
    • setEnabled

      public WizardStep setEnabled(boolean enabled)
      Enabling/disabling the step. By default, the step is enabled. If a step is disabled, the user is unable to select the it either by using the header or the navigation buttons. Upon using the navigation buttons, the wizard component skips the disabled steps.
      Overrides:
      setEnabled in class Component<WizardStep>
      Parameters:
      enabled - If true is set, the step is enabled. If false is specified, the step is disabled.
      Returns:
      Wizard step
    • isEnabled

      public boolean isEnabled()
      Checks if the step is enabled.
      Overrides:
      isEnabled in class Component<WizardStep>
      Returns:
      If true is set, the step is enabled. * If false is specified, the step is disabled.
    • writeHTML

      public boolean writeHTML(StringWriter writer)
      Description copied from class: Component
      Creates the component's HTML equivalent

      This method doesn't need to be used during application development. This method is used when developing a custom component. When creating a custom component, this method needs to be implemented. In the parameter (StringWriter class) the component's HTML equivalent must be specified, and the method has to return with a Boolean value. This boolean value determines if the component was drawn. If the user doesn't have access right to the component, or if the component couldn't be drawn, it should return with false. Otherwise, it must return with true.

      Specified by:
      writeHTML in class Component<WizardStep>
      Returns:
      If the componentwas drawn, true, otherwise false