Module de.seggebaeing.sqlanalyzer
Class TitledInitializableWindow
java.lang.Object
de.seggebaeing.sqlanalyzer.presentation.uielements.window.TitledInitializableWindow
- All Implemented Interfaces:
javafx.fxml.Initializable
- Direct Known Subclasses:
BDOWindow
,EvaluationSettingsController
,GenerationSettingsController
,HelpWindow
,HomeController
,WorkerWindow
Abstract base class for titled JavaFX FXML controllers/windows.
Provides common wiring for an optional “help” control, window closing,
and convenient access to the root node and owning
Stage
.
Subclasses must supply a title via getTitle()
and are expected to
declare root
and (optionally) helpControl
in their FXML.
Use on the JavaFX Application Thread.- Since:
- 1.0
- Author:
- Felix Seggebäing
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Requests this window to close by firing aWindowEvent.WINDOW_CLOSE_REQUEST
on the owningStage
.protected void
enableHelp
(String htmlFileName) Enables the window’s help affordance by wiring the configured help control to open a help window for the given HTML resource and by setting a tooltip.javafx.scene.layout.Region
getRoot()
Returns the FXML-injected root region of this window/controller.javafx.stage.Stage
getStage()
Resolves the owningStage
from this controller’s root node.abstract String
getTitle()
Returns the window title to display (e.g., in the stage title bar).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javafx.fxml.Initializable
initialize
-
Field Details
-
root
protected javafx.scene.layout.Region root
-
-
Constructor Details
-
TitledInitializableWindow
public TitledInitializableWindow()
-
-
Method Details
-
getTitle
Returns the window title to display (e.g., in the stage title bar).- Returns:
- the human-readable title string; subclasses provide the value
-
enableHelp
Enables the window’s help affordance by wiring the configured help control to open a help window for the given HTML resource and by setting a tooltip. Uses an action handler forButton
controls, otherwise a mouse click handler.- Parameters:
htmlFileName
- the help document identifier or file name- Throws:
IllegalStateException
- if nohelpControl
is available- Implementation Note:
- Must be invoked on the JavaFX Application Thread.
-
closeWindow
protected void closeWindow()Requests this window to close by firing aWindowEvent.WINDOW_CLOSE_REQUEST
on the owningStage
. Logs an error if the stage cannot be resolved.- Implementation Note:
- Invoke on the JavaFX Application Thread.
-
getStage
public javafx.stage.Stage getStage()Resolves the owningStage
from this controller’s root node.- Returns:
- the stage if the scene/window is attached;
null
otherwise - Implementation Note:
- Invoke on the JavaFX Application Thread.
-
getRoot
public javafx.scene.layout.Region getRoot()Returns the FXML-injected root region of this window/controller.- Returns:
- the root
Region
; may benull
before FXML initialization
-