|
1 | 1 | package com.zhazhapan.vspider.controller; |
2 | 2 |
|
| 3 | +import com.zhazhapan.util.Checker; |
3 | 4 | import com.zhazhapan.vspider.SpiderApplication; |
| 5 | +import com.zhazhapan.vspider.models.MysqlConfig; |
4 | 6 | import javafx.fxml.FXML; |
5 | 7 | import javafx.scene.control.CheckBox; |
6 | 8 | import javafx.scene.control.TextArea; |
7 | 9 | import javafx.scene.control.TextField; |
| 10 | +import javafx.util.Pair; |
8 | 11 |
|
9 | 12 | /** |
10 | 13 | * @author pantao |
@@ -45,5 +48,21 @@ public class CustomCrawlingController { |
45 | 48 | @FXML |
46 | 49 | private void initialize() { |
47 | 50 | SpiderApplication.customCrawlingController = this; |
| 51 | + mappings.setWrapText(true); |
| 52 | + dbHost.setText(MysqlConfig.getDbHost()); |
| 53 | + dbPort.setText(MysqlConfig.getDbPort()); |
| 54 | + dbCondition.setText(MysqlConfig.getDbCondition()); |
| 55 | + dbName.setText(MysqlConfig.getDbName()); |
| 56 | + dbPassword.setText(MysqlConfig.getDbPassword()); |
| 57 | + dbTable.setText(MysqlConfig.getTableName()); |
| 58 | + dbUsername.setText(MysqlConfig.getDbUsername()); |
| 59 | + if (Checker.isNotEmpty(MysqlConfig.getFields())) { |
| 60 | + StringBuilder sb = new StringBuilder(); |
| 61 | + for (Pair<String, String> pair : MysqlConfig.getFields()) { |
| 62 | + sb.append(pair.getKey()).append(" -> ").append(pair.getValue()).append(", "); |
| 63 | + } |
| 64 | + String mapping = sb.toString(); |
| 65 | + mappings.setText(mapping.substring(0, mapping.length() - 2)); |
| 66 | + } |
48 | 67 | } |
49 | 68 | } |
0 commit comments