Module de.seggebaeing.sqlanalyzer
Class ControllerFactory
java.lang.Object
de.seggebaeing.sqlanalyzer.presentation.util.ControllerFactory
Factory for constructing de.seggebaeing.sqlanalyzer.presentation-layer controllers.
Provides creators for
OverviewWindow
(by BdoWindowType
and optional filter), DetailsWindow
(by concrete
BusinessDomainObject
instance), and general workflow/settings controllers
(by GeneralWindowType
). Throws IllegalArgumentException
for unsupported types.
Intended to be used on the JavaFX Application Thread; does not perform FXML loading.- Since:
- 1.0
- Author:
- Felix Seggebäing
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DetailsWindow
<?> Creates a details controller bound to the given BDO instance by dispatching on its runtime type (SampleQuery, PromptType, LLM, Prompt, GeneratedQuery).static TitledInitializableWindow
createGeneralController
(GeneralWindowType windowType) Creates a controller for the requested general window type (generation/evaluation workflows or their settings dialogs).static OverviewWindow
<?> createOverviewController
(BdoWindowType windowType, Predicate<?> filter) Creates an overview controller for the given BDO window type, optionally applying an external filter.
-
Constructor Details
-
ControllerFactory
public ControllerFactory()
-
-
Method Details
-
createOverviewController
public static OverviewWindow<?> createOverviewController(BdoWindowType windowType, Predicate<?> filter) Creates an overview controller for the given BDO window type, optionally applying an external filter. The filter is cast to the concrete BDO type expected by the controller; unchecked casts are suppressed and rely on the caller to provide a matching predicate.- Parameters:
windowType
- the BDO overview type to instantiatefilter
- optional predicate to pre-filter listed items; may benull
- Returns:
- a new
OverviewWindow
for the requested type - Implementation Note:
- Uses unchecked casts per branch; passing a mismatched predicate type may cause
a
ClassCastException
at runtime.
-
createDetailsController
Creates a details controller bound to the given BDO instance by dispatching on its runtime type (SampleQuery, PromptType, LLM, Prompt, GeneratedQuery).- Parameters:
bdo
- the domain object to display/edit- Returns:
- a new
DetailsWindow
for the object - Throws:
IllegalArgumentException
- if the BDO type is unsupported
-
createGeneralController
Creates a controller for the requested general window type (generation/evaluation workflows or their settings dialogs).- Parameters:
windowType
- the general window type to instantiate- Returns:
- a new
TitledInitializableWindow
instance
-