From 15119bd51567654181e5b815d72b3ddf82f9d618 Mon Sep 17 00:00:00 2001
From: Harry Linrui XU <xulr0820@hotmail.com>
Date: Fri, 14 Apr 2023 11:59:16 +0200
Subject: [PATCH] Added button that brings up popup, explaining how to edit or
 delete income/expense

---
 .../demo/controller/IncomeExpenseController.java      | 11 ++++++++++-
 src/main/resources/view/IncomeAndExpenses.fxml        |  1 +
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/main/java/no/ntnu/idatt1002/demo/controller/IncomeExpenseController.java b/src/main/java/no/ntnu/idatt1002/demo/controller/IncomeExpenseController.java
index 7b07a818..c67d16b7 100644
--- a/src/main/java/no/ntnu/idatt1002/demo/controller/IncomeExpenseController.java
+++ b/src/main/java/no/ntnu/idatt1002/demo/controller/IncomeExpenseController.java
@@ -40,6 +40,15 @@ import no.ntnu.idatt1002.demo.data.Economics.Income;
 import no.ntnu.idatt1002.demo.data.Economics.IncomeCategory;
 import no.ntnu.idatt1002.demo.data.Economics.IncomeRegister;
 
+/**
+ * Class for representing an overview of the income and expenses of the users budget.
+ * Displays information in tables and pie charts. It is possible to add, edit and delete
+ * income and expenses. The difference of the expense and income sum contribute to
+ * the monthly budget progress.
+
+ * @author Harry Linrui Xu
+ * @since 30.03.2023
+ */
 public class IncomeExpenseController implements FinanceController {
   private final static String sumText = "Sum: ";
   @FXML
@@ -480,7 +489,6 @@ public class IncomeExpenseController implements FinanceController {
 
     return alert.showAndWait();
   }
-
   /**
    * Saves the changes made to the tableview by writing the information to a file.
    * @throws IOException If an error occurs while writing to the file.
@@ -491,6 +499,7 @@ public class IncomeExpenseController implements FinanceController {
     fileHandling.writeItemRegisterToFile(expenseRegister, "Expense");
   }
 
+
   /**
    * Method that either reads data from a file with which it fills an income register, if older changes exist, or instantiates an income register if the file is empty.
    * @param fileName The name of the file that is being read from.
diff --git a/src/main/resources/view/IncomeAndExpenses.fxml b/src/main/resources/view/IncomeAndExpenses.fxml
index dc5c4fa5..ace8dac9 100644
--- a/src/main/resources/view/IncomeAndExpenses.fxml
+++ b/src/main/resources/view/IncomeAndExpenses.fxml
@@ -95,6 +95,7 @@
                               </ImageView>
                            </graphic>
                         </MenuButton>
+                        <Button mnemonicParsing="false" text="popup explaining how to edit/delete" />
                      </children>
                      <BorderPane.margin>
                         <Insets left="30.0" />
-- 
GitLab