Class AbstractDataCountEvent
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DataCountEndedEvent,DataCountFailedEvent,DataCountStartedEvent
A flat component issues one count query per level reload. A hierarchical component issues one per expanded parent, so several count events for one component within a single request is the signature of an expensive hierarchy.
The events carry only plain values and the resolved Component, never
the query or the data provider, so that observers cannot retain or mutate
loading state.
This type cannot be listened for. The
service event bus dispatches by exact
runtime type, so a listener registered for this class is never notified;
register for DataCountStartedEvent, DataCountFailedEvent or
DataCountEndedEvent instead.
- Since:
- 25.3
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractDataCountEvent(UI ui, Component component, boolean filtered) Creates a new count event. -
Method Summary
Modifier and TypeMethodDescriptionGets the component whose data is being counted, so that an observer can attribute the query to aGrid,ComboBoxorTreeGridrather than only to the request.Gets the UI from which this event originates.getUI()Gets the UI from which this event originates.booleanTells whether a filter was set on the query, which distinguishes a combo box counting matches for what the user typed from one counting the whole data set.Methods inherited from class java.util.EventObject
toString
-
Constructor Details
-
AbstractDataCountEvent
Creates a new count event.- Parameters:
ui- the UI the counting component belongs to, notnullcomponent- the component whose data is being counted, ornullif it could not be resolvedfiltered- whether a filter was set on the query
-
-
Method Details
-
getSource
Gets the UI from which this event originates.- Overrides:
getSourcein classEventObject- Returns:
- the UI, never
null
-
getUI
Gets the UI from which this event originates.- Returns:
- the UI, never
null
-
getComponent
Gets the component whose data is being counted, so that an observer can attribute the query to aGrid,ComboBoxorTreeGridrather than only to the request.Empty when the component could not be resolved from the state node, for example when the data communicator is driven by a bare element.
- Returns:
- the component, or an empty optional
-
isFiltered
public boolean isFiltered()Tells whether a filter was set on the query, which distinguishes a combo box counting matches for what the user typed from one counting the whole data set.- Returns:
trueif the query carried a filter
-