Class PdoEditor<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
    Direct Known Subclasses:
    DefaultPdoEditor, PdoViewer, SecurityEditor

    public abstract class PdoEditor<T extends org.tentackle.pdo.PersistentDomainObject<T>>
    extends org.tentackle.fx.AbstractFxController
    implements org.tentackle.pdo.PdoHolder<T>, org.tentackle.pdo.DomainContextProvider
    FxController to edit a PDO.
    Author:
    harald
    • Constructor Summary

      Constructors 
      Constructor Description
      PdoEditor()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      org.tentackle.pdo.DomainContext getDomainContext()  
      java.util.NavigableSet<org.tentackle.validate.ValidationMapper> getValidationMappers()
      Gets the validation mappers to map the validation results to the controls.
      If getValidationPath() returns a non-null value, a set with a default mapper will be created.
      java.lang.String getValidationPath()
      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).
      boolean isChangeable()
      Get the changeable property of the editor's view.
      boolean isEditAllowed()
      Returns whether the user has sufficient permissions to edit the PDO.
      boolean isNewAllowed()
      Returns whether the user is allowed to create a new PDO.
      boolean isRemoveAllowed()
      Returns whether the user is allowed to edit the PDO and the PDO is removable.
      boolean isViewAllowed()
      Returns whether the user has sufficient permissions to view the PDO.
      void print()
      Prints the current PDO.
      abstract void requestInitialFocus()
      Requests the initial focus after stage is shown.
      void setChangeable​(boolean changeable)
      Set the changeable property of the editor's view.
      boolean validateForm()
      Validates the form before the PDO get saved.
      This can be used for validations that are not covered by the persistence model, for example password confirmation.
      • 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

        getPdo, on, setPdo
    • Constructor Detail

      • PdoEditor

        public PdoEditor()
    • Method Detail

      • requestInitialFocus

        public abstract void requestInitialFocus()
        Requests the initial focus after stage is shown.
      • getDomainContext

        public org.tentackle.pdo.DomainContext getDomainContext()
        Specified by:
        getDomainContext in interface org.tentackle.pdo.DomainContextProvider
      • isViewAllowed

        public boolean isViewAllowed()
        Returns whether the user has sufficient permissions to view the PDO.
        Returns:
        true if allowed
      • isEditAllowed

        public boolean isEditAllowed()
        Returns whether the user has sufficient permissions to edit the PDO.
        Returns:
        true if allowed
      • isRemoveAllowed

        public boolean isRemoveAllowed()
        Returns whether the user is allowed to edit the PDO and the PDO is removable.
        Returns:
        true if remove allowed
      • isNewAllowed

        public boolean isNewAllowed()
        Returns whether the user is allowed to create a new PDO.
        Returns:
        true if creation allowed
      • getValidationPath

        public java.lang.String getValidationPath()
        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). If the bound PDO variable of the editor uses a different name, a ValidationMapper is necessary to map the results back to the form.
        This method is provided to reduce the amount of application code.
        Returns:
        the validation root path, default is null
        See Also:
        getValidationMappers()
      • getValidationMappers

        public java.util.NavigableSet<org.tentackle.validate.ValidationMapper> getValidationMappers()
        Gets the validation mappers to map the validation results to the controls.
        If getValidationPath() returns a non-null value, a set with a default mapper will be created.
        Returns:
        the mappers, null if none
      • validateForm

        public boolean validateForm()
        Validates the form before the PDO get saved.
        This can be used for validations that are not covered by the persistence model, for example password confirmation.
        Returns:
        true if ok
      • print

        public void print()
        Prints the current PDO.
      • setChangeable

        public void setChangeable​(boolean changeable)
        Set the changeable property of the editor's view.
        Parameters:
        changeable - true if changeable
      • isChangeable

        public boolean isChangeable()
        Get the changeable property of the editor's view.
        Returns:
        true if changeable