One rule governs the shape of a form: the chain only ever adds elements; anything that configures an element happens inside that element's lambda. Nothing on this class configures anything, so no call can land on the wrong node — there is no "current element" to get wrong:
form() // A titled section. Its contents are the chain inside the lambda, so the grouping // is visible in the source; the trailing lambda addresses the section as a whole. .section("HTTP Server", httpServer -> httpServer // A checkbox with a value field beside it, enabled while the box is ticked. // Convenience sugar for checkbox(text, enabled, box -> box.attachField(...). // The lambda addresses that field, not the checkbox. .checkWithField("Enable HTTP Server on port", viewModel.enableHttpServerProperty(), viewModel.httpPortProperty(), port -> port.validate(viewModel.httpPortValidationStatus()) .help(HelpFile.REMOTE)) // A group of related elements, can be disabled as one. .group(expert -> expert .stringField("API base URL", viewModel.apiBaseUrlProperty()), expertGroup -> expertGroup.disableWhen(viewModel.disableExpertSettingsProperty())), // Documentation for the section as a whole: a help button beside its heading. httpServerSection -> httpServerSection.help("https://docs.jabref.org/advanced/remote")) .section("Another section", section -> section ...) .build();
The texts are written out above for readability; in a tab they are Localization.lang(...)
calls.
The handle a lambda receives states what it is: an InputElement is a Control,
so it can carry a tooltip, validation and attachments — a help button, a browse button, an
inline value field appended right after it; a NodeElement offers none of that because
it is not a Control. Asking for the wrong one does not compile.
Documentation is linked with help(...), which appends a help icon button that stays clickable
while the element it belongs to is disabled. It sits on the two handles that own a row of their
own: SectionRegion#help puts it beside the section heading, InputElement#help beside a single
control. Both take either a HelpFile — a page of the JabRef user documentation — or a URL for
anything outside it.
Consecutive labelled fields share an aligned two-column GridPane. Validation decoration is
applied per control once that control reaches a scene, which is when ControlsFX can position it.
| Modifier and Type | Class and Description |
|---|---|
| public abstract static class | PreferencesFormBuilder.
Base of the element handles: what can be done to any node the builder just added. |
| public static class | PreferencesFormBuilder.
A plain region: a |
| public static class | |
| public static class | PreferencesFormBuilder.
A node that is not a |
| public abstract static class | PreferencesFormBuilder.
Base of the region handles, handed to a region's configuration lambda once the builder has closed it. |
| public static class | PreferencesFormBuilder.
The region of a |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private final Deque | |
| private @Nullable GridPane | currentGrid
Element grid spanning multiple input elements to ensure correct alignment. |
| private @Nullable ToggleGroup | currentToggleGroup
The toggle group radios join inside |
| private final DialogService | |
| private final GuiPreferences | |
| private final VBox | |
| private final List | searchableElements
Every visible text handed to the builder, paired with the node it captions. |
| private final de. |
| Access | Constructor and Description |
|---|---|
| public |