Class EditModalBuilder
Contract: provide an explicit editView, an editable, or both.
An explicit view supplies the property form; otherwise the builder uses
editable.buildEditView(). When supplied, editable also provides child handles.
Save actions post to saveUrl; child actions are emitted only when corresponding URL
templates are configured.
Mutability and thread-safety: mutable and not thread-safe. Configure and build within a single request flow.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the configured modal.static EditModalBuildercreate()Creates a new builder instance.Hides the delete action in the modal footer.withChildDeleteUrl(String childDeleteUrl) Sets the child-delete URL template; null disables the action.withChildEditUrl(String childEditUrl) Sets the child-edit URL template; null disables the action.withDeleteUrl(String deleteUrl) Sets the complete caller URL used by Delete; no template substitution or URL encoding.withEditable(Editable<?> editable) Sets editable module adapter used to source edit view and child handles.withEditView(Component editView) Sets pre-built edit view content for main module properties.withModalContainerId(String modalContainerId) Sets modal container id targeted by modal updates.withModuleId(String moduleId) Sets the module identifier used by callers for endpoint construction.withPageContainerId(String pageContainerId) Sets page container id targeted by delete operations.withSaveUrl(String saveUrl) Sets the complete caller URL used by Save; no template substitution or URL encoding.Sets modal title text.
-
Method Details
-
create
Creates a new builder instance. -
withTitle
Sets modal title text. -
withModuleId
Sets the module identifier used by callers for endpoint construction. -
withEditView
Sets pre-built edit view content for main module properties. -
withEditable
Sets editable module adapter used to source edit view and child handles. -
withSaveUrl
Sets the complete caller URL used by Save; no template substitution or URL encoding. -
withDeleteUrl
Sets the complete caller URL used by Delete; no template substitution or URL encoding. -
withChildEditUrl
Sets the child-edit URL template; null disables the action. Only{id}is supported, as a whole path segment or whole query value. Repeated/omitted tokens and fixed URLs are allowed; literal URL text is preserved. In browser-relevant structure, token-bearing absolute URLs requirescheme://nonempty-literal-authority; protocol-relative, root-relative, relative-path and query-only references are supported. Placement is also checked after browser-style control/space and path-backslash handling, without rewriting the output. Scheme shorthands, empty authorities and opaque templated URLs are unsupported; fixed URLs do not acquire structural validation.When a child action is built, its raw id is UTF-8 percent-encoded without trimming, normalization or decoding. Used ids must be non-null, nonempty, nonblank, not exactly
.or.., and valid UTF-16. Literal percent signs are encoded too. No id validation occurs for disabled actions, empty child lists or omitted tokens. Legacy partial-segment, query-key, authority and fragment token placements are rejected.- Parameters:
childEditUrl- caller-owned template or null- Returns:
- this builder
- Throws:
IllegalArgumentException- for unsupported tokens or token placements
-
withChildDeleteUrl
Sets the child-delete URL template; null disables the action. Uses the same token placement, raw-id encoding and build-time id validation aswithChildEditUrl(String).- Parameters:
childDeleteUrl- caller-owned template or null- Returns:
- this builder
- Throws:
IllegalArgumentException- for unsupported tokens or token placements
-
hideDelete
Hides the delete action in the modal footer. -
withPageContainerId
Sets page container id targeted by delete operations.- Throws:
IllegalArgumentException- when id is null or fails identifier validation
-
withModalContainerId
Sets modal container id targeted by modal updates.- Throws:
IllegalArgumentException- when id is null or fails identifier validation
-
build
Builds the configured modal.- Throws:
IllegalStateException- when required edit source or save URL is missing
-