Class VLoadingIndicator


  • public class VLoadingIndicator
    extends Object
    Class representing the loading indicator for Vaadin applications. The loading indicator has four states: "triggered", "first", "second" and "third". When trigger() is called the indicator moves to its "triggered" state and then transitions from one state to the next when the timeouts specified using the set*StateDelay methods occur.
    Since:
    7.1
    Author:
    Vaadin Ltd
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void ensureTriggered()
      Triggers displaying of this loading indicator unless it's already visible or scheduled to be shown after a delay.
      ApplicationConnection getConnection()
      Returns the ApplicationConnection which uses this loading indicator
      com.google.gwt.user.client.Element getElement()
      Returns the root element of the loading indicator
      int getFirstDelay()
      Returns the delay (in ms) which must pass before the loading indicator moves into the "first" state and is shown to the user
      int getSecondDelay()
      Returns the delay (in ms) which must pass before the loading indicator moves to its "second" state.
      int getThirdDelay()
      Returns the delay (in ms) which must pass before the loading indicator moves to its "third" state.
      void hide()
      Hides the loading indicator (if visible).
      boolean isVisible()
      Returns whether or not the loading indicator is showing.
      void setFirstDelay​(int firstDelay)
      Sets the delay (in ms) which must pass before the loading indicator moves into the "first" state and is shown to the user
      void setSecondDelay​(int secondDelay)
      Sets the delay (in ms) which must pass before the loading indicator moves to its "second" state.
      void setThirdDelay​(int thirdDelay)
      Sets the delay (in ms) which must pass before the loading indicator moves to its "third" state.
      void show()
      Shows the loading indicator in its standard state and triggers timers for transitioning into the "second" and "third" states.
      void trigger()
      Triggers displaying of this loading indicator.
    • Constructor Detail

      • VLoadingIndicator

        public VLoadingIndicator()
    • Method Detail

      • getFirstDelay

        public int getFirstDelay()
        Returns the delay (in ms) which must pass before the loading indicator moves into the "first" state and is shown to the user
        Returns:
        The delay (in ms) until moving into the "first" state. Counted from when trigger() is called.
      • setFirstDelay

        public void setFirstDelay​(int firstDelay)
        Sets the delay (in ms) which must pass before the loading indicator moves into the "first" state and is shown to the user
        Parameters:
        firstDelay - The delay (in ms) until moving into the "first" state. Counted from when trigger() is called.
      • getSecondDelay

        public int getSecondDelay()
        Returns the delay (in ms) which must pass before the loading indicator moves to its "second" state.
        Returns:
        The delay (in ms) until the loading indicator moves into its "second" state. Counted from when trigger() is called.
      • setSecondDelay

        public void setSecondDelay​(int secondDelay)
        Sets the delay (in ms) which must pass before the loading indicator moves to its "second" state.
        Parameters:
        secondDelay - The delay (in ms) until the loading indicator moves into its "second" state. Counted from when trigger() is called.
      • getThirdDelay

        public int getThirdDelay()
        Returns the delay (in ms) which must pass before the loading indicator moves to its "third" state.
        Returns:
        The delay (in ms) until the loading indicator moves into its "third" state. Counted from when trigger() is called.
      • setThirdDelay

        public void setThirdDelay​(int thirdDelay)
        Sets the delay (in ms) which must pass before the loading indicator moves to its "third" state.
        Parameters:
        thirdDelay - The delay (in ms) from the event until changing the loading indicator into its "third" state. Counted from when trigger() is called.
      • trigger

        public void trigger()
        Triggers displaying of this loading indicator. The loading indicator will actually be shown by show() when the "first" delay (as specified by getFirstDelay()) has passed.

        The loading indicator will be hidden if shown when calling this method.

      • ensureTriggered

        public void ensureTriggered()
        Triggers displaying of this loading indicator unless it's already visible or scheduled to be shown after a delay.
        Since:
        7.4
      • show

        public void show()
        Shows the loading indicator in its standard state and triggers timers for transitioning into the "second" and "third" states.
      • hide

        public void hide()
        Hides the loading indicator (if visible). Cancels any possibly running timers.
      • isVisible

        public boolean isVisible()
        Returns whether or not the loading indicator is showing.
        Returns:
        true if the loading indicator is visible, false otherwise
      • getElement

        public com.google.gwt.user.client.Element getElement()
        Returns the root element of the loading indicator
        Returns:
        The loading indicator DOM element