添加注解
parent
20b4eb3f75
commit
64ed73b319
|
@ -1,4 +1,5 @@
|
||||||
import aiyh.utils.Util;
|
import aiyh.utils.Util;
|
||||||
|
import aiyh.utils.tool.cn.hutool.core.util.StrUtil;
|
||||||
import builderpackage.FileCompressor;
|
import builderpackage.FileCompressor;
|
||||||
import builderpackage.FileInfo;
|
import builderpackage.FileInfo;
|
||||||
import builderpackage.FileTreeBuilder;
|
import builderpackage.FileTreeBuilder;
|
||||||
|
@ -27,6 +28,9 @@ public class BuilderPackageEcology extends Application {
|
||||||
private TreeView<FileInfo> treeView;
|
private TreeView<FileInfo> treeView;
|
||||||
private TreeItem<FileInfo> rootItem;
|
private TreeItem<FileInfo> rootItem;
|
||||||
|
|
||||||
|
private TextField packageNumberTextField;
|
||||||
|
private TextField functionNameTextField;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start(Stage primaryStage) {
|
public void start(Stage primaryStage) {
|
||||||
primaryStage.setTitle("EBU7部开发一部自动打包工具");
|
primaryStage.setTitle("EBU7部开发一部自动打包工具");
|
||||||
|
@ -37,10 +41,29 @@ public class BuilderPackageEcology extends Application {
|
||||||
treeView = new TreeView<>(rootItem);
|
treeView = new TreeView<>(rootItem);
|
||||||
treeView.setShowRoot(false);
|
treeView.setShowRoot(false);
|
||||||
treeView.setCellFactory(treeViewParam -> new CheckBoxTreeCell());
|
treeView.setCellFactory(treeViewParam -> new CheckBoxTreeCell());
|
||||||
|
treeView.setPadding(new Insets(10));
|
||||||
|
|
||||||
BorderPane root = new BorderPane();
|
BorderPane root = new BorderPane();
|
||||||
root.setCenter(treeView);
|
root.setCenter(treeView);
|
||||||
|
|
||||||
|
// 添加输入框
|
||||||
|
HBox topBox = new HBox(10);
|
||||||
|
topBox.setPadding(new Insets(10));
|
||||||
|
topBox.setAlignment(Pos.CENTER);
|
||||||
|
|
||||||
|
// 创建包编号标签和输入框
|
||||||
|
Label packageNumberLabel = new Label("包编号:");
|
||||||
|
packageNumberTextField = new TextField();
|
||||||
|
packageNumberTextField.setPromptText("请输入包编号");
|
||||||
|
|
||||||
|
// 创建功能名称标签和输入框
|
||||||
|
Label functionNameLabel = new Label("功能名称:");
|
||||||
|
functionNameTextField = new TextField();
|
||||||
|
functionNameTextField.setPromptText("请输入功能名称");
|
||||||
|
|
||||||
|
topBox.getChildren().addAll(packageNumberLabel, packageNumberTextField, functionNameLabel, functionNameTextField);
|
||||||
|
root.setTop(topBox);
|
||||||
|
|
||||||
HBox buttonBox = new HBox();
|
HBox buttonBox = new HBox();
|
||||||
buttonBox.setSpacing(10);
|
buttonBox.setSpacing(10);
|
||||||
buttonBox.setPadding(new Insets(10));
|
buttonBox.setPadding(new Insets(10));
|
||||||
|
@ -49,7 +72,13 @@ public class BuilderPackageEcology extends Application {
|
||||||
Button button = new Button("生成升级包");
|
Button button = new Button("生成升级包");
|
||||||
button.setOnAction(event -> {
|
button.setOnAction(event -> {
|
||||||
FileChooser fileChooser = new FileChooser();
|
FileChooser fileChooser = new FileChooser();
|
||||||
fileChooser.setInitialFileName("sh_ebu_dev_1_ecology.zip");
|
String defaultName = FileTreeBuilder.zipDefaultName;
|
||||||
|
if (StrUtil.isBlank(defaultName)) {
|
||||||
|
defaultName = "sh_ebu_dev_1_ecology.zip";
|
||||||
|
}
|
||||||
|
|
||||||
|
fileChooser.setInitialFileName(defaultName);
|
||||||
|
// fileChooser.setInitialDirectory();
|
||||||
File outputFile = fileChooser.showSaveDialog(primaryStage);
|
File outputFile = fileChooser.showSaveDialog(primaryStage);
|
||||||
if (outputFile != null) {
|
if (outputFile != null) {
|
||||||
try {
|
try {
|
||||||
|
@ -70,6 +99,12 @@ public class BuilderPackageEcology extends Application {
|
||||||
updateTreeView();
|
updateTreeView();
|
||||||
showSuccessAlert("升级包制作成功!");
|
showSuccessAlert("升级包制作成功!");
|
||||||
System.out.println("压缩包位置: " + outputFile.getPath());
|
System.out.println("压缩包位置: " + outputFile.getPath());
|
||||||
|
|
||||||
|
// 输出包编号和功能名称的值
|
||||||
|
String packageNumber = packageNumberTextField.getText();
|
||||||
|
String functionName = functionNameTextField.getText();
|
||||||
|
System.out.println("包编号: " + packageNumber);
|
||||||
|
System.out.println("功能名称: " + functionName);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
@ -87,9 +122,11 @@ public class BuilderPackageEcology extends Application {
|
||||||
|
|
||||||
checkBoxBox.getChildren().add(checkBox);
|
checkBoxBox.getChildren().add(checkBox);
|
||||||
|
|
||||||
|
|
||||||
buttonBox.getChildren().addAll(button, checkBoxBox);
|
buttonBox.getChildren().addAll(button, checkBoxBox);
|
||||||
root.setBottom(buttonBox);
|
root.setBottom(buttonBox);
|
||||||
|
|
||||||
|
|
||||||
Scene scene = new Scene(root, 600, 400);
|
Scene scene = new Scene(root, 600, 400);
|
||||||
scene.getStylesheets().add("style.css"); // 加载自定义的 CSS 文件
|
scene.getStylesheets().add("style.css"); // 加载自定义的 CSS 文件
|
||||||
primaryStage.setScene(scene);
|
primaryStage.setScene(scene);
|
||||||
|
|
|
@ -16,6 +16,10 @@ public class FileTreeBuilder {
|
||||||
|
|
||||||
public static String classPath;
|
public static String classPath;
|
||||||
|
|
||||||
|
public static String zipDefaultName;
|
||||||
|
|
||||||
|
public static String defaultDir;
|
||||||
|
|
||||||
public static FileInfo buildFileTree() {
|
public static FileInfo buildFileTree() {
|
||||||
String directoryPath = "target";
|
String directoryPath = "target";
|
||||||
String classRootPath = "";
|
String classRootPath = "";
|
||||||
|
@ -40,6 +44,8 @@ public class FileTreeBuilder {
|
||||||
}
|
}
|
||||||
classRootPath = properties.getProperty("classRootPath");
|
classRootPath = properties.getProperty("classRootPath");
|
||||||
classPath = classRootPath;
|
classPath = classRootPath;
|
||||||
|
zipDefaultName = properties.getProperty("zipDefaultName");
|
||||||
|
defaultDir = properties.getProperty("defaultDir");
|
||||||
List<String> blacklistPrefixes = Arrays.asList(
|
List<String> blacklistPrefixes = Arrays.asList(
|
||||||
directoryPath + "generated-sources",
|
directoryPath + "generated-sources",
|
||||||
directoryPath + "generated-test-sources",
|
directoryPath + "generated-test-sources",
|
||||||
|
|
Loading…
Reference in New Issue