Skip to content
Snippets Groups Projects
Commit 84b2a44a authored by Harry Linrui XU's avatar Harry Linrui XU
Browse files

Added comments to explain expense attributes. Added todo for setExpense -...

Added comments to explain expense attributes. Added todo for setExpense - changes are still saved even if the cancel button is clicked when editing an expense
parent 60870d9f
No related branches found
No related tags found
10 merge requests!43Merging frontend-testing into master,!38"Made progressbar dynamic in accordance to spending. Added balance field....,!37Made the sub progress bars respond to changes in expense,!32Added input validation to add dialog boxes.,!30Redesigned scenes,!29Redesigned scenes,!28Redesigned scenes,!26Redesigned Main menu and expense/income windows,!24Merging frontend-testing with master,!23Merging frontend-testing and master
......@@ -26,7 +26,9 @@ import no.ntnu.idatt1002.demo.data.Economics.ExpenseCategory;
import no.ntnu.idatt1002.demo.view.ExpenseRepository;
public class AddExpenseController {
Expense newExpense = null;
Expense newExpense = null; //the expense that is chosen when editing or the expense that is created when adding
Expense oldExpense = null; //an expense that is meant to track the old state of an expense before editing, in case cancel bugtton is clicked
@FXML
private Button cancelBtn;
......@@ -69,8 +71,9 @@ public class AddExpenseController {
return recurringBox.getValue().equals("Yes");
}
public void setExpense(Expense expense) {
public void setExpense(Expense expense) { //TODO NEED CANCEL BUTTON TO REMOVE THE CHANGES IF CANCEL IS PRESSED
this.newExpense = expense;
this.oldExpense = expense;
dateField.textProperty().bindBidirectional(expense.dateProperty());
amountField.textProperty().bindBidirectional(expense.amountProperty(), NumberFormat.getNumberInstance());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment