Class Rdc


  • public class Rdc
    extends java.lang.Object
    Collected factory methods for FX-RDC-related stuff.
    Enhances code readability.
    Author:
    harald
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void closeStageHierarchy​(javafx.scene.Node node)
      Closes the stage hierarchy of given node, except the main stage.
      static <T extends org.tentackle.pdo.PersistentDomainObject<T>>
      PdoCrud<T>
      createPdoCrud​(T pdo, boolean editable, boolean modal)
      Creates a CRUD controller for a pdo.
      static <T extends org.tentackle.pdo.PersistentDomainObject<T>>
      PdoSearch<T>
      createPdoSearch​(T pdo)
      Creates a search controller for a pdo.
      static <T extends org.tentackle.pdo.PersistentDomainObject<T>>
      javafx.scene.control.TreeCell<T>
      createTreeCell()
      Creates a tree cell for a pdo type.
      static <T extends org.tentackle.pdo.PersistentDomainObject<T>>
      T
      displayCrudStage​(T pdo, boolean editable, javafx.stage.Modality modality, javafx.stage.Window owner)
      CRUD of a PDO in a separate window.
      static <T extends org.tentackle.pdo.PersistentDomainObject<T>>
      T
      displayCrudStage​(T pdo, javafx.collections.ObservableList<T> pdoList, boolean editable, javafx.stage.Modality modality, javafx.stage.Window owner, java.util.function.Consumer<PdoCrud<T>> configurator)
      CRUD of a PDO in a separate window.
      static <T extends org.tentackle.pdo.PersistentDomainObject<T>>
      javafx.collections.ObservableList<T>
      displaySearchStage​(T pdo, javafx.stage.Modality modality, javafx.stage.Window owner, boolean createPdoAllowed)
      Searches for PDOs in a separate window.
      static <T extends org.tentackle.pdo.PersistentDomainObject<T>>
      javafx.collections.ObservableList<T>
      displaySearchStage​(T pdo, javafx.stage.Modality modality, javafx.stage.Window owner, boolean createPdoAllowed, java.util.function.Consumer<PdoSearch<T>> configurator)
      Searches for PDOs in a separate window.
      static <T extends org.tentackle.pdo.PersistentDomainObject<T>>
      PdoCrud<T>
      getCrud​(T pdo, javafx.collections.ObservableList<T> pdoList, boolean editable, javafx.stage.Modality modality, javafx.stage.Window owner)
      Gets a CRUD for a PDO.
      If the PDO is already being edited the corresponding stage will be brought to front and null is returned.
      static <T extends org.tentackle.pdo.PersistentDomainObject<T>>
      PdoSearch<T>
      getSearch​(T pdo, javafx.stage.Modality modality, javafx.stage.Window owner)
      Gets a search controller for a PDO.
      static java.lang.Boolean showSaveDiscardCancelDialog()
      Shows a question dialog whether to save, discard or cancel editing of a PDO.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • createPdoCrud

        public static <T extends org.tentackle.pdo.PersistentDomainObject<T>> PdoCrud<T> createPdoCrud​(T pdo,
                                                                                                       boolean editable,
                                                                                                       boolean modal)
        Creates a CRUD controller for a pdo.
        Type Parameters:
        T - the pdo type
        Parameters:
        pdo - the pdo
        editable - true if user may edit the pdo, false if to view only
        modal - true if modal mode
        Returns:
        the crud controller
      • createPdoSearch

        public static <T extends org.tentackle.pdo.PersistentDomainObject<T>> PdoSearch<T> createPdoSearch​(T pdo)
        Creates a search controller for a pdo.
        Type Parameters:
        T - the pdo type
        Parameters:
        pdo - the pdo
        Returns:
        the search controller
      • createTreeCell

        public static <T extends org.tentackle.pdo.PersistentDomainObject<T>> javafx.scene.control.TreeCell<T> createTreeCell()
        Creates a tree cell for a pdo type.
        Type Parameters:
        T - the pdo type
        Returns:
        the tree cell
      • displayCrudStage

        public static <T extends org.tentackle.pdo.PersistentDomainObject<T>> T displayCrudStage​(T pdo,
                                                                                                 boolean editable,
                                                                                                 javafx.stage.Modality modality,
                                                                                                 javafx.stage.Window owner)
        CRUD of a PDO in a separate window.
        Type Parameters:
        T - the pdo type
        Parameters:
        pdo - the pdo
        editable - true if user may edit the pdo, false if to view only
        modality - the modality
        owner - the owner, null if none
        Returns:
        the possibly changed pdo if modal
      • displayCrudStage

        public static <T extends org.tentackle.pdo.PersistentDomainObject<T>> T displayCrudStage​(T pdo,
                                                                                                 javafx.collections.ObservableList<T> pdoList,
                                                                                                 boolean editable,
                                                                                                 javafx.stage.Modality modality,
                                                                                                 javafx.stage.Window owner,
                                                                                                 java.util.function.Consumer<PdoCrud<T>> configurator)
        CRUD of a PDO in a separate window.
        Type Parameters:
        T - the pdo type
        Parameters:
        pdo - the pdo
        pdoList - the optional list of PDOs to navigate in the list
        editable - true if user may edit the pdo, false if to view only
        modality - the modality
        owner - the owner, null if none
        configurator - optional crud configurator
        Returns:
        the possibly changed pdo if modal
      • getCrud

        public static <T extends org.tentackle.pdo.PersistentDomainObject<T>> PdoCrud<T> getCrud​(T pdo,
                                                                                                 javafx.collections.ObservableList<T> pdoList,
                                                                                                 boolean editable,
                                                                                                 javafx.stage.Modality modality,
                                                                                                 javafx.stage.Window owner)
        Gets a CRUD for a PDO.
        If the PDO is already being edited the corresponding stage will be brought to front and null is returned.
        Type Parameters:
        T - the pdo type
        Parameters:
        pdo - the pdo
        pdoList - the optional list of PDOs to navigate in the list
        editable - true if user may edit the pdo, false if to view only
        modality - the modality
        owner - the owner, null if none
        Returns:
        the CRUD, null if there is already a CRUD editing this PDO.
      • displaySearchStage

        public static <T extends org.tentackle.pdo.PersistentDomainObject<T>> javafx.collections.ObservableList<T> displaySearchStage​(T pdo,
                                                                                                                                      javafx.stage.Modality modality,
                                                                                                                                      javafx.stage.Window owner,
                                                                                                                                      boolean createPdoAllowed)
        Searches for PDOs in a separate window.
        Type Parameters:
        T - the pdo type
        Parameters:
        pdo - the pdo as a template
        modality - the modality
        owner - the owner, null if none
        createPdoAllowed - true if allow to create a new PDO from within the search dialog
        Returns:
        the selected PDOs if modal, null if not modal
      • displaySearchStage

        public static <T extends org.tentackle.pdo.PersistentDomainObject<T>> javafx.collections.ObservableList<T> displaySearchStage​(T pdo,
                                                                                                                                      javafx.stage.Modality modality,
                                                                                                                                      javafx.stage.Window owner,
                                                                                                                                      boolean createPdoAllowed,
                                                                                                                                      java.util.function.Consumer<PdoSearch<T>> configurator)
        Searches for PDOs in a separate window.
        Type Parameters:
        T - the pdo type
        Parameters:
        pdo - the pdo as a template
        modality - the modality
        owner - the owner, null if none
        createPdoAllowed - true if allow to create a new PDO from within the search dialog
        configurator - the optional configurator for the PdoSearch
        Returns:
        the selected PDOs if modal, null if not modal
      • getSearch

        public static <T extends org.tentackle.pdo.PersistentDomainObject<T>> PdoSearch<T> getSearch​(T pdo,
                                                                                                     javafx.stage.Modality modality,
                                                                                                     javafx.stage.Window owner)
        Gets a search controller for a PDO.
        Type Parameters:
        T - the pdo type
        Parameters:
        pdo - the pdo
        modality - the modality
        owner - the owner, null if none
        Returns:
        the search controller, never null
      • showSaveDiscardCancelDialog

        public static java.lang.Boolean showSaveDiscardCancelDialog()
        Shows a question dialog whether to save, discard or cancel editing of a PDO.
        Returns:
        true to save, false to discard changes, null to cancel and do nothing
      • closeStageHierarchy

        public static void closeStageHierarchy​(javafx.scene.Node node)
        Closes the stage hierarchy of given node, except the main stage.
        Parameters:
        node - the node