Class Spinner

All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsRenderable, IsWidget

public class Spinner extends Composite
Small CSS-driven spinner widget with optional delayed activation.
  • Field Details

    • STYLE_NAME

      private static final String STYLE_NAME
      Base style of the spinner widget.
      See Also:
    • STYLE_ACTIVE

      private static final String STYLE_ACTIVE
      Style added while the spinner should be visible.
      See Also:
    • SPINNER_HTML

      private static final String SPINNER_HTML
      HTML structure for the CSS-only spinner.
      See Also:
    • delay

      private int delay
      Delay in milliseconds before the spinner becomes visible.
    • spinning

      private boolean spinning
      true while spinning has been requested.
    • visible

      private boolean visible
      true while the spinner is currently visible.
    • showTimer

      private final Timer showTimer
      Timer to defer showing the spinner for short-lived tasks.
  • Constructor Details

    • Spinner

      public Spinner()
      Create a new spinner widget.
  • Method Details

    • onLoad

      protected void onLoad()
      Overrides:
      onLoad in class Widget
    • setDelay

      public void setDelay(int delay)
      Set the activation delay in milliseconds.
      Parameters:
      delay - the delay before showing the spinner
    • setSpinning

      public void setSpinning(boolean spinning)
      Set whether the spinner should be spinning.
      Parameters:
      spinning - true to start spinning
    • show

      private void show()
      Show the spinner.
    • hide

      private void hide()
      Hide the spinner.