Module de.seggebaeing.sqlanalyzer
Class DetailsWindow<T extends BusinessDomainObject>
java.lang.Object
de.seggebaeing.sqlanalyzer.presentation.uielements.window.TitledInitializableWindow
de.seggebaeing.sqlanalyzer.presentation.uielements.window.BDOWindow<T>
de.seggebaeing.sqlanalyzer.presentation.uielements.window.DetailsWindow<T>
- Type Parameters:
T
- the concrete domain type displayed and edited
- All Implemented Interfaces:
javafx.fxml.Initializable
- Direct Known Subclasses:
GeneratedQueryDetailsController
,LLMDetailsController
,PromptDetailsController
,PromptTypeDetailsController
,SampleQueryDetailsController
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 Summary
FieldsModifier and TypeFieldDescriptionprotected javafx.scene.control.Button
protected javafx.scene.control.Label
protected javafx.scene.layout.BorderPane
protected javafx.scene.control.Button
Fields inherited from class de.seggebaeing.sqlanalyzer.presentation.uielements.window.BDOWindow
headerLabel, refreshBtn
-
Constructor Summary
ConstructorsConstructorDescriptionDetailsWindow
(T object) Creates a details window bound to the given domain object. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Handles the Delete action: confirms viaBDOWindow.requestDeletion(BusinessDomainObject)
, deletes the object throughBDOWindow.getService()
, refreshes all related overview windows, and closes this window.protected T
Returns the domain object currently displayed and edited by this window.void
initialize
(URL location, ResourceBundle resources) Initializes the details window: delegates tosuper.initialize
, updates the “last edited” label, callsBDOWindow.refresh()
, wires Delete/Save button handlers, and sets the header fromTitledInitializableWindow.getTitle()
.protected abstract void
Transfers the current UI control values into the backing domain object.protected void
Handles the Save action: runssaveChecks()
, and if no messages are returned, loads UI values into the object viainsertValues()
, persists it throughBDOWindow.getService()
, refreshes related overviews, and closes the window.Extensions can (and should) override this.Methods inherited from class de.seggebaeing.sqlanalyzer.presentation.uielements.window.BDOWindow
getService, refresh, requestDeletion, setHeaderText
Methods inherited from class de.seggebaeing.sqlanalyzer.presentation.uielements.window.TitledInitializableWindow
closeWindow, enableHelp, getRoot, getStage, getTitle
-
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
Creates a details window bound to the given domain object.- Parameters:
object
- the object to display/edit; expected non-null
-
-
Method Details
-
initialize
Initializes the details window: delegates tosuper.initialize
, updates the “last edited” label, callsBDOWindow.refresh()
, wires Delete/Save button handlers, and sets the header fromTitledInitializableWindow.getTitle()
.- Specified by:
initialize
in interfacejavafx.fxml.Initializable
- Overrides:
initialize
in classBDOWindow<T extends BusinessDomainObject>
- Parameters:
location
- FXML location (may benull
)resources
- localization bundle (may benull
)- Implementation Note:
- Invoked by the FXML loader on the JavaFX Application Thread.
-
saveChecks
Extensions can (and should) override this.- Returns:
- all save check messages. An empty String means it's valid to save
-
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: runssaveChecks()
, and if no messages are returned, loads UI values into the object viainsertValues()
, persists it throughBDOWindow.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 viaBDOWindow.requestDeletion(BusinessDomainObject)
, deletes the object throughBDOWindow.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 aftersaveChecks()
passes; must not perform de.seggebaeing.sqlanalyzer.persistence or window navigation.
-