- java.lang.Object
-
- org.tentackle.fx.AbstractFxController
-
- All Implemented Interfaces:
FxController,org.tentackle.validate.ScopeConfigurator
public abstract class AbstractFxController extends java.lang.Object implements FxController, org.tentackle.validate.ScopeConfigurator
Base class for tentackle fx controllers.- Author:
- harald
-
-
Constructor Summary
Constructors Constructor Description AbstractFxController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure()Configures the controller as the final step in initialization.protected FxComponentBindercreateBinder()Creates a binder for this form.
The default implementation invokesFormBindingFactory.createFormComponentBinder(this).FxComponentBindergetBinder()Gets the binder of this controller.FxContainergetContainer()Gets the top-level container.
This is usually the view.java.lang.Class<? extends org.tentackle.validate.ValidationScope>[]getDefaultScopes()java.util.List<java.lang.reflect.Field>getFXMLFields()Gets all fields in this controller annotated with @FXML.
The fields are made accessible, if private.java.util.List<java.lang.reflect.Method>getFXMLMethods()Gets all methods in this controller annotated with @FXML.
The methods are made accessible, if private.javafx.stage.StagegetStage()Gets the stage of which the controller's view is the root of the scene.javafx.scene.ParentgetView()Gets the view managed by this controller.voidsetView(javafx.scene.Parent view)Sets the view managed by this controller.voidvalidateInjections()Validate @FXML-annotated fields.
The fxml-loader does not throw an exception if an fx:id does not correspond to a field annotated with @FXML.
-
-
-
Method Detail
-
getView
public javafx.scene.Parent getView()
Description copied from interface:FxControllerGets the view managed by this controller.- Specified by:
getViewin interfaceFxController- Returns:
- the view
-
setView
public void setView(javafx.scene.Parent view)
Description copied from interface:FxControllerSets the view managed by this controller.- Specified by:
setViewin interfaceFxController- Parameters:
view- the view
-
getStage
public javafx.stage.Stage getStage()
Description copied from interface:FxControllerGets the stage of which the controller's view is the root of the scene.- Specified by:
getStagein interfaceFxController- Returns:
- the stage, null if not a root scene
-
getContainer
public FxContainer getContainer()
Description copied from interface:FxControllerGets the top-level container.
This is usually the view.- Specified by:
getContainerin interfaceFxController- Returns:
- the container, null if none
-
getFXMLFields
public java.util.List<java.lang.reflect.Field> getFXMLFields()
Description copied from interface:FxControllerGets all fields in this controller annotated with @FXML.
The fields are made accessible, if private.- Specified by:
getFXMLFieldsin interfaceFxController- Returns:
- the fields
-
getFXMLMethods
public java.util.List<java.lang.reflect.Method> getFXMLMethods()
Description copied from interface:FxControllerGets all methods in this controller annotated with @FXML.
The methods are made accessible, if private.- Specified by:
getFXMLMethodsin interfaceFxController- Returns:
- the methods
-
validateInjections
public void validateInjections()
Description copied from interface:FxControllerValidate @FXML-annotated fields.
The fxml-loader does not throw an exception if an fx:id does not correspond to a field annotated with @FXML. This methods verifies that all such fields provide a non-null value.- Specified by:
validateInjectionsin interfaceFxController
-
getDefaultScopes
public java.lang.Class<? extends org.tentackle.validate.ValidationScope>[] getDefaultScopes()
For bindables defined within this controller, the default scopes are:
MandatoryScopeandChangeableScope.- Specified by:
getDefaultScopesin interfaceorg.tentackle.validate.ScopeConfigurator
-
createBinder
protected FxComponentBinder createBinder()
Creates a binder for this form.
The default implementation invokesFormBindingFactory.createFormComponentBinder(this).- Returns:
- the binder
-
getBinder
public FxComponentBinder getBinder()
Description copied from interface:FxControllerGets the binder of this controller.- Specified by:
getBinderin interfaceFxController- Returns:
- the binder, never null.
-
configure
public void configure()
Description copied from interface:FxControllerConfigures the controller as the final step in initialization.- Specified by:
configurein interfaceFxController
-
-