Class FxConfigPageBuilder

java.lang.Object
privbot.ui.fx.FxConfigPageBuilder

public final class FxConfigPageBuilder extends Object
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 Classes
    Modifier and Type
    Class
    Description
    static final class 
    Lightweight descriptor of a @ConfigSection for nav wiring.
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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 whose section() matches sectionKey).
    sections(net.runelite.client.config.Config config)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 whose section() matches sectionKey).