All Implemented Interfaces:
javafx.fxml.Initializable

public class GenerationController extends WorkerWindow
Controller for the SQL generation workflow. Extends WorkerWindow to spawn a GenerationThread, track per-LLM progress (incl. rate-limit countdown), enable contextual help, validate settings, and persist/open newly generated queries on save.
Since:
1.0
Author:
Felix Seggebäing
  • Constructor Details

    • GenerationController

      public GenerationController()
  • Method Details

    • initialize

      public void initialize(URL location, ResourceBundle resources)
      Calls super.initialize(...) and enables the generation help link.
      Specified by:
      initialize in interface javafx.fxml.Initializable
      Overrides:
      initialize in class WorkerWindow
      Parameters:
      location - FXML location (may be null)
      resources - localization bundle (may be null)
      Implementation Note:
      Invoke on the JavaFX Application Thread.
    • getTitle

      public String getTitle()
      Returns the fixed title for the generation window.
      Specified by:
      getTitle in class TitledInitializableWindow
      Returns:
      the string "Generation"
    • saveBtnClick

      protected void saveBtnClick()
      Persists newly generated queries and navigates to their overview. Retrieves the result set from the active GenerationThread, saves each via the service, opens the Generated Query overview filtered to the new items, then closes this window.
      Specified by:
      saveBtnClick in class WorkerWindow
      Implementation Note:
      Assumes workerProperty.get() is a completed GenerationThread. Invoke on the JavaFX Application Thread.
    • createWorkerThread

      protected Thread createWorkerThread()
      Prepares per-LLM progress UI and callback wiring for the generation run. For each selected LLM this:
      • Adds a DualProgressBar bound to started/finished progress,
      • Exposes a retry Instant via a bound CountdownLabel,
      • Maintains atomic counters and derives progress as started/total and finished/total,
      • Stores lambdas in maps used by the worker to update progress and the latest rate-limit instant.
      The method then constructs and returns a GenerationThread that consumes these maps to report progress and rate-limit updates.
      Specified by:
      createWorkerThread in class WorkerWindow
      Returns:
      a configured, not-yet-started Thread for SQL generation
      Implementation Note:
      UI nodes are created and bound here; worker callbacks should be marshalled to the FX thread.
    • showSettingsPopup

      protected void showSettingsPopup()
      Opens the Generation Settings window for configuring the run.
      Specified by:
      showSettingsPopup in class WorkerWindow
    • startValid

      protected boolean startValid()
      Validates that generation can start: positive pool size and repetition count, and non-empty selections of LLMs and prompts.
      Specified by:
      startValid in class WorkerWindow
      Returns:
      true if all preconditions are met; false otherwise