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