Module org.tentackle.fx.rdc
Package org.tentackle.fx.rdc
Class DefaultPdoEditor<T extends PersistentDomainObject<T>>
java.lang.Object
org.tentackle.fx.AbstractFxController
org.tentackle.fx.rdc.PdoEditor<T>
org.tentackle.fx.rdc.DefaultPdoEditor<T>
- Type Parameters:
T- the PDO type
- All Implemented Interfaces:
FxController,PdoController<T>,DomainContextProvider,PdoProvider<T>,org.tentackle.validate.ScopeConfigurator
A default pdo editor.
The view is generated from the PDO model via reflection.
The view is generated from the PDO model via reflection.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultPdoEditor(Class<T> pdoClass, ResourceBundle bundle) Creates the default editor from a pdo class. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbind(org.tentackle.bind.BindingMember parent, PdoMember attribute, FxComponent node, String bindingOptions) Binds the node to the PDO member.protected javafx.scene.control.LabelcreateLabel(PdoMember attribute) Creates the label.protected FxComponentcreateNode(PdoMember attribute) Creates an FX node for a given PDO attribute.
Attributes must be bindable.protected Map<PdoMember,FxComponent> Creates a map of attributes to nodes.protected javafx.scene.ParentcreateView(Map<PdoMember, FxComponent> nodes) Creates a view from the nodes map.Gets the optional resource bundle.protected FxComponentgetFirstFocusableNode(Map<PdoMember, FxComponent> nodes) Gets the first focusable node.getPdo()Gets the PDO class.Gets the validation root path.
By default, the server returns validation results with a validation path that starts with the entity baseclassname (the first character in lowercase).voidRequests the initial focus after stage is shown.voidSets the PDO.Methods inherited from class org.tentackle.fx.rdc.PdoEditor
getDomainContext, getValidationMappers, isChangeable, isEditAllowed, isNewAllowed, isRemoveAllowed, isViewAllowed, print, setChangeable, validateFormMethods inherited from class org.tentackle.fx.AbstractFxController
configure, createBinder, getBinder, getContainer, getDefaultScopes, getFXMLFields, getFXMLMethods, getStage, getView, setView, validateInjectionsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.tentackle.pdo.DomainContextProvider
on, opMethods inherited from interface org.tentackle.fx.FxController
configure, getBinder, getContainer, getFXMLFields, getFXMLMethods, getStage, getView, setView, validateInjectionsMethods inherited from interface org.tentackle.pdo.PdoProvider
on
-
Constructor Details
-
DefaultPdoEditor
Creates the default editor from a pdo class.- Parameters:
pdoClass- the PDO classbundle- the optional resource bundle
-
-
Method Details
-
getPdoClass
Gets the PDO class.- Returns:
- the PDO class
-
getBundle
Gets the optional resource bundle.- Returns:
- null if none
-
requestInitialFocus
public void requestInitialFocus()Description copied from class:PdoEditorRequests the initial focus after stage is shown.- Specified by:
requestInitialFocusin classPdoEditor<T extends PersistentDomainObject<T>>
-
getPdo
-
setPdo
Description copied from interface:PdoControllerSets the PDO.- Parameters:
pdo- the pdo
-
getValidationPath
Description copied from class:PdoEditorGets the validation root path.
By default, the server returns validation results with a validation path that starts with the entity baseclassname (the first character in lowercase). If the bound PDO variable of the editor uses a different name, aValidationMapperis necessary to map the results back to the form.
This method is provided to reduce the amount of application code.- Overrides:
getValidationPathin classPdoEditor<T extends PersistentDomainObject<T>>- Returns:
- the validation root path, default is null
- See Also:
-
getFirstFocusableNode
Gets the first focusable node.- Parameters:
nodes- the nodes map- Returns:
- the node, null if none
-
createNode
Creates an FX node for a given PDO attribute.
Attributes must be bindable.- Parameters:
attribute- the PDO attribute- Returns:
- the node, null if skip attribute
- See Also:
-
Bindable
-
bind
protected void bind(org.tentackle.bind.BindingMember parent, PdoMember attribute, FxComponent node, String bindingOptions) Binds the node to the PDO member.- Parameters:
parent- the PDO parent binding memberattribute- the PDO attributenode- the FX nodebindingOptions- the binding options
-
createNodeMap
Creates a map of attributes to nodes.- Returns:
- the node map
-
createView
Creates a view from the nodes map.- Parameters:
nodes- the nodes map- Returns:
- the view
-
createLabel
Creates the label.- Parameters:
attribute- the pdo member- Returns:
- the label node
-