Class DefaultStepModel<E>

  • All Implemented Interfaces:
    StepModel<E>

    public class DefaultStepModel<E>
    extends java.lang.Object
    implements StepModel<E>
    A simple step data model that uses Step to represent a stepbar.
    Since:
    9.0.0
    Author:
    jameschu
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int index, E item)
      Adds a step at the end.
      void add​(E item)
      Adds a step at the end.
      boolean back()
      Activate previous step if possible.
      int getActiveIndex()
      Return the index of the active step.
      E getActiveStep()
      Return the active step.
      ListModel<E> getSteps()
      Returns the step list model.
      boolean next()
      Activate next step if possible.
      E remove​(int index)
      Removes the step at the specified position in this list (optional operation).
      boolean remove​(E item)
      Removes the first occurrence of the specified step from this list, if it is present (optional operation).
      void setActiveIndex​(int index)
      Sets the index of the active step.
      void setActiveStep​(E item)
      Sets the active step.
      int size()
      Returns the length of the step list.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultStepModel

        public DefaultStepModel()
      • DefaultStepModel

        public DefaultStepModel​(ListModelList<E> steps)
    • Method Detail

      • back

        public boolean back()
        Description copied from interface: StepModel
        Activate previous step if possible.
        Specified by:
        back in interface StepModel<E>
        Returns:
        can activate to step component or not.
      • next

        public boolean next()
        Description copied from interface: StepModel
        Activate next step if possible.
        Specified by:
        next in interface StepModel<E>
        Returns:
        can activate to previous component or not.
      • getActiveIndex

        public int getActiveIndex()
        Description copied from interface: StepModel
        Return the index of the active step.

        Default: 0.

        Specified by:
        getActiveIndex in interface StepModel<E>
        Returns:
        the index of the active step.
      • getActiveStep

        public E getActiveStep()
        Description copied from interface: StepModel
        Return the active step.

        Default: first step.

        Specified by:
        getActiveStep in interface StepModel<E>
        Returns:
        the active step.
      • setActiveIndex

        public void setActiveIndex​(int index)
        Description copied from interface: StepModel
        Sets the index of the active step.
        Specified by:
        setActiveIndex in interface StepModel<E>
        Parameters:
        index - the index of the active step.
      • setActiveStep

        public void setActiveStep​(E item)
        Description copied from interface: StepModel
        Sets the active step.
        Specified by:
        setActiveStep in interface StepModel<E>
        Parameters:
        item - the active step.
      • add

        public void add​(E item)
        Description copied from interface: StepModel
        Adds a step at the end.
        Specified by:
        add in interface StepModel<E>
      • add

        public void add​(int index,
                        E item)
        Description copied from interface: StepModel
        Adds a step at the end. Inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
        Specified by:
        add in interface StepModel<E>
      • remove

        public E remove​(int index)
        Description copied from interface: StepModel
        Removes the step at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the step that was removed from the list.
        Specified by:
        remove in interface StepModel<E>
        Returns:
        step
      • remove

        public boolean remove​(E item)
        Description copied from interface: StepModel
        Removes the first occurrence of the specified step from this list, if it is present (optional operation). If this list does not contain the step, it is unchanged.
        Specified by:
        remove in interface StepModel<E>
        Returns:
        remove result
      • size

        public int size()
        Description copied from interface: StepModel
        Returns the length of the step list.
        Specified by:
        size in interface StepModel<E>
        Returns:
        steps