Package su.onno.ui
Class UiActionResolver
java.lang.Object
su.onno.ui.UiActionResolver
Collects the custom
actions and toolbar inputs declared by
every EntityView, indexed by entity class. Actions resolve two ways: as descriptor maps
the list/detail surfaces emit (so the client renders the buttons), and by key for the
ActionController to execute. Inputs resolve as descriptor maps the list toolbar renders.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA DETAIL action's per-record resolution (issue #255): the samevisibleWhen/enabledWhen/label(fn)/icon(fn)functions a ROW action evaluates per list row, evaluated once against the loaded detail record. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondescriptors(Class<?> entity, Set<ActionScope> scopes) Descriptor maps for actions in the given scopes — what the list/detail surfaces emit.descriptors(List<ActionSpec.Action> actions, Set<ActionScope> scopes) Descriptor maps for an already resolved action snapshot.The action whose key matches, ornull.An action's form-item descriptor maps (ActionSpec.ActionBuilder.form), empty when none.Optional presentation metadata for an action form's canonical dialog shell.booleanhasDynamicActions(Class<?> entity) Whether the entity declares any provider that must be evaluated at menu/action time.booleanhasDynamicRowActions(Class<?> entity) Whether any row action ofentityvaries per row — the cheap guard the list-data feed checks before decorating rows.inputDescriptors(Class<?> entity) Descriptor maps for the toolbar inputs — what the list surface emits for the client to render.One input field's descriptor map — shared by the toolbar inputs and an action's form fields.inputsForEntity(Class<?> entity) recordActionState(ActionSpec.Action a, Map<String, Object> record) Evaluatea's per-record functions against a loaded record (seeUiActionResolver.RecordActionState).resolvedDescriptors(Class<?> entity, Set<ActionScope> scopes) Current descriptor maps including late-bound providers.resolvedForEntity(Class<?> entity) Static and late-bound actions in authored order, with the same first-view/key-wins merge as startup declarations.rowActionState(Class<?> entity, Map<String, Object> row) Per-row state for the entity's dynamic row actions, keyed by action key — what the list feed attaches to each row (under_actions) so the client can render that row's button with the right icon/label and honour its visibility/enabled state.rowActionState(List<ActionSpec.Action> actions, Map<String, Object> row) Resolve per-row state from an already resolved action snapshot (one live-provider evaluation).
-
Constructor Details
-
UiActionResolver
-
-
Method Details
-
forEntity
-
resolvedForEntity
Static and late-bound actions in authored order, with the same first-view/key-wins merge as startup declarations. Static-only entities return the cached list without re-running view code or allocating a new collection. -
hasDynamicActions
Whether the entity declares any provider that must be evaluated at menu/action time. -
find
The action whose key matches, ornull. -
hasDynamicRowActions
Whether any row action ofentityvaries per row — the cheap guard the list-data feed checks before decorating rows. Late-bound providers are deliberately excluded: their state is resolved once for the clicked row by the menu endpoint, not once per row in the list feed. When false (the common case), rows ship untouched. -
rowActionState
Per-row state for the entity's dynamic row actions, keyed by action key — what the list feed attaches to each row (under_actions) so the client can render that row's button with the right icon/label and honour its visibility/enabled state. Only dynamic row actions appear; static ones render from the descriptor unchanged. A function that throws is treated as a no-op (the descriptor value / visible+enabled) so one bad predicate can't break the list. -
rowActionState
Resolve per-row state from an already resolved action snapshot (one live-provider evaluation). -
recordActionState
public static UiActionResolver.RecordActionState recordActionState(ActionSpec.Action a, Map<String, Object> record) Evaluatea's per-record functions against a loaded record (seeUiActionResolver.RecordActionState). -
inputsForEntity
-
inputDescriptors
Descriptor maps for the toolbar inputs — what the list surface emits for the client to render. -
inputFieldMap
One input field's descriptor map — shared by the toolbar inputs and an action's form fields. -
formDescriptors
An action's form-item descriptor maps (ActionSpec.ActionBuilder.form), empty when none. Scalar fields come first (taggedkind: "field"), then the repeatable row groups (kind: "group", carrying theircolumns); the client renders each accordingly. -
formDialogDescriptor
Optional presentation metadata for an action form's canonical dialog shell. -
descriptors
Descriptor maps for actions in the given scopes — what the list/detail surfaces emit. -
resolvedDescriptors
Current descriptor maps including late-bound providers. Called by the dynamic menu endpoint; static list surfaces continue to usedescriptors(Class, Set)at zero extra cost. -
descriptors
public static List<Map<String,Object>> descriptors(List<ActionSpec.Action> actions, Set<ActionScope> scopes) Descriptor maps for an already resolved action snapshot.
-