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.

public class OperableDetailController<I,E extends DetailModel<I>> extends Object
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 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

      public OperableDetailController(org.reactfx.value.Var<E> selectedElement, @Nonnull Removable<E> removable)
  • 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

      public void update(BiConsumer<E,Consumer<E>> updateAction)
      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

      public void remove(BiConsumer<E,Runnable> removeAction)
      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