Module de.seggebaeing.sqlanalyzer
Class PromptDetailsController
java.lang.Object
de.seggebaeing.sqlanalyzer.presentation.uielements.window.TitledInitializableWindow
de.seggebaeing.sqlanalyzer.presentation.uielements.window.BDOWindow<Prompt>
de.seggebaeing.sqlanalyzer.presentation.uielements.window.DetailsWindow<Prompt>
de.seggebaeing.sqlanalyzer.presentation.controller.details.PromptDetailsController
- All Implemented Interfaces:
javafx.fxml.Initializable
Details/edit window controller for a single
Prompt
.
Initializes and populates sample-query and prompt-type selectors (with custom cells, sorted),
loads values into controls, validates inputs, and writes changes back on save.
Includes contextual help integration.- 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
ConstructorsConstructorDescriptionPromptDetailsController
(Prompt object) Creates a details controller bound to the givenPrompt
. -
Method Summary
Modifier and TypeMethodDescriptionprotected PromptService
Returns the service used to load and persist prompt objects.getTitle()
Returns the fixed title for the prompt details window.void
initialize
(URL location, ResourceBundle resources) Initializes the prompt details view: delegates tosuper.initialize
, enables contextual help, and populates the sample query and prompt type combo boxes.protected void
Writes the current UI values into the boundPrompt
(text, sample query, and type).protected void
refresh()
Loads the boundPrompt
into the controls (text, sample query, and type).Validates the prompt 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
-
PromptDetailsController
Creates a details controller bound to the givenPrompt
.- Parameters:
object
- the prompt to display and edit; expected non-null
-
-
Method Details
-
initialize
Initializes the prompt details view: delegates tosuper.initialize
, enables contextual help, and populates the sample query and prompt type combo boxes.- Specified by:
initialize
in interfacejavafx.fxml.Initializable
- Overrides:
initialize
in classDetailsWindow<Prompt>
- 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 prompt objects.- Specified by:
getService
in classBDOWindow<Prompt>
- Returns:
- the
PromptService
instance
-
getTitle
Returns the fixed title for the prompt details window.- Specified by:
getTitle
in classTitledInitializableWindow
- Returns:
- the string
"Prompt"
-
refresh
protected void refresh()Loads the boundPrompt
into the controls (text, sample query, and type). -
saveChecks
Validates the prompt form and returns human-readable errors. Checks: non-empty prompt text, selected sample query, and selected type.- Overrides:
saveChecks
in classDetailsWindow<Prompt>
- Returns:
- list of validation messages; empty if saving is allowed
-
insertValues
protected void insertValues()Writes the current UI values into the boundPrompt
(text, sample query, and type). Does not persist.- Specified by:
insertValues
in classDetailsWindow<Prompt>
-