Class GridTabController<T>

    • Field Detail

      • itemsGrid

        protected javafx.scene.layout.GridPane itemsGrid
        The grid pane containing the line item rows.
    • Constructor Detail

      • GridTabController

        public GridTabController()
    • Method Detail

      • buildView

        public javafx.scene.layout.GridPane buildView()
        Builds the full tab view including the items grid, separator, and total label.
        Returns:
        a GridPane wrapper containing the complete tab content
      • onClearButtonSet

        protected void onClearButtonSet()
        Called when the clear button is injected. Wires the button to the current checkboxes if the grid has already been built.
        Overrides:
        onClearButtonSet in class BaseController
      • clearAll

        protected void clearAll()
        Clears all checkbox selections, clears all text fields, and refreshes the total.
        Overrides:
        clearAll in class BaseController
      • setTotalSupplier

        public void setTotalSupplier​(java.util.function.Supplier<java.math.BigDecimal> totalSupplier)
        Sets the supplier used to calculate the tab total. The supplier is called whenever the total label needs to be refreshed.
        Parameters:
        totalSupplier - a Supplier returning the current tab total
      • refreshTotal

        protected void refreshTotal()
        Refreshes the total label using the configured totalSupplier. Does nothing if either the supplier or the label has not been initialized.
        Overrides:
        refreshTotal in class BaseController
      • addValidationPair

        protected void addValidationPair​(javafx.scene.control.CheckBox cb,
                                         javafx.beans.value.ObservableValue<java.math.BigDecimal> priceProperty)
        Registers a checkbox/price pair for validation. The nav buttons are disabled while the checkbox is selected but the price is null or zero.
        Parameters:
        cb - the checkbox to observe
        priceProperty - the price property that must be greater than zero when checked
      • hasInvalidSelections

        public javafx.beans.binding.BooleanBinding hasInvalidSelections()
        Returns a binding that is true when any checked item is missing a required price.
        Overrides:
        hasInvalidSelections in class BaseController
        Returns:
        a BooleanBinding indicating whether any checked item is missing a required price
      • getItems

        protected abstract java.util.List<T> getItems()
        Returns the list of line items to display in this tab.
        Returns:
        the list of items of type T
      • addItemRow

        protected abstract javafx.scene.control.CheckBox addItemRow​(T item,
                                                                    int row)
        Builds and adds a single row to the items grid for the given line item.
        Parameters:
        item - the line item to render
        row - the grid row index
        Returns:
        the CheckBox created for this row