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 Summary

    Constructors
    Constructor
    Description
     
    VProgressBar(double min, double max)
     
    VProgressBar(double min, double max, double value)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Runs a client side animation to the ProgressBar.getMax() value as "milliseconds".
    void
    animateToEstimate(LocalDateTime startOfProgress, LocalDateTime estimatedEndOfProgress)
    Runs a client side animation between the given LocalDateTimes.
    void
     
    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.
    Creates a progressbar that is visible in the UI until the given the long(ish) running task has been executed.
    boolean
     
    setPrepareForOverdueInAnimation(boolean prepareForOverdueInAnimation)
     
    withMax(double max)
     
    withMin(double min)
     
    withThemeVariants(com.vaadin.flow.component.progressbar.ProgressBarVariant... variants)
     
    withValue(double value)
     

    Methods inherited from class com.vaadin.flow.component.progressbar.ProgressBar

    getMax, getMin, getValue, isIndeterminate, setIndeterminate, setMax, setMin, setValue

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface org.vaadin.firitin.fluency.ui.FluentAttachNotifier

    withAttachListener

    Methods inherited from interface org.vaadin.firitin.fluency.ui.FluentComponent

    setId, setVisible, withId, withVisible

    Methods inherited from interface org.vaadin.firitin.fluency.ui.FluentDetachNotifier

    withDetachListener

    Methods inherited from interface org.vaadin.firitin.fluency.ui.FluentHasStyle

    withAddedClassName, withClassName, withStyle

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasSize

    getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName

    Methods inherited from interface com.vaadin.flow.component.HasTheme

    addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName

    Methods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant

    addThemeVariants, removeThemeVariants
  • 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)