Class OperableDetailController<I,E extends DetailModel<I>>
java.lang.Object
cz.masci.springfx.mvci.controller.impl.OperableDetailController<I,E>
- Type Parameters:
I- The type of the identifier for the detail element.E- The type of the detail element.
The OperableDetailController class is responsible for controlling the operations and state of a detail view.
It handles actions such as saving, discarding, and deleting detail elements.
-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.BooleanPropertyjavafx.beans.property.BooleanPropertyjavafx.beans.property.BooleanProperty -
Constructor Summary
ConstructorsConstructorDescriptionOperableDetailController(org.reactfx.value.Var<E> selectedElement, Removable<E> removable) -
Method Summary
Modifier and TypeMethodDescriptionjavafx.beans.property.BooleanPropertyvoiddiscard()Discards the selected element.javafx.beans.property.BooleanPropertyvoidremove(BiConsumer<E, Runnable> removeAction) Removes the selected element if delete is enabled.javafx.beans.property.BooleanPropertyvoidupdate(BiConsumer<E, Consumer<E>> updateAction) Updates the selected element with the given update action if save is enabled.
-
Property Details
-
saveDisabled
public javafx.beans.property.BooleanProperty saveDisabledProperty -
discardDisabled
public javafx.beans.property.BooleanProperty discardDisabledProperty -
deleteDisabled
public javafx.beans.property.BooleanProperty deleteDisabledProperty
-
-
Constructor Details
-
OperableDetailController
-
-
Method Details
-
saveDisabledProperty
public javafx.beans.property.BooleanProperty saveDisabledProperty() -
discardDisabledProperty
public javafx.beans.property.BooleanProperty discardDisabledProperty() -
deleteDisabledProperty
public javafx.beans.property.BooleanProperty deleteDisabledProperty() -
discard
public void discard()Discards the selected element. If discard is enabled, the method checks if the selected element is transient. If it is, the element is removed from the removable collection. If it is not transient, the element is reset to its initial state. -
update
Updates the selected element with the given update action if save is enabled.- Parameters:
updateAction- the update action to perform on the selected element The action takes two parameters: - the selected element - a consumer to accept the updated element, means to run in FX thread
-
remove
Removes the selected element if delete is enabled. The method executes the given remove action on the selected element and provides a runnable to remove the element from the removable collection.- Parameters:
removeAction- the remove action to perform on the selected element The action takes two parameters: - the selected element - a runnable to remove the element, means to run in FX thread
-