Class FxFormKit

java.lang.Object
privbot.ui.fx.FxFormKit

public final class FxFormKit extends Object
Layout and styling helpers for PrivBot JavaFX settings pages.
  • Method Details

    • normalizeInlineList

      public static String normalizeInlineList(String raw)
      Collapse newlines/extra spaces so config stays one-line comma lists (multi-line editor friendly).
    • setTextIfNotFocused

      public static void setTextIfNotFocused(javafx.scene.control.TextInputControl field, String value)
      Updates text only when the control is not actively focused by the user.
    • setSpinnerValueIfNotEditing

      public static <T> void setSpinnerValueIfNotEditing(javafx.scene.control.Spinner<T> spinner, T value)
      Updates spinner value only when the spinner/editor is not actively focused.
    • formGrid

      public static javafx.scene.layout.GridPane formGrid()
      An empty two-column label/field grid for addFormRow(javafx.scene.layout.GridPane, int, java.lang.String, javafx.scene.Node). Build JavaFX nodes on the FX thread.
    • addFormRow

      public static void addFormRow(javafx.scene.layout.GridPane grid, int row, String labelText, javafx.scene.Node field)
      Adds a right-aligned label in column 0 and field in column 1 of row. Inputs stretch to the column width; labels keep their natural width; multi-line fields align to the top.
    • isMultilineField

      public static boolean isMultilineField(javafx.scene.Node field)
      True for a TextArea or a resizableListEditor(double, double, double) wrapper.
    • resizableListEditor

      public static FxFormKit.ResizableMultiline resizableListEditor(double minHeight, double prefHeight, double maxHeight)
      Parameters:
      minHeight - floor height when dragging smaller (px)
      prefHeight - initial height (px)
      maxHeight - ceiling when dragging larger (px)
    • applyFastVerticalScroll

      public static void applyFastVerticalScroll(javafx.scene.control.ScrollPane scroll, double speedMultiplier)
      Makes the outer page ScrollPane respond faster to mouse wheel / trackpad (studio-wide).
    • sectionCardShell

      public static javafx.scene.layout.VBox sectionCardShell(String title, String subtitle)
      A white section-card with a title and wrapped subtitle; add rows to its children.
    • applyToggleStyle

      public static void applyToggleStyle(javafx.scene.control.ToggleButton tb)
      Sets the on/off style class from the toggle's selected state; call it after each change.
    • buildPageWithScroll

      public static javafx.scene.layout.VBox buildPageWithScroll(String title, String subtitle, javafx.scene.Node body, javafx.scene.Node footer)
      Page chrome: title, subtitle, scrollable body, optional footer below the scroll area.