Type Parameters:
BDO - the domain type displayed in the overview
All Implemented Interfaces:
javafx.fxml.Initializable
Direct Known Subclasses:
GeneratedQueryOverviewController, LLMOverviewController, PromptOverviewController, PromptTypeOverviewController, SampleQueryOverviewController

public abstract class OverviewWindow<BDO extends BusinessDomainObject> extends BDOWindow<BDO>
Abstract base for list/overview windows of BusinessDomainObjects. Provides a ready-to-use ListView with single selection, external and internal filtering, context menu & double-click/ENTER to open details, and wired Add/Delete actions (guarded by the parent’s deletion workflow). Subclasses supply the service via getService() and implement addItem(). Intended for FXML controllers; use on the JavaFX Application Thread.
Since:
1.0
Author:
Felix Seggebäing
  • Field Details

  • Constructor Details

    • OverviewWindow

      public OverviewWindow(Predicate<BDO> externalFilter)
      Creates an overview window with an optional external filter applied to the displayed items.
      Parameters:
      externalFilter - initial predicate to pre-filter items; may be null
  • Method Details

    • initialize

      public void initialize(URL location, ResourceBundle resources)
      Initializes the overview window: calls super.initialize, sets the header from TitledInitializableWindow.getTitle(), installs the external filter UI (if any), wires Add/Delete actions, configures the list view behavior, and performs an initial refresh().
      Specified by:
      initialize in interface javafx.fxml.Initializable
      Overrides:
      initialize in class BDOWindow<BDO extends BusinessDomainObject>
      Parameters:
      location - FXML location (may be null)
      resources - localization bundle (may be null)
      Implementation Note:
      Must be invoked by the FXML loader on the JavaFX Application Thread.
    • refresh

      public void refresh()
      Reloads the list contents from the backing service, applying the external filter (if present) and the AND-composed internal filters, then sorts by toString(). Restores the previous selection when still available.
      Specified by:
      refresh in class BDOWindow<BDO extends BusinessDomainObject>
      Implementation Note:
      Invoke on the JavaFX Application Thread.
    • addObjectFilter

      protected <T> void addObjectFilter(Function<BDO,T> func, String filterName)
      Adds a drop-down filter for a derived attribute of each item. The combo box lists all distinct values (with total occurrence counts) plus a “no selection” entry; changing the selection triggers refresh(). Filtering matches items whose derived value is the selected one (by reference identity).
      Type Parameters:
      T - value type produced by func
      Parameters:
      func - mapping from item to the attribute to filter by
      filterName - label shown beneath the combo box
      Implementation Note:
      Options are populated from current data with cardinalities; equality check uses ==.
    • addStringFilter

      protected void addStringFilter(Function<BDO,String> func, String filterName)
      Adds a case-insensitive substring filter driven by a text field. Typing triggers refresh(); empty input disables the filter.
      Parameters:
      func - maps an item to the string to search in (expected non-null)
      filterName - label shown beneath the text field
      Implementation Note:
      The predicate calls func.apply(bdo).toLowerCase(), so func should not return null for eligible items.
    • addItem

      protected abstract void addItem()
      Opens the details view for a newly created BDO instance (i.e., “Add” flow). Creation/de.seggebaeing.sqlanalyzer.persistence should occur only if the user confirms/saves in the details view.
      Implementation Note:
      Typically delegates to WindowManager.openDetails(...) with a fresh BDO. Invoked by FXML (e.g., Add button).