Module de.seggebaeing.sqlanalyzer
Class OverviewWindow<BDO extends BusinessDomainObject>
java.lang.Object
de.seggebaeing.sqlanalyzer.presentation.uielements.window.TitledInitializableWindow
de.seggebaeing.sqlanalyzer.presentation.uielements.window.BDOWindow<BDO>
de.seggebaeing.sqlanalyzer.presentation.uielements.window.OverviewWindow<BDO>
- Type Parameters:
BDO
- the domain type displayed in the overview
- All Implemented Interfaces:
javafx.fxml.Initializable
- Direct Known Subclasses:
GeneratedQueryOverviewController
,LLMOverviewController
,PromptOverviewController
,PromptTypeOverviewController
,SampleQueryOverviewController
Abstract base for list/overview windows of
BusinessDomainObject
s.
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 Summary
FieldsFields inherited from class de.seggebaeing.sqlanalyzer.presentation.uielements.window.BDOWindow
headerLabel, refreshBtn
Fields inherited from class de.seggebaeing.sqlanalyzer.presentation.uielements.window.TitledInitializableWindow
root
-
Constructor Summary
ConstructorsConstructorDescriptionOverviewWindow
(Predicate<BDO> externalFilter) Creates an overview window with an optional external filter applied to the displayed items. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
addItem()
Opens the details view for a newly createdBDO
instance (i.e., “Add” flow).protected <T> void
addObjectFilter
(Function<BDO, T> func, String filterName) Adds a drop-down filter for a derived attribute of each item.protected void
addStringFilter
(Function<BDO, String> func, String filterName) Adds a case-insensitive substring filter driven by a text field.void
initialize
(URL location, ResourceBundle resources) Initializes the overview window: callssuper.initialize
, sets the header fromTitledInitializableWindow.getTitle()
, installs the external filter UI (if any), wires Add/Delete actions, configures the list view behavior, and performs an initialrefresh()
.void
refresh()
Reloads the list contents from the backing service, applying the external filter (if present) and the AND-composed internal filters, then sorts bytoString()
.Methods inherited from class de.seggebaeing.sqlanalyzer.presentation.uielements.window.BDOWindow
getService, requestDeletion, setHeaderText
Methods inherited from class de.seggebaeing.sqlanalyzer.presentation.uielements.window.TitledInitializableWindow
closeWindow, enableHelp, getRoot, getStage, getTitle
-
Field Details
-
listView
-
-
Constructor Details
-
OverviewWindow
Creates an overview window with an optional external filter applied to the displayed items.- Parameters:
externalFilter
- initial predicate to pre-filter items; may benull
-
-
Method Details
-
initialize
Initializes the overview window: callssuper.initialize
, sets the header fromTitledInitializableWindow.getTitle()
, installs the external filter UI (if any), wires Add/Delete actions, configures the list view behavior, and performs an initialrefresh()
.- Specified by:
initialize
in interfacejavafx.fxml.Initializable
- Overrides:
initialize
in classBDOWindow<BDO extends BusinessDomainObject>
- Parameters:
location
- FXML location (may benull
)resources
- localization bundle (may benull
)- 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 bytoString()
. Restores the previous selection when still available.- Specified by:
refresh
in classBDOWindow<BDO extends BusinessDomainObject>
- Implementation Note:
- Invoke on the JavaFX Application Thread.
-
addObjectFilter
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 triggersrefresh()
. Filtering matches items whose derived value is the selected one (by reference identity).- Type Parameters:
T
- value type produced byfunc
- Parameters:
func
- mapping from item to the attribute to filter byfilterName
- label shown beneath the combo box- Implementation Note:
- Options are populated from current data with cardinalities; equality check uses
==
.
-
addStringFilter
Adds a case-insensitive substring filter driven by a text field. Typing triggersrefresh()
; 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()
, sofunc
should not returnnull
for eligible items.
-
addItem
protected abstract void addItem()Opens the details view for a newly createdBDO
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).
-