Package com.vaadin.client.communication
Class LoadingIndicatorStateHandler
java.lang.Object
com.vaadin.client.communication.LoadingIndicatorStateHandler
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 Summary
ConstructorsConstructorDescriptionLoadingIndicatorStateHandler(Registry registry) Creates a new instance connected to the given registry. -
Method Summary
Modifier and TypeMethodDescriptionvoidprocessMessage(String rpcType, String eventType) Processes an RPC message to determine if a loading indicator should be displayed.voidUpdates the connection state toConnectionIndicator.LOADINGwhen a non-silent request starts.voidUpdates the connection state toConnectionIndicator.CONNECTEDwhen active requests finish.
-
Constructor Details
-
LoadingIndicatorStateHandler
Creates a new instance connected to the given registry.- Parameters:
registry- the global registry
-
-
Method Details
-
startLoading
public void startLoading()Updates the connection state toConnectionIndicator.LOADINGwhen a non-silent request starts. -
stopLoading
public void stopLoading()Updates the connection state toConnectionIndicator.CONNECTEDwhen active requests finish. -
processMessage
Processes an RPC message to determine if a loading indicator should be displayed.- Parameters:
rpcType- the type of RPC request being processedeventType- for event RPC requests, the name of the event, otherwisenull
-