Type Parameters:
T - the concrete domain type displayed and edited
All Implemented Interfaces:
javafx.fxml.Initializable
Direct Known Subclasses:
GeneratedQueryDetailsController, LLMDetailsController, PromptDetailsController, PromptTypeDetailsController, SampleQueryDetailsController

public abstract class DetailsWindow<T extends BusinessDomainObject> extends BDOWindow<T>
Abstract base controller for detail/edit windows of a BusinessDomainObject. Provides common wiring for header/title, Save/Delete actions with guarded deletion, overview refresh hooks, and a “last edited” label derived from the object’s version. Subclasses supply the service, implement data loading/saving, and the refresh de.seggebaeing.sqlanalyzer.logic. Intended for FXML controllers on the JavaFX Application Thread.
Since:
1.0
Author:
Felix Seggebäing
  • Field Details

    • root

      protected javafx.scene.layout.BorderPane root
    • deleteBtn

      protected javafx.scene.control.Button deleteBtn
    • saveBtn

      protected javafx.scene.control.Button saveBtn
    • lastEditedLabel

      protected javafx.scene.control.Label lastEditedLabel
  • Constructor Details

    • DetailsWindow

      public DetailsWindow(T object)
      Creates a details window bound to the given domain object.
      Parameters:
      object - the object to display/edit; expected non-null
  • Method Details

    • initialize

      public void initialize(URL location, ResourceBundle resources)
      Initializes the details window: delegates to super.initialize, updates the “last edited” label, calls BDOWindow.refresh(), wires Delete/Save button handlers, and sets the header from TitledInitializableWindow.getTitle().
      Specified by:
      initialize in interface javafx.fxml.Initializable
      Overrides:
      initialize in class BDOWindow<T extends BusinessDomainObject>
      Parameters:
      location - FXML location (may be null)
      resources - localization bundle (may be null)
      Implementation Note:
      Invoked by the FXML loader on the JavaFX Application Thread.
    • saveChecks

      protected List<String> saveChecks()
      Extensions can (and should) override this.
      Returns:
      all save check messages. An empty String means it's valid to save
    • getObject

      protected T getObject()
      Returns the domain object currently displayed and edited by this window.
      Returns:
      the bound object (non-null after construction)
    • saveBtnClick

      protected void saveBtnClick()
      Handles the Save action: runs saveChecks(), and if no messages are returned, loads UI values into the object via insertValues(), persists it through BDOWindow.getService(), refreshes related overviews, and closes the window. Otherwise, shows an informational alert with the validation reasons.
      Implementation Note:
      Intended as an FX event handler; invoke on the JavaFX Application Thread.
    • deleteBtnClick

      protected void deleteBtnClick()
      Handles the Delete action: confirms via BDOWindow.requestDeletion(BusinessDomainObject), deletes the object through BDOWindow.getService(), refreshes all related overview windows, and closes this window.
      Implementation Note:
      Intended as a JavaFX event handler; run on the Application Thread.
    • insertValues

      protected abstract void insertValues()
      Transfers the current UI control values into the backing domain object. Called during the Save flow after saveChecks() passes; must not perform de.seggebaeing.sqlanalyzer.persistence or window navigation.