Class VProgressBar

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.progressbar.ProgressBar
org.vaadin.firitin.components.progressbar.VProgressBar
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasTheme, com.vaadin.flow.component.shared.HasThemeVariant<com.vaadin.flow.component.progressbar.ProgressBarVariant>, Serializable, FluentAttachNotifier<VProgressBar>, FluentComponent<VProgressBar>, FluentDetachNotifier<VProgressBar>, FluentHasSize<VProgressBar>, FluentHasStyle<VProgressBar>

public class VProgressBar extends com.vaadin.flow.component.progressbar.ProgressBar implements FluentComponent<VProgressBar>, FluentHasSize<VProgressBar>, FluentHasStyle<VProgressBar>
See Also:
  • Constructor Details

    • VProgressBar

      public VProgressBar()
    • VProgressBar

      public VProgressBar(double min, double max)
    • VProgressBar

      public VProgressBar(double min, double max, double value)
  • Method Details

    • indeterminateForTask

      public static VProgressBar indeterminateForTask(Runnable task)
      Creates a progressbar that is visible in the UI until the given the long(ish) running task has been executed. The progressbar will be added (and rendered) to the UI and then the task will be executed in the UI thread. Once the task is done, the progress indicator will automatically be removed. The progress indicator provided by the framework is hidden during the taask. Note that the UI will be blocked during the execution, so for really long tasks where you expect users to be able to continue working with other features in the UI, this helper is not the way to go. See UIFuture.
      Parameters:
      task - the task to be finished before the returned progressbar will be vanished
      Returns:
      the progressbar to be added to UI
    • indeterminateForTask

      public static VProgressBar indeterminateForTask(com.vaadin.flow.function.SerializableSupplier<com.vaadin.flow.component.Component> task)
      Creates a progressbar that is visible in the UI until the given the long(ish) running task has been executed. The progressbar will be added (and rendered) to the UI and then the task will be executed in the UI thread. Once the task is done, the progress indicator will automatically be removed and replaced with the component returned by the task. The progress indicator provided by the framework is hidden during the taask. Note that the UI will be blocked during the execution, so for really long tasks where you expect users to be able to continue working with other features in the UI, this helper is not the way to go. See UIFuture.
      Parameters:
      task - the task to be finished before the returned progressbar will be vanished
      Returns:
      the progressbar to be added to UI
    • withValue

      public VProgressBar withValue(double value)
    • withMax

      public VProgressBar withMax(double max)
    • withMin

      public VProgressBar withMin(double min)
    • withThemeVariants

      public VProgressBar withThemeVariants(com.vaadin.flow.component.progressbar.ProgressBarVariant... variants)
    • animateToEstimate

      public void animateToEstimate(LocalDateTime startOfProgress, LocalDateTime estimatedEndOfProgress)
      Runs a client side animation between the given LocalDateTimes. The animation starts from now and ends at the given estimated end time. The progressbar will be set to indeterminate mode if the estimate is passed.

      You can use #finish() to stop the animation and set the progress to 100%.

      Parameters:
      startOfProgress - the time when the progress has started
      estimatedEndOfProgress - the time when the progress is estimated to end
    • animateToEstimate

      public void animateToEstimate()
      Runs a client side animation to the ProgressBar.getMax() value as "milliseconds". If you for example expect your progress to take around 5000ms, use 5000 as max value. The progress animation will slow down in the end of the progressbar, so it doesn't matter if your estimate is slightly optimistic. If the estimate is passed a lot, the progressbar will switch to indeterminate mode.
    • finish

      public void finish()
    • isPrepareForOverdueInAnimation

      public boolean isPrepareForOverdueInAnimation()
    • setPrepareForOverdueInAnimation

      public VProgressBar setPrepareForOverdueInAnimation(boolean prepareForOverdueInAnimation)