Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
idatt1002_2023_9
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Kluge Svendsrud
idatt1002_2023_9
Commits
9ba86dbb
Commit
9ba86dbb
authored
1 year ago
by
Harry Linrui XU
Browse files
Options
Downloads
Patches
Plain Diff
Shortened error messages in alert box
parent
869d8d69
No related branches found
No related tags found
3 merge requests
!43
Merging frontend-testing into master
,
!38
"Made progressbar dynamic in accordance to spending. Added balance field....
,
!37
Made the sub progress bars respond to changes in expense
Pipeline
#215833
passed
1 year ago
Stage: build
Stage: test
Stage: package
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/no/ntnu/idatt1002/demo/controller/IncomeExpenseController.java
+17
-21
17 additions, 21 deletions
...nu/idatt1002/demo/controller/IncomeExpenseController.java
with
17 additions
and
21 deletions
src/main/java/no/ntnu/idatt1002/demo/controller/IncomeExpenseController.java
+
17
−
21
View file @
9ba86dbb
...
...
@@ -252,8 +252,7 @@ public class IncomeExpenseController implements FinanceController {
* @param event A button click on the edit button.
*/
@Override
public
void
handleEditBtn
(
javafx
.
event
.
ActionEvent
event
)
{
System
.
out
.
println
(
event
.
getSource
());
public
void
handleEditBtn
(
javafx
.
event
.
ActionEvent
event
)
{
Income
chosenIncome
=
incomeTableView
.
getSelectionModel
().
getSelectedItem
();
Expense
chosenExpense
=
expenseTableView
.
getSelectionModel
().
getSelectedItem
();
...
...
@@ -265,9 +264,6 @@ public class IncomeExpenseController implements FinanceController {
boolean
isDeleteExpense
=
event
.
getSource
()
==
deleteExpenseMenu
;
System
.
out
.
println
(
chosenIncome
);
System
.
out
.
println
(
chosenExpense
);
if
(
isEditIncome
)
{
handleEditIncome
(
chosenIncome
);
}
else
if
(
isDeleteIncome
)
{
...
...
@@ -333,8 +329,8 @@ public class IncomeExpenseController implements FinanceController {
// Set the Dialog's content to the loaded FXML file
dialog
.
getDialogPane
().
setContent
(
loader
.
load
());
}
catch
(
IOException
e
)
{
showErrorDialogBox
(
"Loading"
,
"Error in loading dialog box"
,
"
An error occurre
d"
+
"
while loading
AddIncome window"
);
showErrorDialogBox
(
"Loading"
,
"Error in loading dialog box"
,
"
Could not loa
d"
+
"
the
AddIncome window"
);
}
// Get the controller for the loaded FXML file
...
...
@@ -369,8 +365,8 @@ public class IncomeExpenseController implements FinanceController {
// Set the Dialog's content to the loaded FXML file
dialog
.
getDialogPane
().
setContent
(
loader
.
load
());
}
catch
(
IOException
e
)
{
showErrorDialogBox
(
"Loading"
,
"Error in loading dialog box"
,
"
An error occurre
d"
+
"
while loading
AddExpense window"
);
showErrorDialogBox
(
"Loading"
,
"Error in loading dialog box"
,
"
Could not loa
d"
+
"
the
AddExpense window"
);
}
// Get the controller for the loaded FXML file
...
...
@@ -407,8 +403,8 @@ public class IncomeExpenseController implements FinanceController {
// Set the Dialog's content to the loaded FXML file
dialog
.
getDialogPane
().
setContent
(
loader
.
load
());
}
catch
(
IOException
e
)
{
showErrorDialogBox
(
"Loading"
,
"Error in loading dialog box"
,
"
An error occurre
d"
+
"
while loading
EditIncome window"
);
showErrorDialogBox
(
"Loading"
,
"Error in loading dialog box"
,
"
Could not loa
d"
+
"
the
EditIncome window"
);
}
// Get the controller for the loaded FXML file
...
...
@@ -439,8 +435,8 @@ public class IncomeExpenseController implements FinanceController {
// Set the Dialog's content to the loaded FXML file
dialog
.
getDialogPane
().
setContent
(
loader
.
load
());
}
catch
(
IOException
e
)
{
showErrorDialogBox
(
"Loading"
,
"Error in loading dialog box"
,
"
An error occurred
"
+
"
while loading
EditExpense window"
);
showErrorDialogBox
(
"Loading"
,
"Error in loading dialog box"
,
"
Could not
"
+
"
load the
EditExpense window"
);
}
// Get the controller for the loaded FXML file
...
...
@@ -531,8 +527,8 @@ public class IncomeExpenseController implements FinanceController {
incomeRegister
=
fileHandling
.
readIncomeRegisterFromFile
(
fileName
);
}
}
catch
(
IOException
ioe
)
{
showErrorDialogBox
(
"File reading error"
,
"Error in reading from file"
,
"
An error occurred
"
+
"
while
read
ing
the IncomeRegister from file"
);
showErrorDialogBox
(
"File reading error"
,
"Error in reading from file"
,
"
Could not
"
+
"read the IncomeRegister from file"
);
}
return
incomeRegister
;
}
...
...
@@ -551,8 +547,8 @@ public class IncomeExpenseController implements FinanceController {
expenseRegister
=
fileHandling
.
readExpenseRegisterFromFile
(
fileName
);
}
}
catch
(
IOException
ioe
)
{
showErrorDialogBox
(
"File reading error"
,
"Error in reading from file"
,
"
An error occurred
"
+
"
while
read
ing
the ExpenseRegister from file"
);
showErrorDialogBox
(
"File reading error"
,
"Error in reading from file"
,
"
Could not
"
+
"read the ExpenseRegister from file"
);
}
return
expenseRegister
;
}
...
...
@@ -572,8 +568,8 @@ public class IncomeExpenseController implements FinanceController {
generalBudget
=
fileHandlingBudget
.
readGeneralBudgetFromFile
(
fileName
);
}
}
catch
(
IOException
ioe
)
{
showErrorDialogBox
(
"File reading error"
,
"Error in reading from file"
,
"
An error occurred
"
+
"
while
read
ing
the GeneralBudget from file"
);
showErrorDialogBox
(
"File reading error"
,
"Error in reading from file"
,
"
Could not
"
+
"read the GeneralBudget from file"
);
}
return
generalBudget
;
}
...
...
@@ -595,8 +591,8 @@ public class IncomeExpenseController implements FinanceController {
stage
.
setScene
(
scene
);
stage
.
show
();
}
catch
(
IOException
ioe
)
{
showErrorDialogBox
(
"Loading error"
,
"Error in loading"
,
"
An error occurred
"
+
"
while saving saving to file and loading next window
"
);
showErrorDialogBox
(
"Loading error"
,
"Error in loading"
,
"
Could not save
"
+
"
to file
"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment