Package su.onno.ui

Class EntityConfigBuilder<E>

java.lang.Object
su.onno.ui.EntityConfigBuilder<E>

public class EntityConfigBuilder<E> extends Object
Per-entity configuration scope passed to lambdas on SectionBuilder.catalog/document/register.

Today this exposes field-level hints plus related lists and row/detail actions. Future entity-level UI knobs (default sort, list columns subset, form grouping order, etc.) belong here too.

  • Constructor Details

    • EntityConfigBuilder

      public EntityConfigBuilder()
  • Method Details

    • field

      public FieldHintBuilder<E,Object> field(String name)
    • field

      public <V> FieldHintBuilder<E,Object> field(Field<E,V> field)
      Configure a field using a compiler-checked getter reference.
    • refField

      public <T> FieldHintBuilder<E,T> refField(Field<E,Ref<T>> field)
      Configure a Ref field while retaining its target type for target-field hints.
    • rowField

      public <R, V> FieldHintBuilder<E,Object> rowField(Field<E,? extends Collection<R>> section, Field<R,V> rowField)
      Configure a field inside a typed collection/tabular section.
    • rowRefField

      public <R, T> FieldHintBuilder<E,T> rowRefField(Field<E,? extends Collection<R>> section, Field<R,Ref<T>> rowField)
      Configure a Ref inside a typed collection/tabular section, retaining its target type.
    • validation

      public FormValidationBuilder<E> validation(String key, Class<? extends FormValidator> validator)
      Add debounced, dependency-aware live feedback to the generated form. The validator class must be a Spring bean; use FormValidationBuilder.dependsOn(java.lang.String...) to avoid unrelated calls.
    • relatedList

      public <J> RelatedListBuilder<E,J> relatedList(String name, Class<J> junction)
      Declare an inline related-list (child rows) panel for this catalog editor, backed by a join catalog — the catalog-side analogue of a document's @TabularSection. Point it at the join @Catalog class, then say which Ref scopes rows to this record (via) and which Ref to show/pick per row (display):
       f.relatedList("doctors", ClinicDoctor.class).via("clinic").display("doctor");
       

      See RelatedList. Editor-only — no schema change; rows are read/written live against the join catalog.

    • action

      public ActionHintBuilder action(String name)
      Configure where a detail-header action shows, keyed exactly as declared through EntityView.actions(ActionSpec). Built-ins include post, unpost, edit, and delete; custom detail actions use their authored key too. By default Post is a primary button and the rest live in the overflow (⋯) menu; override with .primary(), .inMenu() or .hidden().
    • icon

      public EntityConfigBuilder icon(String icon)
      The nav icon for this entity — any lucide icon name (e.g. "key", "calendar-check"). Honored over the keyword heuristic, so an authored icon always wins. Blank means "fall back to the heuristic".
    • buildFieldHints

      public Map<String,FieldHint> buildFieldHints()
    • buildValidations

      public List<FormValidation> buildValidations()
    • buildRelatedLists

      public List<RelatedList> buildRelatedLists()
      Related-list panels authored on this entity, in declaration order.