Skip to content

Commit 74bef58

Browse files
committed
下面所有的配置都会在保存
1 parent 4792bdb commit 74bef58

File tree

5 files changed

+28
-8
lines changed

5 files changed

+28
-8
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ Eclipse or IntelliJ IDEA中启动, 找到```com.zzg.mybatis.generator.MainUI```
7777

7878
### 赞助
7979
本工具纯属个人业余时间开发与维护,如果你觉得软件对你有用,欢迎赞助,金额随意 :)
80+
81+
<img src="https://user-images.githubusercontent.com/3505708/38162358-423d2d18-3512-11e8-9b52-c188bf37671d.png" width="200"> <img src="https://user-images.githubusercontent.com/3505708/38162365-56f8f55c-3512-11e8-8fd8-b8ae4f0ad3c8.png" width="200">
8082
- - -
8183
Licensed under the Apache 2.0 License
8284

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.zzg</groupId>
55
<artifactId>mybatis-generator-gui</artifactId>
6-
<version>0.8.7</version>
6+
<version>0.8.8-SNAPSHOT</version>
77

88
<properties>
99
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

src/main/java/com/zzg/mybatis/generator/controller/MainUIController.java

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,10 @@ public void saveGeneratorConfig() {
325325
try {
326326
GeneratorConfig generatorConfig = getGeneratorConfigFromUI();
327327
generatorConfig.setName(name);
328+
ConfigHelper.deleteGeneratorConfig(name);
328329
ConfigHelper.saveGeneratorConfig(generatorConfig);
329330
} catch (Exception e) {
330-
AlertUtil.showErrorAlert("删除配置失败");
331+
AlertUtil.showErrorAlert("保存配置失败");
331332
}
332333
}
333334
}
@@ -368,11 +369,27 @@ public void setGeneratorConfigIntoUI(GeneratorConfig generatorConfig) {
368369
generateKeysField.setText(generatorConfig.getGenerateKeys());
369370
modelTargetProject.setText(generatorConfig.getModelPackageTargetFolder());
370371
daoTargetPackage.setText(generatorConfig.getDaoPackage());
371-
daoTargetProject.setText(generatorConfig.getDaoTargetFolder());
372-
mapperTargetPackage.setText(generatorConfig.getMappingXMLPackage());
372+
daoTargetProject.setText(generatorConfig.getMapperName());
373+
mapperName.setText(generatorConfig.getMapperName());
374+
mapperTargetPackage.setText(generatorConfig.getMappingXMLPackage());
373375
mappingTargetProject.setText(generatorConfig.getMappingXMLTargetFolder());
376+
tableNameField.setText(generatorConfig.getTableName());
377+
domainObjectNameField.setText(generatorConfig.getDomainObjectName());
378+
offsetLimitCheckBox.setSelected(generatorConfig.isOffsetLimit());
379+
commentCheckBox.setSelected(generatorConfig.isComment());
380+
overrideXML.setSelected(generatorConfig.isOverrideXML());
381+
needToStringHashcodeEquals.setSelected(generatorConfig.isNeedToStringHashcodeEquals());
382+
useTableNameAliasCheckbox.setSelected(generatorConfig.getUseTableNameAlias());
383+
forUpdateCheckBox.setSelected(generatorConfig.isNeedForUpdate());
384+
annotationDAOCheckBox.setSelected(generatorConfig.isAnnotationDAO());
385+
annotationCheckBox.setSelected(generatorConfig.isAnnotation());
386+
useActualColumnNamesCheckbox.setSelected(generatorConfig.isUseActualColumnNames());
374387
encodingChoice.setValue(generatorConfig.getEncoding());
375388
useExample.setSelected(generatorConfig.isUseExample());
389+
useDAOExtendStyle.setSelected(generatorConfig.isUseDAOExtendStyle());
390+
useSchemaPrefix.setSelected(generatorConfig.isUseSchemaPrefix());
391+
jsr310Support.setSelected(generatorConfig.isJsr310Support());
392+
376393
}
377394

378395
@FXML

src/main/resources/fxml/MainUI.fxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@
222222
<HBox.margin>
223223
<Insets right="10.0" />
224224
</HBox.margin></CheckBox>
225-
<CheckBox fx:id="useSchemaPrefix" mnemonicParsing="false" selected="true" text="使用Schema前缀" />
225+
<CheckBox fx:id="useSchemaPrefix" mnemonicParsing="false" text="使用Schema前缀" />
226226
</children>
227227
</HBox>
228228
<HBox prefHeight="100.0" prefWidth="200.0" spacing="18.0">

src/main/resources/fxml/selectTableColumn.fxml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3+
<?import javafx.scene.text.*?>
34
<?import javafx.scene.control.*?>
45
<?import javafx.scene.layout.*?>
5-
<?import javafx.scene.text.Text?>
6+
67
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="526.0" prefWidth="730.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.zzg.mybatis.generator.controller.SelectTableColumnController">
78
<children>
89
<TableView fx:id="columnListView" editable="true" prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="50.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="100.0">
@@ -20,7 +21,7 @@
2021
</TableView>
2122
<Button focusTraversable="false" layoutX="642.0" layoutY="453.0" mnemonicParsing="false" onAction="#ok" prefHeight="27.0" prefWidth="59.0" text="确认" AnchorPane.bottomAnchor="13.0" AnchorPane.rightAnchor="29.0" />
2223
<Button focusTraversable="false" layoutX="556.0" layoutY="486.0" mnemonicParsing="false" onAction="#cancel" text="取消" AnchorPane.bottomAnchor="13.0" AnchorPane.rightAnchor="113.0" />
23-
<Text layoutX="12.0" layoutY="64.0" lineSpacing="5.0" strokeType="OUTSIDE" strokeWidth="0.0" text="2. 如果要定制列的Java数据类型, 字段名或者自动类型转换双击对应的地方编辑即可" wrappingWidth="706.0" />
24-
<Text layoutX="14.0" layoutY="35.0" strokeType="OUTSIDE" strokeWidth="0.0" text="1. 如果要忽略请取消列的选择" />
24+
<Text layoutX="12.0" layoutY="62.0" lineSpacing="5.0" strokeType="OUTSIDE" strokeWidth="0.0" text="2. 如果要定制列的Java数据类型, 编辑Java Type和Property Name或者你自己的Type Handler, 注意要按Enter键保存,然后再点击确认方可生效。" wrappingWidth="706.0" />
25+
<Text layoutX="14.0" layoutY="35.0" strokeType="OUTSIDE" strokeWidth="0.0" text="1. 如果不想生成某列请取消勾选对应的列" />
2526
</children>
2627
</AnchorPane>

0 commit comments

Comments
 (0)