Package io.jmix.flowui.facet.impl
Class AbstractDataLoadCoordinator
java.lang.Object
io.jmix.flowui.facet.impl.AbstractFacet
io.jmix.flowui.facet.impl.AbstractDataLoadCoordinator
- All Implemented Interfaces:
DataLoadCoordinator,Facet
- Direct Known Subclasses:
FragmentDataLoadCoordinatorImpl,ViewDataLoadCoordinatorImpl
public abstract class AbstractDataLoadCoordinator
extends AbstractFacet
implements DataLoadCoordinator
An abstract implementation of the
DataLoadCoordinator interface.
This class is responsible for managing data loading triggers in a UI. It provides
mechanisms to configure triggers and associate them with data loaders, components, or instance containers.
These triggers allow automatic data loading by observing changes in specific sources or events.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.flowui.facet.DataLoadCoordinator
DataLoadCoordinator.LikeClause, DataLoadCoordinator.Trigger -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected static final Patternprotected ReflectionCacheManagerprotected List<DataLoadCoordinator.Trigger> Fields inherited from class io.jmix.flowui.facet.impl.AbstractFacet
id, ownerFields inherited from interface io.jmix.flowui.facet.DataLoadCoordinator
DEFAULT_COMPONENT_PREFIX, DEFAULT_CONTAINER_PREFIX, NAME -
Constructor Summary
ConstructorsConstructorDescriptionAbstractDataLoadCoordinator(ReflectionCacheManager reflectionCacheManager, QueryParamValuesManager queryParamValuesManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOnComponentValueChangedLoadTrigger(DataLoader loader, com.vaadin.flow.component.Component component, @Nullable String param, DataLoadCoordinator.LikeClause likeClause) Adds trigger on visual componentValueChangeEvent.voidaddOnContainerItemChangedLoadTrigger(DataLoader loader, InstanceContainer<?> container, @Nullable String param) Adds trigger on data containerItemChangeEvent.protected abstract voidvoidConfigures triggers automatically relying upon parameter prefixes.protected voidconfigureAutomatically(DataLoader loader) protected booleancontainsLikeClause(Condition condition, String parameter) protected booleancontainsLikeClause(String query, String parameter) protected abstract com.vaadin.flow.component.ComponentfindComponent(String componentId) protected DataLoadCoordinator.LikeClausefindLikeClause(DataLoader loader, String parameter) protected StringfindSingleParam(DataLoader loader) getConditionParameters(DataLoader loader) protected abstract HasDataComponentsprotected com.vaadin.flow.component.Composite<?> Returns configured triggers.protected Stream<DataLoader> protected booleanloaderIsNotConfiguredYet(DataLoader loader) voidsetComponentPrefix(String value) Sets parameter prefix to denote a visual component.voidsetContainerPrefix(String value) Sets parameter prefix to denote a data container.Methods inherited from class io.jmix.flowui.facet.impl.AbstractFacet
getId, getOwner, setId, setOwnerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jmix.flowui.facet.DataLoadCoordinator
addOnViewEventLoadTrigger
-
Field Details
-
LIKE_PATTERN
-
containerPrefix
-
componentPrefix
-
triggers
-
reflectionCacheManager
-
-
Constructor Details
-
AbstractDataLoadCoordinator
public AbstractDataLoadCoordinator(ReflectionCacheManager reflectionCacheManager, QueryParamValuesManager queryParamValuesManager)
-
-
Method Details
-
setContainerPrefix
Description copied from interface:DataLoadCoordinatorSets parameter prefix to denote a data container.- Specified by:
setContainerPrefixin interfaceDataLoadCoordinator
-
setComponentPrefix
Description copied from interface:DataLoadCoordinatorSets parameter prefix to denote a visual component.- Specified by:
setComponentPrefixin interfaceDataLoadCoordinator
-
getTriggers
Description copied from interface:DataLoadCoordinatorReturns configured triggers.- Specified by:
getTriggersin interfaceDataLoadCoordinator
-
addOnContainerItemChangedLoadTrigger
public void addOnContainerItemChangedLoadTrigger(DataLoader loader, InstanceContainer<?> container, @Nullable String param) Description copied from interface:DataLoadCoordinatorAdds trigger on data containerItemChangeEvent.- Specified by:
addOnContainerItemChangedLoadTriggerin interfaceDataLoadCoordinator- Parameters:
loader- loadercontainer- master data containerparam- loader parameter
-
addOnComponentValueChangedLoadTrigger
public void addOnComponentValueChangedLoadTrigger(DataLoader loader, com.vaadin.flow.component.Component component, @Nullable String param, DataLoadCoordinator.LikeClause likeClause) Description copied from interface:DataLoadCoordinatorAdds trigger on visual componentValueChangeEvent.- Specified by:
addOnComponentValueChangedLoadTriggerin interfaceDataLoadCoordinator- Parameters:
loader- loadercomponent- component which must implementHasValueparam- loader parameterlikeClause- whether the condition using the parameter is a LIKE clause
-
configureAutomatically
public void configureAutomatically()Description copied from interface:DataLoadCoordinatorConfigures triggers automatically relying upon parameter prefixes. All data containers that don't have a prefixed parameter in the query string are configured to be triggered onView.BeforeShowEventin case ofViewfacet owner orFragment.ReadyEventin case ofFragmentfacet owner orAttachEvent.- Specified by:
configureAutomaticallyin interfaceDataLoadCoordinator
-
getOwnerData
-
getUnconfiguredLoaders
-
loaderIsNotConfiguredYet
-
configureAutomatically
-
findComponent
-
addOnDefaultEventLoadTrigger
-
containsLikeClause
-
getConditionParameters
-
findSingleParam
-
findLikeClause
-
containsLikeClause
-
getOwnerNN
protected com.vaadin.flow.component.Composite<?> getOwnerNN()
-