explicit exit as implicit exit is disabled

This commit is contained in:
Andreas Billmann
2015-12-30 09:51:43 +01:00
parent af5c64426c
commit 0b6d6edda6

View File

@@ -36,6 +36,8 @@ import javafx.stage.WindowEvent;
import org.springframework.context.annotation.*; import org.springframework.context.annotation.*;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import static javafx.application.Platform.exit;
@Configuration @Configuration
@ComponentScan("ninja.javafx") @ComponentScan("ninja.javafx")
@PropertySource(value = "classpath:/ninja/javafx/smartcsv/fx/application.properties") @PropertySource(value = "classpath:/ninja/javafx/smartcsv/fx/application.properties")
@@ -89,6 +91,8 @@ public class SmartCSV extends Application {
primaryStage.setOnCloseRequest(event -> { primaryStage.setOnCloseRequest(event -> {
if (!smartCVSController.canExit()) { if (!smartCVSController.canExit()) {
event.consume(); event.consume();
} else {
exit();
} }
}); });
} }