Module de.seggebaeing.sqlanalyzer
Class SampleQueryDetailsController
java.lang.Object
de.seggebaeing.sqlanalyzer.presentation.uielements.window.TitledInitializableWindow
de.seggebaeing.sqlanalyzer.presentation.uielements.window.BDOWindow<SampleQuery>
de.seggebaeing.sqlanalyzer.presentation.uielements.window.DetailsWindow<SampleQuery>
de.seggebaeing.sqlanalyzer.presentation.controller.details.SampleQueryDetailsController
- All Implemented Interfaces:
javafx.fxml.Initializable
Details/edit window controller for a single
SampleQuery
.
Loads values into UI controls, validates inputs (incl. SQL must start with
SELECT
and prompt context must contain exactly one §§§
placeholder),
and writes changes back to the domain object on save. Includes contextual help.- Since:
- 1.0
- Author:
- Felix Seggebäing
-
Field Summary
Fields inherited from class de.seggebaeing.sqlanalyzer.presentation.uielements.window.DetailsWindow
deleteBtn, lastEditedLabel, root, saveBtn
Fields inherited from class de.seggebaeing.sqlanalyzer.presentation.uielements.window.BDOWindow
headerLabel, refreshBtn
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SampleQueryService
Returns the service used to load and persist sample query objects.getTitle()
Returns the fixed title for the sample query details window.void
initialize
(URL location, ResourceBundle resources) Initializes the sample query details view: delegates tosuper.initialize
, enables contextual help, and populates the complexity combo box with all enum values.protected void
Writes the current UI values into the boundSampleQuery
instance (name, description, SQL, prompt context, complexity).protected void
refresh()
Loads the boundSampleQuery
values into the UI controls (name, description, SQL, prompt context, complexity).Validates the sample query form and returns human-readable errors.Methods inherited from class de.seggebaeing.sqlanalyzer.presentation.uielements.window.DetailsWindow
deleteBtnClick, getObject, saveBtnClick
Methods inherited from class de.seggebaeing.sqlanalyzer.presentation.uielements.window.BDOWindow
requestDeletion, setHeaderText
Methods inherited from class de.seggebaeing.sqlanalyzer.presentation.uielements.window.TitledInitializableWindow
closeWindow, enableHelp, getRoot, getStage
-
Constructor Details
-
SampleQueryDetailsController
Creates a details controller bound to the givenSampleQuery
.- Parameters:
object
- the sample query to display and edit; expected non-null
-
-
Method Details
-
initialize
Initializes the sample query details view: delegates tosuper.initialize
, enables contextual help, and populates the complexity combo box with all enum values.- Specified by:
initialize
in interfacejavafx.fxml.Initializable
- Overrides:
initialize
in classDetailsWindow<SampleQuery>
- Parameters:
location
- FXML location (may benull
)resources
- localization bundle (may benull
)- Implementation Note:
- Invoked by the FXML loader on the JavaFX Application Thread.
-
getService
Returns the service used to load and persist sample query objects.- Specified by:
getService
in classBDOWindow<SampleQuery>
- Returns:
- the
SampleQueryService
instance
-
getTitle
Returns the fixed title for the sample query details window.- Specified by:
getTitle
in classTitledInitializableWindow
- Returns:
- the string
"Sample query"
-
refresh
protected void refresh()Loads the boundSampleQuery
values into the UI controls (name, description, SQL, prompt context, complexity).- Specified by:
refresh
in classBDOWindow<SampleQuery>
- Implementation Note:
- Invoke on the JavaFX Application Thread.
-
saveChecks
Validates the sample query form and returns human-readable errors. Checks: non-empty name; non-empty SQL that starts withSELECT
(case-insensitive, allowing a newline after SELECT); complexity selected; prompt context non-empty and containing exactly one§§§
placeholder.- Overrides:
saveChecks
in classDetailsWindow<SampleQuery>
- Returns:
- list of validation messages; empty if saving is allowed
-
insertValues
protected void insertValues()Writes the current UI values into the boundSampleQuery
instance (name, description, SQL, prompt context, complexity). Does not persist.- Specified by:
insertValues
in classDetailsWindow<SampleQuery>
-