Interface EditorLink.Builder<R extends EntityEditor<R>>
- Type Parameters:
R- theEntityEditortype
- All Known Subinterfaces:
ForeignKeyEditorLink.Builder<R>
- Enclosing interface:
EditorLink
Builds an EditorLink.
The required steps are:
EditorLink.Builder.EditorStep.editor(EntityEditor)— bind the detail editor.- Then either
EditorLink.Builder.ForeignKeyNameStep.foreignKey(ForeignKey)(FK case, all callbacks defaulted from the FK) orEditorLink.Builder.ForeignKeyNameStep.name(String)followed byEditorLink.Builder.LoadStep.condition(DetailCondition),EditorLink.Builder.LoadStep.select(DetailSelect)orEditorLink.Builder.LoadStep.entity(DetailEntity)(non-FK case).
present(Predicate) and beforeInsert(BeforeInsert) are optional.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThe first step — binds the detail editor that the link will describe.static interfaceEditorLink.Builder.ForeignKeyNameStep<R extends EntityEditor<R>>The second step — choose whether the link is foreign-key based or named.static interfaceEditorLink.Builder.LoadStep<R extends EntityEditor<R>>Required afterEditorLink.Builder.ForeignKeyNameStep.name(String)— supplies the load source for the detail entity, expressed as aEditorLink.DetailCondition,EditorLink.DetailSelectorEditorLink.DetailEntity. -
Method Summary
Modifier and TypeMethodDescriptionbeforeInsert(EditorLink.BeforeInsert beforeInsert) Overrides theEditorLink.BeforeInsertaction.build()Sets the link caption.Sets the presence predicate for the detail editor.
-
Method Details
-
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'sEntityEditor.present()state, replacing any previously-set predicate (it is not wrapped). The predicate is then locked: subsequent attempts to replace it viaEntityEditor.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
Overrides the
EditorLink.BeforeInsertaction.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
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
-
build
EditorLink build()- Returns:
- a new
EditorLink
-