Interface EditorLink.Builder

All Known Subinterfaces:
ForeignKeyEditorLink.Builder
Enclosing interface:
EditorLink

public static interface EditorLink.Builder
  • Method Details

    • present

      EditorLink.Builder present(Predicate<Entity> present)

      Sets the presence predicate for the detail editor.

      At registration time (EntityEditor.DetailEditors.add(EditorLink)) the supplied predicate is installed on the detail editor's EntityEditor.EditorEntity.present() state, replacing any previously-set predicate (it is not wrapped). The predicate is then locked: subsequent attempts to replace it via EntityEditor.Present.predicate() will fail. If a custom presence predicate is needed on a detail editor, supply it here rather than setting it directly on the editor before registration.

      Parameters:
      present - the presence predicate
      Returns:
      this builder
    • beforeInsert

      EditorLink.Builder beforeInsert(EditorLink.BeforeInsert beforeInsert)

      Overrides the EditorLink.BeforeInsert action.

      For FK-based links this overrides the default FK-set; the user must still ensure the foreign key gets set correctly if the framework's default is replaced.

      Parameters:
      beforeInsert - the action applied to the detail prior to insertion
      Returns:
      this builder
    • caption

      EditorLink.Builder caption(String caption)

      Sets the link caption.

      The caption is the human-readable label used by the UI layer when disambiguating components — for example, the suffix in the "Select input field" dialog when the same attribute appears in multiple slots ("Tag (1)", "Tag (Manager)").

      Defaults to the link name. Override when the link name is a structural identifier (e.g., the auto-derived foreignKey.name() or sequential numbers used to keep slot names unique) and a different label reads better in the UI.

      Parameters:
      caption - the link caption
      Returns:
      this builder
      Throws:
      IllegalArgumentException - if the caption is null or empty
    • clearEmpty

      EditorLink.Builder clearEmpty(boolean clearEmpty)
      Specifies whether to clear all values instead of setting defaults when the detail editor is emptied on load, when no detail entity exists.
      Parameters:
      clearEmpty - specifies whether to clear the values when the editor is emptied
      Returns:
      this builder
    • build

      EditorLink build()
      Returns:
      a new EditorLink