Class FxConfigPageBuilder
java.lang.Object
privbot.ui.fx.FxConfigPageBuilder
Annotation-driven settings page renderer — the "free studio" for any RuneLite-style
Config.
Given a plugin's @ConfigGroup interface instance and the ConfigManager, this reads the
@ConfigItem / @ConfigSection / @Range metadata and produces a uniform JavaFX form
whose controls match every other PrivBot studio (built on FxFormKit + PrivBotFxStyles).
Edits write straight back through ConfigManager.setConfiguration(String, String, Object), so changes
apply live and survive restarts (same keys as the hand-rolled studios).
Usage in a plugin studio
// One auto-generated page for the whole config:
.addFxSection("settings", "Settings", "Settings", "All options",
() -> FxConfigPageBuilder.forConfig(config, configManager), true)
// Or one nav entry per @ConfigSection:
for (FxConfigPageBuilder.SectionRef s : FxConfigPageBuilder.sections(config)) {
builder.addFxSection(s.key, s.name, s.name, s.description,
() -> FxConfigPageBuilder.forSection(config, configManager, s.key), true);
}
Controls by return type: boolean→toggle, int/long→integer spinner (bounded by
@Range), double→decimal spinner, enum→combo, String→text field. Items marked
hidden/secret are skipped. Unknown types render as a read-only field showing the value, so a
plugin with an exotic field still renders without crashing.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classLightweight descriptor of a@ConfigSectionfor nav wiring. -
Method Summary
Modifier and TypeMethodDescriptionstatic javafx.scene.NodeforConfig(net.runelite.client.config.Config config, net.runelite.client.config.ConfigManager configManager) Builds one page containing every visible config item, with a sub-header per section.static javafx.scene.NodeforSection(net.runelite.client.config.Config config, net.runelite.client.config.ConfigManager configManager, String sectionKey) Builds a page for a single@ConfigSection(items whosesection()matchessectionKey).static List<FxConfigPageBuilder.SectionRef> sections(net.runelite.client.config.Config config)
-
Method Details
-
sections
public static List<FxConfigPageBuilder.SectionRef> sections(net.runelite.client.config.Config config) - Returns:
- the ordered
@ConfigSections declared on the config interface (empty if the plugin uses none).
-
forConfig
public static javafx.scene.Node forConfig(net.runelite.client.config.Config config, net.runelite.client.config.ConfigManager configManager) Builds one page containing every visible config item, with a sub-header per section. -
forSection
public static javafx.scene.Node forSection(net.runelite.client.config.Config config, net.runelite.client.config.ConfigManager configManager, String sectionKey) Builds a page for a single@ConfigSection(items whosesection()matchessectionKey).
-