Module org.tentackle.fx.rdc
Package org.tentackle.fx.rdc
Class DefaultPdoEditor<T extends org.tentackle.pdo.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:
org.tentackle.fx.FxController,org.tentackle.pdo.DomainContextProvider,org.tentackle.pdo.PdoHolder<T>,org.tentackle.validate.ScopeConfigurator
public class DefaultPdoEditor<T extends org.tentackle.pdo.PersistentDomainObject<T>> extends PdoEditor<T>
A default pdo editor.
The view is generated from the PDO model via reflection.
-
-
Constructor Summary
Constructors Constructor Description DefaultPdoEditor(java.lang.Class<T> pdoClass, java.util.ResourceBundle bundle)Creates the default editor from a pdo class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbind(org.tentackle.bind.BindingMember parent, org.tentackle.pdo.PdoMember attribute, org.tentackle.fx.FxComponent node, java.lang.String bindingOptions)Binds the node to the PDO member.protected javafx.scene.control.LabelcreateLabel(org.tentackle.pdo.PdoMember attribute)Creates the label.protected org.tentackle.fx.FxComponentcreateNode(org.tentackle.pdo.PdoMember attribute)Creates an FX node for a given PDO attribute.
Attributes must be bindable.protected java.util.Map<org.tentackle.pdo.PdoMember,org.tentackle.fx.FxComponent>createNodeMap()Creates a map of attributes to nodes.protected javafx.scene.ParentcreateView(java.util.Map<org.tentackle.pdo.PdoMember,org.tentackle.fx.FxComponent> nodes)Creates a view from the nodes map.java.util.ResourceBundlegetBundle()Gets the optional resource bundle.protected org.tentackle.fx.FxComponentgetFirstFocusableNode(java.util.Map<org.tentackle.pdo.PdoMember,org.tentackle.fx.FxComponent> nodes)Gets the first focusable node.TgetPdo()java.lang.Class<T>getPdoClass()Gets the PDO class.voidrequestInitialFocus()Requests the initial focus after stage is shown.voidsetPdo(T pdo)-
Methods inherited from class org.tentackle.fx.rdc.PdoEditor
getDomainContext, getValidationMappers, isChangeable, isEditAllowed, isNewAllowed, isRemoveAllowed, isViewAllowed, print, setChangeable, validateForm
-
Methods inherited from class org.tentackle.fx.AbstractFxController
configure, createBinder, getBinder, getContainer, getDefaultScopes, getFXMLFields, getFXMLMethods, getStage, getView, setView, validateInjections
-
-
-
-
Constructor Detail
-
DefaultPdoEditor
public DefaultPdoEditor(java.lang.Class<T> pdoClass, java.util.ResourceBundle bundle)
Creates the default editor from a pdo class.- Parameters:
pdoClass- the PDO classbundle- the optional resource bundle
-
-
Method Detail
-
getPdoClass
public java.lang.Class<T> getPdoClass()
Gets the PDO class.- Returns:
- the PDO class
-
getBundle
public java.util.ResourceBundle 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 org.tentackle.pdo.PersistentDomainObject<T>>
-
getPdo
public T getPdo()
-
setPdo
public void setPdo(T pdo)
-
getFirstFocusableNode
protected org.tentackle.fx.FxComponent getFirstFocusableNode(java.util.Map<org.tentackle.pdo.PdoMember,org.tentackle.fx.FxComponent> nodes)
Gets the first focusable node.- Parameters:
nodes- the nodes map- Returns:
- the node, null if none
-
createNode
protected org.tentackle.fx.FxComponent createNode(org.tentackle.pdo.PdoMember attribute)
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, org.tentackle.pdo.PdoMember attribute, org.tentackle.fx.FxComponent node, java.lang.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
protected java.util.Map<org.tentackle.pdo.PdoMember,org.tentackle.fx.FxComponent> createNodeMap()
Creates a map of attributes to nodes.- Returns:
- the node map
-
createView
protected javafx.scene.Parent createView(java.util.Map<org.tentackle.pdo.PdoMember,org.tentackle.fx.FxComponent> nodes)
Creates a view from the nodes map.- Parameters:
nodes- the nodes map- Returns:
- the view
-
createLabel
protected javafx.scene.control.Label createLabel(org.tentackle.pdo.PdoMember attribute)
Creates the label.- Parameters:
attribute- the pdo member- Returns:
- the label node
-
-