- java.lang.Object
-
- org.tentackle.fx.rdc.RdcUtilities
-
@Service(RdcUtilities.class) public class RdcUtilities extends java.lang.Object
RDC-related utility methods.- Author:
- harald
-
-
Constructor Summary
Constructors Constructor Description RdcUtilities()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends org.tentackle.pdo.PersistentDomainObject<T>>
TdisplayCrudStage(T pdo, boolean editable, javafx.stage.Modality modality, javafx.stage.Window owner)CRUD of a PDO in a separate window.<T extends org.tentackle.pdo.PersistentDomainObject<T>>
TdisplayCrudStage(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.<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.<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.<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 RdcUtilitiesgetInstance()The singleton.<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.java.lang.BooleanshowSaveDiscardCancelDialog()Shows a question dialog whether to save, discard or cancel editing of a PDO.
-
-
-
Method Detail
-
getInstance
public static RdcUtilities getInstance()
The singleton.- Returns:
- the singleton
-
displayCrudStage
public <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 pdoeditable- true if user may edit the pdo, false if to view onlymodality- the modalityowner- the owner, null if none- Returns:
- the possibly changed pdo if modal
-
displayCrudStage
public <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 pdopdoList- the optional list of PDOs to navigate in the listeditable- true if user may edit the pdo, false if to view onlymodality- the modalityowner- the owner, null if noneconfigurator- optional crud configurator- Returns:
- the possibly changed pdo if modal
-
getCrud
public <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 pdopdoList- the optional list of PDOs to navigate in the listeditable- true if user may edit the pdo, false if to view onlymodality- the modalityowner- the owner, null if none- Returns:
- the CRUD, null if there is already a CRUD editing this PDO.
-
displaySearchStage
public <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 templatemodality- the modalityowner- the owner, null if nonecreatePdoAllowed- 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 <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 templatemodality- the modalityowner- the owner, null if nonecreatePdoAllowed- true if allow to create a new PDO from within the search dialogconfigurator- the optional configurator for the PdoSearch- Returns:
- the selected PDOs if modal, null if not modal
-
getSearch
public <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 pdomodality- the modalityowner- the owner, null if none- Returns:
- the search controller, never null
-
showSaveDiscardCancelDialog
public 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
-
-