Class LoadingIndicatorStateHandler

java.lang.Object
com.vaadin.client.communication.LoadingIndicatorStateHandler

public class LoadingIndicatorStateHandler extends Object
Manages the state of loading indicator based on active RPC requests, event types, and lifecycle events.

This class ensures appropriate visual feedback (e.g., loading bar) is shown or hidden according to the current network conditions and request status. It is responsible for muting the loading indication when RPC requests are triggered by high-frequency UI events (mousemove and such) to avoid excessive visual noise in these cases.

  • Constructor Details

    • LoadingIndicatorStateHandler

      public LoadingIndicatorStateHandler(Registry registry)
      Creates a new instance connected to the given registry.
      Parameters:
      registry - the global registry
  • Method Details

    • startLoading

      public void startLoading()
      Updates the connection state to ConnectionIndicator.LOADING when a non-silent request starts.
    • stopLoading

      public void stopLoading()
      Updates the connection state to ConnectionIndicator.CONNECTED when active requests finish.
    • processMessage

      public void processMessage(String rpcType, String eventType)
      Processes an RPC message to determine if a loading indicator should be displayed.
      Parameters:
      rpcType - the type of RPC request being processed
      eventType - for event RPC requests, the name of the event, otherwise null