This commit is contained in:
Andrew Lalis 2023-12-28 11:34:07 -05:00
parent 14e1248b54
commit 69322620ca
6 changed files with 3 additions and 15 deletions

View File

@ -8,8 +8,6 @@ import javafx.fxml.FXML;
import javafx.scene.control.Label; import javafx.scene.control.Label;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;
import java.time.format.DateTimeFormatter;
import static com.andrewlalis.perfin.PerfinApp.router; import static com.andrewlalis.perfin.PerfinApp.router;
public class AccountViewController implements RouteSelectionListener { public class AccountViewController implements RouteSelectionListener {
@ -47,9 +45,7 @@ public class AccountViewController implements RouteSelectionListener {
@FXML @FXML
public void deleteAccount() { public void deleteAccount() {
Profile.getCurrent().getDataSource().useAccountRepository(repo -> { Profile.getCurrent().getDataSource().useAccountRepository(repo -> repo.delete(account));
repo.delete(account);
});
router.getHistory().clear(); router.getHistory().clear();
router.navigate("accounts"); router.navigate("accounts");
} }

View File

@ -1,6 +1,5 @@
package com.andrewlalis.perfin.control.component; package com.andrewlalis.perfin.control.component;
import com.andrewlalis.perfin.data.DateUtil;
import com.andrewlalis.perfin.model.Account; import com.andrewlalis.perfin.model.Account;
import com.andrewlalis.perfin.model.AccountType; import com.andrewlalis.perfin.model.AccountType;
import com.andrewlalis.perfin.model.Profile; import com.andrewlalis.perfin.model.Profile;
@ -10,7 +9,6 @@ import javafx.scene.input.MouseEvent;
import javafx.scene.layout.*; import javafx.scene.layout.*;
import javafx.scene.paint.Color; import javafx.scene.paint.Color;
import java.time.format.DateTimeFormatter;
import java.util.Map; import java.util.Map;
import static com.andrewlalis.perfin.PerfinApp.router; import static com.andrewlalis.perfin.PerfinApp.router;
@ -77,9 +75,7 @@ public class AccountTile extends BorderPane {
accountBalanceLabel.setDisable(false); accountBalanceLabel.setDisable(false);
}); });
this.addEventHandler(MouseEvent.MOUSE_CLICKED, event -> { this.addEventHandler(MouseEvent.MOUSE_CLICKED, event -> router.navigate("account", account));
router.navigate("account", account);
});
} }
private static Label newPropertyLabel(String text) { private static Label newPropertyLabel(String text) {

View File

@ -5,8 +5,6 @@ import com.andrewlalis.perfin.model.Account;
import javafx.application.Platform; import javafx.application.Platform;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.util.Currency; import java.util.Currency;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;

View File

@ -6,7 +6,6 @@ import com.andrewlalis.perfin.model.Account;
import com.andrewlalis.perfin.model.AccountEntry; import com.andrewlalis.perfin.model.AccountEntry;
import com.andrewlalis.perfin.model.Transaction; import com.andrewlalis.perfin.model.Transaction;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;

View File

@ -14,7 +14,6 @@ import java.math.BigDecimal;
import java.sql.Connection; import java.sql.Connection;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Timestamp;
import java.time.Instant; import java.time.Instant;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;

View File

@ -11,7 +11,7 @@
> >
<top> <top>
<VBox> <VBox>
<HBox fx:id="mainHeader"> <HBox>
<Button text="Back" onAction="#goBack"/> <Button text="Back" onAction="#goBack"/>
<Button text="Forward" onAction="#goForward"/> <Button text="Forward" onAction="#goForward"/>
<Button text="Accounts" onAction="#goToAccounts"/> <Button text="Accounts" onAction="#goToAccounts"/>