Tournament list #11

Merged
schrom01 merged 13 commits from TournamentList into main 2022-05-01 18:45:02 +02:00
2 changed files with 11 additions and 7 deletions
Showing only changes of commit 678060ecc0 - Show all commits

View File

@ -50,6 +50,15 @@ public class TournamentDecorator implements IsObservable{
} }
} }
public void deleteTournament(FileIO.TournamentFile tournamentFile){
try {
fileIO.deleteTournament(tournamentFile);
informListener();
} catch (IOException e) {
e.printStackTrace(); //TODO handle and logging
}
}
public void informListener() { public void informListener() {
for(IsObserver observer : listener) { for(IsObserver observer : listener) {

View File

@ -67,15 +67,10 @@ public class TournamentListController extends FXController {
@FXML @FXML
void deleteTournament(ActionEvent event) { void deleteTournament(ActionEvent event) {
File tournamentFile = tournamentListView.getSelectionModel().getSelectedItems().get(0); FileIO.TournamentFile tournamentFile = tournamentListView.getSelectionModel().getSelectedItems().get(0);
AlertDelete alert = new AlertDelete(tournamentFile.toString()); AlertDelete alert = new AlertDelete(tournamentFile.toString());
if(alert.showAndGetResult()){ if(alert.showAndGetResult()){
try { getTournamentDecorator().deleteTournament(tournamentFile);
getFileIO().deleteTournament(tournamentFile);
loadContent();
} catch (IOException e) {
e.printStackTrace(); //TODO handle and logging
}
} }
} }