22
33import java .io .IOException ;
44import java .util .Collections ;
5- import java .util .HashMap ;
65import java .util .Map ;
76import java .util .stream .Collectors ;
87
1615import javafx .fxml .FXML ;
1716import javafx .fxml .FXMLLoader ;
1817import javafx .scene .Node ;
19- import javafx .scene .control .Alert .AlertType ;
2018import javafx .scene .control .Label ;
21- import javafx .scene .control .PasswordField ;
22- import javafx .scene .control .TextField ;
2319import javafx .scene .layout .AnchorPane ;
2420import javafx .scene .layout .StackPane ;
2521import javafx .scene .layout .VBox ;
2622import javafx .scene .paint .Paint ;
2723import javafx .scene .text .Text ;
2824import lombok .AllArgsConstructor ;
2925import lombok .Data ;
30- import root .core .domain .JdbcConnectionInfo ;
31- import root .core .domain .JschConnectionInfo ;
3226import root .core .repository .constracts .PropertyRepository ;
3327import root .core .repository .implement .PropertyRepositoryImpl ;
34- import root .javafx .Service .DatabaseConnectService ;
35- import root .utils .AlertUtils ;
3628
3729public class ConnectionInfoVBox extends VBox {
3830
@@ -69,7 +61,7 @@ public class ConnectionInfoVBox extends VBox {
6961 @ FXML
7062 JFXButton nextConnInfoBtn ;
7163
72- private Class <? extends AnchorPane > childAPClazz ;
64+ // private Class<? extends AnchorPane> childAPClazz;
7365
7466 private ConnInfoControl <ConnectionInfoAP > connInfoControl ;
7567
@@ -78,7 +70,7 @@ public class ConnectionInfoVBox extends VBox {
7870 private long connInfoIdx = -1 ;
7971
8072 public ConnectionInfoVBox (Class <? extends AnchorPane > childAPClazz , ConnInfoControl <ConnectionInfoAP > connInfoControl ) {
81- this .childAPClazz = childAPClazz ;
73+ // this.childAPClazz = childAPClazz;
8274 this .connInfoControl = connInfoControl ;
8375
8476 try {
@@ -114,6 +106,8 @@ public void addConnectionInfoAP(int type, Node connInfoAP) {
114106
115107 // TODO 다형성을 이용해 클래스 타입체크 제거하기
116108 public void saveConnInfoSettings (String configFilePath ) {
109+ connInfoControl .save ();
110+ /*
117111 if (childAPClazz == DBConnectionInfoAnchorPane.class) {
118112 Map<String, JdbcConnectionInfo> config = new HashMap<>();
119113
@@ -133,11 +127,14 @@ public void saveConnInfoSettings(String configFilePath) {
133127 }
134128 propertyRepository.saveServerConnectionInfo(configFilePath, config);
135129 }
130+ */
136131 }
137132
138133 /* Button Click Listener */
139134
140135 public void testConnection (ActionEvent e ) {
136+ connInfoControl .test ();
137+ /*
141138 if (childAPClazz == DBConnectionInfoAnchorPane.class) {
142139 // 아이콘 변경
143140 setConnectionBtnIcon(4);
@@ -169,9 +166,12 @@ public void testConnection(ActionEvent e) {
169166 } else if (childAPClazz == ServerConnectionInfoAnchorPane.class) {
170167
171168 }
169+ */
172170 }
173171
174172 public void addNewConnInfo (ActionEvent e ) {
173+ connInfoControl .getNewConnInfoAP ();
174+ /*
175175 if (childAPClazz == DBConnectionInfoAnchorPane.class) {
176176 DBConnectionInfoAnchorPane dbConnAP = new DBConnectionInfoAnchorPane();
177177 dbConnAP.init();
@@ -184,6 +184,7 @@ public void addNewConnInfo(ActionEvent e) {
184184 addConnectionInfoAP(2, serverConnAP);
185185
186186 }
187+ */
187188 }
188189
189190 public void removeConnInfo (ActionEvent e ) {
0 commit comments