Class DefaultPdoEditor<T extends org.tentackle.pdo.PersistentDomainObject<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 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.
      protected javafx.scene.control.Label createLabel​(org.tentackle.pdo.PdoMember attribute)
      Creates the label.
      protected org.tentackle.fx.FxComponent createNode​(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.Parent createView​(java.util.Map<org.tentackle.pdo.PdoMember,​org.tentackle.fx.FxComponent> nodes)
      Creates a view from the nodes map.
      java.util.ResourceBundle getBundle()
      Gets the optional resource bundle.
      protected org.tentackle.fx.FxComponent getFirstFocusableNode​(java.util.Map<org.tentackle.pdo.PdoMember,​org.tentackle.fx.FxComponent> nodes)
      Gets the first focusable node.
      T getPdo()  
      java.lang.Class<T> getPdoClass()
      Gets the PDO class.
      void requestInitialFocus()
      Requests the initial focus after stage is shown.
      void setPdo​(T pdo)  
      • Methods inherited from class org.tentackle.fx.AbstractFxController

        configure, createBinder, getBinder, getContainer, getDefaultScopes, getFXMLFields, getFXMLMethods, getStage, getView, setView, validateInjections
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.tentackle.pdo.DomainContextProvider

        on, op
      • Methods inherited from interface org.tentackle.pdo.PdoHolder

        on
    • 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 class
        bundle - 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: PdoEditor
        Requests the initial focus after stage is shown.
        Specified by:
        requestInitialFocus in class PdoEditor<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 member
        attribute - the PDO attribute
        node - the FX node
        bindingOptions - 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