Class ProgressBar

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.progressbar.ProgressBar
All Implemented Interfaces:
AttachNotifier, DetachNotifier, HasElement, HasSize, HasStyle, HasTheme, HasThemeVariant<ProgressBarVariant>, Serializable

@Tag("vaadin-progress-bar") @NpmPackage(value="@vaadin/progress-bar", version="25.1.0-alpha7") @JsModule("@vaadin/progress-bar/src/vaadin-progress-bar.js") public class ProgressBar extends Component implements HasSize, HasStyle, HasThemeVariant<ProgressBarVariant>
Progress Bar shows the completion status of a task or process. The progress can be determinate or indeterminate. Use Progress Bar to show an ongoing process that takes a noticeable time to finish.
Author:
Vaadin Ltd.
See Also:
  • Constructor Details

    • ProgressBar

      public ProgressBar()
      Constructs a new object with a scale of 0 to 1, and an initial value of 0.
    • ProgressBar

      public ProgressBar(double min, double max)
      Constructs a new object with a scale of min to max, and an initial value of min.

      min must be less than max.

      Parameters:
      min - the low end of the scale of progress
      max - the high end of the scale of progress
      Throws:
      IllegalArgumentException - if min is not less than max
    • ProgressBar

      public ProgressBar(double min, double max, double value)
      Constructs a new object with a scale of min to max, and an initial value of value.

      min must be less than max, and value must be between min and max (inclusive).

      Parameters:
      min - the low end of the scale of progress
      max - the high end of the scale of progress
      value - the initial value
      Throws:
      IllegalArgumentException - if min is not less than max, or value is not between min and max
  • Method Details

    • setValue

      public void setValue(double value)
      Sets value to the progressbar.
      Parameters:
      value - the double value to set
    • getValue

      public double getValue()
      Gets the current value of the progressbar
      Returns:
      the value property of the progressbar
    • bindValue

      public void bindValue(Signal<Double> signal)
      Binds the given signal to the value of the progressbar as a one-way binding so that the property is updated when the signal's value is updated.

      When a signal is bound, the value is kept synchronized with the signal value while the component is attached. When the component is detached, signal value changes have no effect.

      While a signal is bound, any attempt to set the value manually through setValue(double) throws a BindingActiveException.

      Parameters:
      signal - the signal to bind the value to, not null
      Since:
      25.1
      See Also:
    • setMax

      public void setMax(double max)
      Sets the maximum bound of the progressbar.
      Parameters:
      max - the double value to set
    • getMax

      public double getMax()
      Gets the maximum bound of the progressbar.
      Returns:
      the max property of the progressbar
    • setMin

      public void setMin(double min)
      Sets the minimum bound of the progressbar
      Parameters:
      min - the double value to set
    • getMin

      public double getMin()
      Gets the minimum bound of the progressbar.
      Returns:
      the min property of the progressbar
    • bindMin

      public void bindMin(Signal<Double> signal)
      Binds the given signal to the minimum bound of the progressbar.

      When a signal is bound, the minimum bound is kept synchronized with the signal value while the component is attached. When the component is detached, signal value changes have no effect.

      While a signal is bound, any attempt to set the minimum bound manually through setMin(double) throws a BindingActiveException.

      Parameters:
      signal - the signal to bind the minimum bound to, not null
      Since:
      25.1
      See Also:
    • bindMax

      public void bindMax(Signal<Double> signal)
      Binds the given signal to the maximum bound of the progressbar.

      When a signal is bound, the maximum bound is kept synchronized with the signal value while the component is attached. When the component is detached, signal value changes have no effect.

      While a signal is bound, any attempt to set the maximum bound manually through setMax(double) throws a BindingActiveException.

      Parameters:
      signal - the signal to bind the maximum bound to, not null
      Since:
      25.1
      See Also:
    • setIndeterminate

      public void setIndeterminate(boolean indeterminate)
      Indeterminate state of the progressbar. This property takes precedence over other state properties (min, max, value).
      Parameters:
      indeterminate - the boolean value to set
    • isIndeterminate

      public boolean isIndeterminate()
      Get the indeterminate state of the progressbar

      This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

      Returns:
      the indeterminate property of the progressbar