Package com.onec.ui

Class UiActionResolver

java.lang.Object
com.onec.ui.UiActionResolver

public class UiActionResolver extends Object
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.
  • Constructor Details

  • Method Details

    • forEntity

      public List<ActionSpec.Action> forEntity(Class<?> entity)
    • find

      public ActionSpec.Action find(Class<?> entity, String key)
      The action whose key matches, or null.
    • hasDynamicRowActions

      public boolean hasDynamicRowActions(Class<?> entity)
      Whether any row action of entity varies per row — the cheap guard the list-data feed checks before decorating rows. When false (the common case), rows ship untouched.
    • rowActionState

      public Map<String,Object> 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. 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.
    • inputsForEntity

      public List<InputSpec.InputField> inputsForEntity(Class<?> entity)
    • inputDescriptors

      public List<Map<String,Object>> inputDescriptors(Class<?> entity)
      Descriptor maps for the toolbar inputs — what the list surface emits for the client to render.
    • descriptors

      public List<Map<String,Object>> descriptors(Class<?> entity, Set<ActionScope> scopes)
      Descriptor maps for actions in the given scopes — what the list/detail surfaces emit.