Module org.tentackle.fx.rdc
Package org.tentackle.fx.rdc.translate
Class PdoComponentAddon<T extends PersistentDomainObject<T>>
java.lang.Object
org.tentackle.fx.rdc.translate.PdoComponentAddon<T>
- Type Parameters:
T- the PDO type
Adds style, context-menu, DnD and function-keys to components bound to a PDO.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPdoComponentAddon(FxComponent component, Supplier<T> pdoSupplier, Consumer<T> pdoConsumer) Creates the addon. -
Method Summary
Modifier and TypeMethodDescriptionCreates a new PDO.voidedit()Edit or view current pdo.getAllPdos(T proxy) Returns a collection of all PDOs.
Used in ComboBoxes and ChoiceBoxes to initialize the component's item list.Gets the fx component.Gets the domain context from the binding properties.javafx.util.Callback<T, Collection<T>> Gets the callback to load all PDOs.
Used bygetAllPdos(PersistentDomainObject).getPdo()Gets the PDO.Gets the consumer for the PDO.Gets the supplier for the currently displayed PDO.booleanReturns whether search or edit dialog is currently displayed.protected Collection<T> loadAllPdos(T proxy) Default implementation for thegetLoadAllPdosCallback().voidsearch()Search for a PDO.voidModal search of the pdo.voidsetLoadAllPdosCallback(javafx.util.Callback<T, Collection<T>> loadAllPdosCallback) Sets the callback to load all PDOs.
Used bygetAllPdos(PersistentDomainObject).voidSets the PDO.
-
Field Details
-
PDO_STYLE
The PDO style.
Remove this style to disable PDO features.- See Also:
-
-
Constructor Details
-
PdoComponentAddon
Creates the addon.- Parameters:
component- the fx componentpdoSupplier- a supplier for the currently displayed PDOpdoConsumer- a consumer for the PDO (changed by DnD)
-
-
Method Details
-
getComponent
Gets the fx component.- Returns:
- the fx component
-
getPdoSupplier
Gets the supplier for the currently displayed PDO.- Returns:
- the supplier for the currently displayed PDO
-
getPdoConsumer
Gets the consumer for the PDO.- Returns:
- the consumer for the PDO
-
getPdo
Gets the PDO.- Returns:
- the pdo
-
setPdo
Sets the PDO.- Parameters:
pdo- the pdo
-
getAllPdos
Returns a collection of all PDOs.
Used in ComboBoxes and ChoiceBoxes to initialize the component's item list.- Parameters:
proxy- the proxy pdo- Returns:
- the collection of all PDOs
-
getLoadAllPdosCallback
Gets the callback to load all PDOs.
Used bygetAllPdos(PersistentDomainObject).- Returns:
- the callback
-
setLoadAllPdosCallback
Sets the callback to load all PDOs.
Used bygetAllPdos(PersistentDomainObject).- Parameters:
loadAllPdosCallback- the callback
-
isInSearchOrEdit
public boolean isInSearchOrEdit()Returns whether search or edit dialog is currently displayed.- Returns:
- true if within search or edit
-
edit
public void edit()Edit or view current pdo. -
search
public void search()Search for a PDO. -
createPdo
Creates a new PDO.- Returns:
- the pdo
-
getDomainContext
Gets the domain context from the binding properties.- Returns:
- the domain context, null if not defined in properties
-
searchPdo
Modal search of the pdo.- Parameters:
proxy- the proxy pdo (possibly preset with partial search criteria)selectedItem- the consumer for the selected pdo, invoked with null if no pdo found
-
loadAllPdos
Default implementation for thegetLoadAllPdosCallback().- Parameters:
proxy- the PDO proxy- Returns:
- the collection of PDOs
-