Class ServicesController
- java.lang.Object
-
- com.palmer.billingstatementgenerator.views.controllers.BaseController
-
- com.palmer.billingstatementgenerator.views.controllers.GridTabController<ServiceLineItem>
-
- com.palmer.billingstatementgenerator.views.controllers.ServicesController
-
public class ServicesController extends GridTabController<ServiceLineItem>
Controller for the Services, Facilities & Transportation tab. ExtendsGridTabControllerwith an additional service packageComboBoxabove the services grid. When a package is selected, service checkboxes are automatically set to match the package's defined service list. Overrides clear button configuration to account for the combo box selection, and overridesclearAll()to also reset the combo box.
-
-
Field Summary
-
Fields inherited from class com.palmer.billingstatementgenerator.views.controllers.GridTabController
itemsGrid
-
Fields inherited from class com.palmer.billingstatementgenerator.views.controllers.BaseController
clearButton, DOLLAR_FORMATTER, nextButton
-
-
Constructor Summary
Constructors Constructor Description ServicesController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javafx.scene.control.CheckBoxaddItemRow(ServiceLineItem item, int row)Builds a row for the given service line item, consisting of a checkbox and a read-only price label.javafx.scene.layout.GridPanebuildView()Builds the tab view by first populating the packages combo box, then delegating to the parent to build the services grid.protected voidclearAll()Clears all service checkboxes and resets the packages combo box selection.protected voidconfigureClearButton(java.util.List<javafx.scene.control.CheckBox> checkBoxes)Overrides clear button configuration to also observe the packages combo box value.protected java.util.List<ServiceLineItem>getItems()Returns the list of service line items from the current statement.-
Methods inherited from class com.palmer.billingstatementgenerator.views.controllers.GridTabController
addValidationPair, hasInvalidSelections, onClearButtonSet, refreshTotal, reset, setTotalSupplier
-
Methods inherited from class com.palmer.billingstatementgenerator.views.controllers.BaseController
bindIntegerTextField, buildCheckBox, buildPriceField, buildPriceLabel, buildTextField, configTextFieldForInts, onHide, onNextButtonSet, onShow, setClearButton, setNextButton, wireTextFieldToCheckBox
-
-
-
-
Method Detail
-
buildView
public javafx.scene.layout.GridPane buildView()
Builds the tab view by first populating the packages combo box, then delegating to the parent to build the services grid. The combo and grid are arranged vertically in a wrapperGridPane.- Overrides:
buildViewin classGridTabController<ServiceLineItem>- Returns:
- a
GridPanecontaining the combo box and services grid
-
getItems
protected java.util.List<ServiceLineItem> getItems()
Returns the list of service line items from the current statement.- Specified by:
getItemsin classGridTabController<ServiceLineItem>- Returns:
- the list of
ServiceLineItemobjects
-
addItemRow
protected javafx.scene.control.CheckBox addItemRow(ServiceLineItem item, int row)
Builds a row for the given service line item, consisting of a checkbox and a read-only price label.- Specified by:
addItemRowin classGridTabController<ServiceLineItem>- Parameters:
item- the service line item to renderrow- the grid row index- Returns:
- the
CheckBoxcreated for this row
-
configureClearButton
protected void configureClearButton(java.util.List<javafx.scene.control.CheckBox> checkBoxes)
Overrides clear button configuration to also observe the packages combo box value. The clear button is disabled only when no checkboxes are selected AND no package is selected.- Overrides:
configureClearButtonin classBaseController- Parameters:
checkBoxes- the list of service checkboxes to observe
-
clearAll
protected void clearAll()
Clears all service checkboxes and resets the packages combo box selection.- Overrides:
clearAllin classGridTabController<ServiceLineItem>
-
-