Class AddBudgetController
java.lang.Object
no.ntnu.idatt1002.demo.controller.AddBudgetController
Class that represents the popup dialog box that appears
whenever a budget item is to be added or edited.
The dialog contains various fields that are used to create a new item or edit an existing item.
- Since:
- 24.3.2023
- Author:
- Anders Emil Bergan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the category value from the category combo box.Gets the newly created budget item.void
Initializes the category drop box by filling it with all the values from the ExpenseCategory enum.void
setBudget
(BudgetItem item) Binds the item that is taken in as the argument with a budget item declared in this class.
-
Constructor Details
-
AddBudgetController
public AddBudgetController()
-
-
Method Details
-
initialize
public void initialize()Initializes the category drop box by filling it with all the values from the ExpenseCategory enum. It then sets a prompt text on the box. -
getCategory
Gets the category value from the category combo box.- Returns:
- The category value
-
getNewBudgetItem
Gets the newly created budget item.- Returns:
- The budget item
-
setBudget
Binds the item that is taken in as the argument with a budget item declared in this class. The item of this class is instantiated as a deep copy of the argument. Each attribute of their attributes are then bounded. The text fields and category boxes in the dialog window are then set to the values of the chosen item, as to not display empty values.- Parameters:
item
- The item that is chosen to be edited.
-