11package com .xwintop .xJavaFxTool .controller .index ;
22
3- import com .xwintop .xJavaFxTool .controller .IndexController ;
43import com .xwintop .xJavaFxTool .services .index .SystemSettingService ;
54import com .xwintop .xJavaFxTool .utils .XJavaFxSystemUtil ;
65import com .xwintop .xJavaFxTool .view .index .SystemSettingView ;
7- import com .xwintop .xcore .util .javafx .JavaFxViewUtil ;
8- import javafx .event .ActionEvent ;
9- import javafx .fxml .FXML ;
10- import javafx .fxml .FXMLLoader ;
11- import javafx .scene .Parent ;
12- import javafx .stage .Modality ;
6+ import java .net .URL ;
7+ import java .util .ResourceBundle ;
138import javafx .stage .Stage ;
149import lombok .Getter ;
1510import lombok .Setter ;
1611import lombok .extern .slf4j .Slf4j ;
1712import org .apache .commons .configuration .PropertiesConfiguration ;
1813
19- import java .net .URL ;
20- import java .util .ResourceBundle ;
21-
2214/**
2315 * @ClassName: SystemSettingController
2416 * @Description: 设置页面
3022@ Setter
3123@ Slf4j
3224public class SystemSettingController extends SystemSettingView {
25+
3326 private SystemSettingService systemSettingService = new SystemSettingService (this );
34- private Stage newStage = null ;
3527
36- //显示设置界面
37- public static void showSystemSetting (String title ) throws Exception {
38- FXMLLoader fXMLLoader = new FXMLLoader (IndexController .class .getResource ("/com/xwintop/xJavaFxTool/fxmlView/index/SystemSetting.fxml" ));
39- Parent root = fXMLLoader .load ();
40- SystemSettingController systemSettingController = fXMLLoader .getController ();
41- Stage newStage = JavaFxViewUtil .getNewStageNull (title , null , root , -1 , -1 , false , false , false );
42- newStage .initModality (Modality .APPLICATION_MODAL );
43- systemSettingController .setNewStage (newStage );
44- newStage .showAndWait ();
45- }
28+ private Stage newStage = null ;
4629
4730 @ Override
4831 public void initialize (URL location , ResourceBundle resources ) {
4932 initView ();
50- initEvent ();
51- initService ();
5233 }
5334
5435 private void initView () {
@@ -60,17 +41,9 @@ private void initView() {
6041 } catch (Exception e ) {
6142 log .error ("加载配置失败:" , e );
6243 }
63-
64- }
65-
66- private void initEvent () {
67- }
68-
69- private void initService () {
7044 }
7145
72- @ FXML
73- private void saveAction (ActionEvent event ) {
46+ public void applySettings () {
7447 try {
7548 PropertiesConfiguration xmlConfigure = XJavaFxSystemUtil .getSystemConfigure ();
7649 xmlConfigure .setProperty ("exitShowAlertCheckBox" , exitShowAlertCheckBox .isSelected ());
@@ -84,11 +57,4 @@ private void saveAction(ActionEvent event) {
8457 log .error ("保存配置失败:" , e );
8558 }
8659 }
87-
88- @ FXML
89- private void cancelAction (ActionEvent event ) {
90- if (newStage != null ) {
91- newStage .close ();
92- }
93- }
9460}
0 commit comments