java.lang.Object
de.seggebaeing.sqlanalyzer.presentation.uielements.window.TitledInitializableWindow
de.seggebaeing.sqlanalyzer.presentation.uielements.window.BDOWindow<T>
Type Parameters:
T - the concrete BusinessDomainObject handled by the window
All Implemented Interfaces:
javafx.fxml.Initializable
Direct Known Subclasses:
DetailsWindow, OverviewWindow

public abstract class BDOWindow<T extends BusinessDomainObject> extends TitledInitializableWindow
Abstract JavaFX base controller for windows operating on a specific BusinessDomainObject type. Provides shared header/title handling, a refresh action hook, and a guarded deletion workflow that checks for dependants and can route to their overview windows.

Subclasses supply the backing BDOService and implement refresh() and TitledInitializableWindow.getTitle().

Intended for use on the JavaFX Application Thread.

Since:
1.0
Author:
Felix Seggebäing
  • Field Details

    • headerLabel

      protected javafx.scene.control.Label headerLabel
    • refreshBtn

      protected javafx.scene.control.Button refreshBtn
  • Constructor Details

    • BDOWindow

      public BDOWindow()
  • Method Details

    • getService

      protected abstract BDOService<T> getService()
      Returns the backing service for this window’s domain type, used for CRUD operations, queries, and dependency resolution.
      Returns:
      the non-null BDOService for T
    • refresh

      protected abstract void refresh()
      Refreshes the window’s content from the underlying model/service. Implementations should reload data and update bound controls.
    • initialize

      public void initialize(URL location, ResourceBundle resources)
      When overridden, make sure to always call super.initialize(location, resources) first.
      Parameters:
      location - The location used to resolve relative paths for the root object, or null if the location is not known.
      resources - The resources used to localize the root object, or null if the root object was not localized.
    • setHeaderText

      protected void setHeaderText(String headerText)
      Updates the window’s header text shown in the bound label.
      Parameters:
      headerText - new header text; may be null to clear
      Implementation Note:
      Invoke on the JavaFX Application Thread.
    • requestDeletion

      protected boolean requestDeletion(T object)
      Shows the alerts to the user. Doesn't actually delete the object itself, but returns if it's safe to delete
      Parameters:
      object - the object for which the deletion is to be checked
      Returns:
      if we can proceed with the deletion