All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IGenericComponent<Integer,GenericPanel<Integer>>, IMetadataContext<Serializable,Component>, IQueueRegion, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable
Direct Known Subclasses:
UpdatableProgressBar

public class ProgressBar extends GenericPanel<Integer>
A component for Progress bars
See Also:
  • Field Details

  • Constructor Details

    • ProgressBar

      public ProgressBar(String id)
      Constructor. Creates an empty progress bar. Use addStacks(Stack...) to add stacks to it
      Parameters:
      id - The component id
      See Also:
    • ProgressBar

      public ProgressBar(String id, IModel<Integer> model)
      Constructor. Creates a progress bar with a stack that uses the given model, default type and is not labeled.
      Parameters:
      id - The component id
      model - The model that will be used for the default stack.
      See Also:
    • ProgressBar

      public ProgressBar(String id, IModel<Integer> model, BackgroundColorBehavior.Color color)
      Constructor. Creates a progress bar with a stack that uses the given model, type and is not labeled.
      Parameters:
      id - The component id
      model - The model that will be used for the default stack.
      color - The color of the stack
      See Also:
    • ProgressBar

      public ProgressBar(String id, IModel<Integer> model, boolean labeled)
      Constructor. Creates a progress bar with a stack that uses the given model, default type and it is labeled or not.
      Parameters:
      id - The component id
      model - The model that will be used for the default stack.
      labeled - A flag whether the stack should be labeled or not
      See Also:
    • ProgressBar

      public ProgressBar(String id, IModel<Integer> model, BackgroundColorBehavior.Color color, boolean labeled)
      Constructor. Creates a progress bar with a stack that uses the given model, type and is labeled or not.
      Parameters:
      id - The component id
      model - The model that will be used for the default stack.
      color - The color of the stack
      labeled - A flag whether the stack should be labeled or not
      See Also:
    • ProgressBar

      public ProgressBar(String id, IModel<Integer> model, BackgroundColorBehavior.Color color, boolean labeled, boolean animated, boolean striped)
      Constructor. Creates a progress bar with a stack that uses the given model, type, is labeled or not, is animated or not, is striped or not.
      Parameters:
      id - The component id
      model - The model that will be used for the default stack.
      color - The color of the stack
      labeled - A flag whether the stack should be labeled or not
      animated - A flag indicating whether the stack is active/active.
      striped - A flag indicating whether the stack is striped.
      See Also:
  • Method Details

    • getStackId

      public String getStackId()
      Generates a safe component id for a stack in this progress bar
      Returns:
      a component id for a stack
    • addStacks

      public ProgressBar addStacks(Stack... _stacks)
      Adds stacks to this progress bar.
      Parameters:
      _stacks - The stacks to add
      Returns:
      this instance, for method chaining
    • striped

      public boolean striped()
    • striped

      public ProgressBar striped(boolean value)
    • active

      public boolean active()
    • active

      public ProgressBar active(boolean value)
    • complete

      public final boolean complete()
      Returns whether the progress bar is complete or not. Useful only when used with the default stack, i.e. only when a constructor different than ProgressBar(String) is used!
      Returns:
      true if the progress bar is complete.
    • value

      public ProgressBar value(IModel<Integer> value)
      Sets a new value for the progress. Useful only when used with the default stack, i.e. only when a constructor different than ProgressBar(String) is used!
      Returns:
      this instance, for method chaining.
    • value

      public ProgressBar value(Integer value)
      Sets a new value for the progress. Useful only when used with the default stack, i.e. only when a constructor different than ProgressBar(String) is used!
      Returns:
      this instance, for method chaining.
    • value

      public Integer value()
      Returns the current value of the progress. Useful only when used with the default stack, i.e. only when a constructor different than ProgressBar(String) is used!
      Returns:
      the current value of the progress.
    • onComponentTag

      protected void onComponentTag(ComponentTag tag)
      Overrides:
      onComponentTag in class Component
    • renderHead

      public void renderHead(IHeaderResponse response)
      Specified by:
      renderHead in interface IHeaderContributor
      Overrides:
      renderHead in class Component