Class DynamicViewBehaviorManager
java.lang.Object
io.jmix.dynmodelflowui.impl.behavior.DynamicViewBehaviorManager
@NullMarked
@Component("dynmod_DynamicViewBehaviorManager")
public class DynamicViewBehaviorManager
extends Object
Attaches declared behavior handlers when a view with handlers is initialized, and executes
them through the sandboxed evaluator.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.beans.factory.ObjectProvider<Dialogs> protected EntityStatesprotected DynamicViewHandlerEvaluatorprotected static final Stringprotected final Map<String, List<DynamicViewHandlerDefinition>> protected Messagesprotected org.springframework.beans.factory.ObjectProvider<Notifications> protected DynamicModelOperationRegistryprotected org.springframework.beans.factory.ObjectProvider<ViewNavigators> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidattachClickHandlers(View<?> view, String viewId, String componentId, List<DynamicViewHandlerDefinition> handlers, DynamicViewHandlerContext context) protected voidattachHandlers(View<?> view, String viewId, List<DynamicViewHandlerDefinition> handlers, DynamicViewHandlerContext context) protected voidattachInitEntityHandlers(View<?> view, String viewId, List<DynamicViewHandlerDefinition> handlers, DynamicViewHandlerContext context) protected voidattachValueChangeHandlers(View<?> view, String viewId, String componentId, List<DynamicViewHandlerDefinition> handlers, DynamicViewHandlerContext context) protected DynamicViewHandlerContextcreateContext(View<?> view, String viewId, List<DynamicViewHandlerDefinition> handlers) protected Stringdescribe(DynamicViewHandlerDefinition handler) protected voidexecute(String viewId, DynamicViewHandlerDefinition handler, DynamicViewHandlerContext context, DynamicViewEvent event) protected voidexecuteAll(String viewId, List<DynamicViewHandlerDefinition> handlers, DynamicViewHandlerContext context, DynamicViewEvent event) protected voidexecuteAllForEntity(String viewId, List<DynamicViewHandlerDefinition> handlers, DynamicViewHandlerContext context, @Nullable Object entity) protected voidinvokeNamedHandler(String viewId, List<DynamicViewHandlerDefinition> handlers, DynamicViewHandlerContext context, String handlerName) voidvoidprotected voidrebuild(DynamicModelDefinition modelDefinition) voidreset()protected @Nullable StringresolveEffectiveViewId(String entityName, DynamicViewDefinition viewDefinition) Resolves the effective view id under which the view is registered, mirroringDynamicViewDeployer.resolveViewId.protected @Nullable ObjectresolveEntity(View<?> view)
-
Field Details
-
HANDLER_FAILED_MESSAGE
- See Also:
-
evaluator
-
operationRegistry
-
notificationsProvider
@Autowired protected org.springframework.beans.factory.ObjectProvider<Notifications> notificationsProvider -
dialogsProvider
-
messages
-
entityStates
-
handlersByViewId
-
-
Constructor Details
-
DynamicViewBehaviorManager
public DynamicViewBehaviorManager()
-
-
Method Details
-
onDynamicModelApplied
-
reset
public void reset() -
rebuild
-
resolveEffectiveViewId
protected @Nullable String resolveEffectiveViewId(String entityName, DynamicViewDefinition viewDefinition) Resolves the effective view id under which the view is registered, mirroringDynamicViewDeployer.resolveViewId. WhenviewIdis omitted, the deployer derives it from the entity name and view type, so the same derivation must be applied here for handler lookup byview.getId()to succeed.- Returns:
- the effective view id, or
nullwhen it cannot be resolved from the definition alone
-
onViewInitialized
-
createContext
protected DynamicViewHandlerContext createContext(View<?> view, String viewId, List<DynamicViewHandlerDefinition> handlers) -
resolveEntity
-
attachHandlers
protected void attachHandlers(View<?> view, String viewId, List<DynamicViewHandlerDefinition> handlers, DynamicViewHandlerContext context) -
attachInitEntityHandlers
protected void attachInitEntityHandlers(View<?> view, String viewId, List<DynamicViewHandlerDefinition> handlers, DynamicViewHandlerContext context) -
attachClickHandlers
protected void attachClickHandlers(View<?> view, String viewId, String componentId, List<DynamicViewHandlerDefinition> handlers, DynamicViewHandlerContext context) -
attachValueChangeHandlers
protected void attachValueChangeHandlers(View<?> view, String viewId, String componentId, List<DynamicViewHandlerDefinition> handlers, DynamicViewHandlerContext context) -
executeAll
protected void executeAll(String viewId, List<DynamicViewHandlerDefinition> handlers, DynamicViewHandlerContext context, DynamicViewEvent event) -
executeAllForEntity
protected void executeAllForEntity(String viewId, List<DynamicViewHandlerDefinition> handlers, DynamicViewHandlerContext context, @Nullable Object entity) -
invokeNamedHandler
protected void invokeNamedHandler(String viewId, List<DynamicViewHandlerDefinition> handlers, DynamicViewHandlerContext context, String handlerName) -
execute
protected void execute(String viewId, DynamicViewHandlerDefinition handler, DynamicViewHandlerContext context, DynamicViewEvent event) -
describe
-